e2e

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyNewVersion added in v0.7.0

func ApplyNewVersion(t *testing.T, data *TestData, antreaYML, chOperatorYML, flowVisibilityYML string)

func DeleteJob added in v0.5.0

func DeleteJob(t *testing.T, data *TestData, cmd string) (stdout string, err error)

func GetJobStatus added in v0.5.0

func GetJobStatus(t *testing.T, data *TestData, cmd string) (stdout string, err error)

func IsDirEmpty

func IsDirEmpty(name string) (bool, error)

IsDirEmpty checks whether a directory is empty or not.

func ListJobs added in v0.5.0

func ListJobs(t *testing.T, data *TestData, cmd string) (stdout string, err error)

func RetrieveJobResult added in v0.5.0

func RetrieveJobResult(t *testing.T, data *TestData, cmd string) (stdout string, err error)

func RunJob added in v0.5.0

func RunJob(t *testing.T, data *TestData, jobcmd string) (stdout string, jobName string, err error)

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

func TheiaManagerRestart(t *testing.T, data *TestData, jobName1 string, job string) error

func VerifyJobCleaned added in v0.6.0

func VerifyJobCleaned(t *testing.T, data *TestData, jobName string, tablename string, prefixlen int) error

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 PodCondition

type PodCondition func(*corev1.Pod) (bool, error)

type PodIPs

type PodIPs struct {
	// contains filtered or unexported fields
}

func (PodIPs) String

func (p PodIPs) String() string

type TestData

type TestData struct {
	// contains filtered or unexported fields
}

TestData stores the state required for each test case.

func (*TestData) CleanACNPs

func (data *TestData) CleanACNPs() error

CleanACNPs is a convenience function for deleting all Antrea ClusterNetworkPolicies in the cluster.

func (*TestData) CleanCGs

func (data *TestData) CleanCGs() error

CleanCGs is a convenience function for deleting all ClusterGroups in the cluster.

func (*TestData) Cleanup

func (data *TestData) Cleanup(namespaces []string)

func (*TestData) CreateClient

func (data *TestData) CreateClient(kubeconfigPath string) error

CreateClient initializes the K8s clientset in the TestData structure.

func (*TestData) CreateNamespace

func (data *TestData) CreateNamespace(namespace string, mutateFunc func(*corev1.Namespace)) error

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

func (data *TestData) DeleteACNP(name string) error

DeleteACNP is a convenience function for deleting ACNP by name.

func (*TestData) DeleteANP

func (data *TestData) DeleteANP(ns, name string) error

DeleteANP is a convenience function for deleting ANP by name and Namespace.

func (*TestData) DeleteNamespace

func (data *TestData) DeleteNamespace(namespace string, timeout time.Duration) error

DeleteNamespace deletes the provided namespace and waits for deletion to actually complete.

func (*TestData) DeletePod

func (data *TestData) DeletePod(namespace, name string) error

DeletePod deletes a Pod in the test namespace.

func (*TestData) DeleteV1Alpha2CG

func (data *TestData) DeleteV1Alpha2CG(name string) error

DeleteV1Alpha2CG is a convenience function for deleting crd/v1alpha2 ClusterGroup by name.

func (*TestData) DeleteV1Alpha3CG

func (data *TestData) DeleteV1Alpha3CG(name string) error

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

func (data *TestData) GetService(namespace, name string) (*corev1.Service, error)

GetService is a convenience function for getting Service

func (*TestData) InitProvider

func (data *TestData) InitProvider(providerName, providerConfigPath string) error

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.

func (*TestData) RunCommandOnNode

func (data *TestData) RunCommandOnNode(nodeName string, cmd string) (code int, stdout string, stderr string, err error)

RunCommandOnNode is a convenience wrapper around the Provider interface RunCommandOnNode method.

func (*TestData) WaitNetworkPolicyRealize

func (data *TestData) WaitNetworkPolicyRealize(nodeName string, table *openflow.Table, policyRules int) error

type TestOptions

type TestOptions struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL