Documentation ¶
Index ¶
- func ApplyNewVersion(t *testing.T, data *TestData, ...)
- func DeleteJob(t *testing.T, data *TestData, cmd string) (stdout string, err error)
- func GetJobStatus(t *testing.T, data *TestData, cmd string) (stdout string, err error)
- func IsDirEmpty(name string) (bool, error)
- func ListJobs(t *testing.T, data *TestData, cmd string) (stdout string, err error)
- func RetrieveJobResult(t *testing.T, data *TestData, cmd string) (stdout string, err error)
- func RunJob(t *testing.T, data *TestData, jobcmd string) (stdout string, jobName string, err error)
- func SetupClickHouseConnection(clientset kubernetes.Interface, kubeconfig string) (connect *sql.DB, portForward *portforwarder.PortForwarder, err error)
- func TheiaManagerRestart(t *testing.T, data *TestData, jobName1 string, job string) error
- func VerifyJobCleaned(t *testing.T, data *TestData, jobName string, tablename string, prefixlen int) error
- type ClusterInfo
- type ClusterNode
- type FlowVisibilitySetUpConfig
- type PodCondition
- type PodIPs
- type TestData
- func (data *TestData) CleanACNPs() error
- func (data *TestData) CleanCGs() error
- func (data *TestData) Cleanup(namespaces []string)
- func (data *TestData) CreateClient(kubeconfigPath string) error
- func (data *TestData) CreateNamespace(namespace string, mutateFunc func(*corev1.Namespace)) error
- func (data *TestData) CreateOrUpdateANP(anp *crdv1alpha1.NetworkPolicy) (*crdv1alpha1.NetworkPolicy, error)
- func (data *TestData) CreatePodOnNodeInNamespace(name, ns string, nodeName, ctrName string, image string, command []string, ...) error
- func (data *TestData) CreateService(serviceName, namespace string, port, targetPort int32, ...) (*corev1.Service, error)
- func (data *TestData) CreateServiceWithAnnotations(serviceName, namespace string, port, targetPort int32, ...) (*corev1.Service, error)
- func (data *TestData) DeleteACNP(name string) error
- func (data *TestData) DeleteANP(ns, name string) error
- func (data *TestData) DeleteNamespace(namespace string, timeout time.Duration) error
- func (data *TestData) DeletePod(namespace, name string) error
- func (data *TestData) DeleteV1Alpha2CG(name string) error
- func (data *TestData) DeleteV1Alpha3CG(name string) error
- func (data *TestData) GetPodLogs(namespace, name string, podLogOpts *corev1.PodLogOptions) (string, error)
- func (data *TestData) GetService(namespace, name string) (*corev1.Service, error)
- func (data *TestData) InitProvider(providerName, providerConfigPath string) error
- func (data *TestData) PodWaitFor(timeout time.Duration, name, namespace string, condition PodCondition) (*corev1.Pod, error)
- func (data *TestData) RunCommandFromPod(podNamespace string, podName string, containerName string, cmd []string) (stdout string, stderr string, err error)
- func (data *TestData) RunCommandOnNode(nodeName string, cmd string) (code int, stdout string, stderr string, err error)
- func (data *TestData) WaitNetworkPolicyRealize(nodeName string, table *openflow.Table, policyRules int) error
- type TestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyNewVersion ¶ added in v0.7.0
func GetJobStatus ¶ added in v0.5.0
func IsDirEmpty ¶
IsDirEmpty checks whether a directory is empty or not.
func RetrieveJobResult ¶ added in v0.5.0
func SetupClickHouseConnection ¶ added in v0.5.0
func SetupClickHouseConnection(clientset kubernetes.Interface, kubeconfig string) (connect *sql.DB, portForward *portforwarder.PortForwarder, err error)
func TheiaManagerRestart ¶ added in v0.6.0
Types ¶
type ClusterInfo ¶
type ClusterInfo struct {
// contains filtered or unexported fields
}
type ClusterNode ¶
type ClusterNode struct {
// contains filtered or unexported fields
}
type FlowVisibilitySetUpConfig ¶ added in v0.7.0
type FlowVisibilitySetUpConfig struct {
// contains filtered or unexported fields
}
type TestData ¶
type TestData struct {
// contains filtered or unexported fields
}
TestData stores the state required for each test case.
func (*TestData) CleanACNPs ¶
CleanACNPs is a convenience function for deleting all Antrea ClusterNetworkPolicies in the cluster.
func (*TestData) CleanCGs ¶
CleanCGs is a convenience function for deleting all ClusterGroups in the cluster.
func (*TestData) CreateClient ¶
CreateClient initializes the K8s clientset in the TestData structure.
func (*TestData) CreateNamespace ¶
CreateNamespace creates the provided namespace.
func (*TestData) CreateOrUpdateANP ¶
func (data *TestData) CreateOrUpdateANP(anp *crdv1alpha1.NetworkPolicy) (*crdv1alpha1.NetworkPolicy, error)
CreateOrUpdateANP is a convenience function for updating/creating Antrea NetworkPolicies.
func (*TestData) CreatePodOnNodeInNamespace ¶
func (data *TestData) CreatePodOnNodeInNamespace(name, ns string, nodeName, ctrName string, image string, command []string, args []string, env []corev1.EnvVar, ports []corev1.ContainerPort, hostNetwork bool, mutateFunc func(*corev1.Pod)) error
CreatePodOnNodeInNamespace creates a pod in the provided namespace with a container whose type is decided by imageName. Pod will be scheduled on the specified Node (if nodeName is not empty). mutateFunc can be used to customize the Pod if the other parameters don't meet the requirements.
func (*TestData) CreateService ¶
func (data *TestData) CreateService(serviceName, namespace string, port, targetPort int32, selector map[string]string, affinity, nodeLocalExternal bool, serviceType corev1.ServiceType, ipFamily *corev1.IPFamily) (*corev1.Service, error)
CreateService creates a service with port and targetPort.
func (*TestData) CreateServiceWithAnnotations ¶
func (data *TestData) CreateServiceWithAnnotations(serviceName, namespace string, port, targetPort int32, protocol corev1.Protocol, selector map[string]string, affinity, nodeLocalExternal bool, serviceType corev1.ServiceType, ipFamily *corev1.IPFamily, annotations map[string]string) (*corev1.Service, error)
CreateServiceWithAnnotations creates a service with Annotation
func (*TestData) DeleteACNP ¶
DeleteACNP is a convenience function for deleting ACNP by name.
func (*TestData) DeleteANP ¶
DeleteANP is a convenience function for deleting ANP by name and Namespace.
func (*TestData) DeleteNamespace ¶
DeleteNamespace deletes the provided namespace and waits for deletion to actually complete.
func (*TestData) DeleteV1Alpha2CG ¶
DeleteV1Alpha2CG is a convenience function for deleting crd/v1alpha2 ClusterGroup by name.
func (*TestData) DeleteV1Alpha3CG ¶
DeleteV1Alpha3CG is a convenience function for deleting core/v1alpha3 ClusterGroup by name.
func (*TestData) GetPodLogs ¶ added in v0.2.0
func (data *TestData) GetPodLogs(namespace, name string, podLogOpts *corev1.PodLogOptions) (string, error)
Gets pod logs from Pod
func (*TestData) GetService ¶
GetService is a convenience function for getting Service
func (*TestData) InitProvider ¶
func (*TestData) PodWaitFor ¶
func (data *TestData) PodWaitFor(timeout time.Duration, name, namespace string, condition PodCondition) (*corev1.Pod, error)
PodWaitFor polls the K8s apiserver until the specified Pod is found (in the test Namespace) and the condition predicate is met (or until the provided timeout expires).
func (*TestData) RunCommandFromPod ¶
func (data *TestData) RunCommandFromPod(podNamespace string, podName string, containerName string, cmd []string) (stdout string, stderr string, err error)
RunCommandFromPod Run the provided command in the specified Container for the give Pod and returns the contents of stdout and stderr as strings. An error either indicates that the command couldn't be run or that the command returned a non-zero error code.
type TestOptions ¶
type TestOptions struct {
// contains filtered or unexported fields
}