Documentation
¶
Index ¶
- func ApplyNewVersion(t *testing.T, data *TestData, ...)
- func ClearCovFolder(nodeName, covPrefix string) error
- func ControlPlaneNoScheduleTolerations() []corev1.Toleration
- func CopyCovFolder(nodeName, covDir, covPrefix string) error
- func DeleteJob(t *testing.T, data *TestData, cmd string) (stdout string, err error)
- func ExportLogs(tb testing.TB, data *TestData, logsSubDir string, writeNodeLogs bool, ...)
- func GetImageName(uri string) string
- 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 TeardownFlowVisibility(tb testing.TB, data *TestData, config FlowVisibilitySetUpConfig, ...)
- 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 ClickHouseFullRow
- 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) CollectPodCIDRInfo(controlPlaneName string) error
- func (data *TestData) CreateClient(kubeconfigPath string) error
- func (data *TestData) CreateNamespace(namespace string, mutateFunc func(*corev1.Namespace)) error
- func (data *TestData) CreateOrUpdateANP(anp *v1beta1.NetworkPolicy) (*v1beta1.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) GetClientSet() kubernetes.Interface
- func (data *TestData) GetClusterName() string
- func (data *TestData) GetControlPlaneNodeIP(label string) (string, error)
- func (data *TestData) GetFlowAggregator() (string, error)
- func (data *TestData) GetFlowAggregatorConfigMap() (*corev1.ConfigMap, error)
- func (data *TestData) GetPodLogs(namespace, name string, podLogOpts *corev1.PodLogOptions) (string, error)
- func (data *TestData) GetPodV4NetworkCIDR() string
- func (data *TestData) GetPodV6NetworkCIDR() string
- func (data *TestData) GetService(namespace, name string) (*corev1.Service, error)
- func (data *TestData) InitProvider(providerName, providerConfigPath string) error
- func (data *TestData) KillProcesses(namespace, podName, containerName, processName string) error
- func (data *TestData) MutateFlowAggregatorConfigMap(datbaseURL string, security bool) error
- func (data *TestData) PodWaitFor(timeout time.Duration, name, namespace string, condition PodCondition) (*corev1.Pod, error)
- func (data *TestData) PodWaitForReady(timeout time.Duration, name, namespace string) 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) SetClusterName(name string)
- 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 ClearCovFolder ¶ added in v0.7.1
func ControlPlaneNoScheduleTolerations ¶ added in v0.7.1
func ControlPlaneNoScheduleTolerations() []corev1.Toleration
func CopyCovFolder ¶ added in v0.7.1
func ExportLogs ¶ added in v0.7.1
func GetImageName ¶ added in v0.7.1
GetImageName gets the image name from the fully qualified URI. For example: "gcr.io/kubernetes-e2e-test-images/agnhost:2.8" gets "agnhost".
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 TeardownFlowVisibility ¶ added in v0.7.1
func TeardownFlowVisibility(tb testing.TB, data *TestData, config FlowVisibilitySetUpConfig, nodeName string)
func TheiaManagerRestart ¶ added in v0.6.0
Types ¶
type ClickHouseFullRow ¶ added in v0.7.1
type ClickHouseFullRow struct { TimeInserted time.Time `json:"timeInserted"` FlowStartSeconds time.Time `json:"flowStartSeconds"` FlowEndSeconds time.Time `json:"flowEndSeconds"` FlowEndSecondsFromSourceNode time.Time `json:"flowEndSecondsFromSourceNode"` FlowEndSecondsFromDestinationNode time.Time `json:"flowEndSecondsFromDestinationNode"` FlowEndReason uint8 `json:"flowEndReason"` SourceIP string `json:"sourceIP"` DestinationIP string `json:"destinationIP"` SourceTransportPort uint16 `json:"sourceTransportPort"` DestinationTransportPort uint16 `json:"destinationTransportPort"` ProtocolIdentifier uint8 `json:"protocolIdentifier"` PacketTotalCount uint64 `json:"packetTotalCount,string"` OctetTotalCount uint64 `json:"octetTotalCount,string"` PacketDeltaCount uint64 `json:"packetDeltaCount,string"` OctetDeltaCount uint64 `json:"octetDeltaCount,string"` ReversePacketTotalCount uint64 `json:"reversePacketTotalCount,string"` ReverseOctetTotalCount uint64 `json:"reverseOctetTotalCount,string"` ReversePacketDeltaCount uint64 `json:"reversePacketDeltaCount,string"` ReverseOctetDeltaCount uint64 `json:"reverseOctetDeltaCount,string"` SourcePodName string `json:"sourcePodName"` SourcePodNamespace string `json:"sourcePodNamespace"` SourceNodeName string `json:"sourceNodeName"` DestinationPodName string `json:"destinationPodName"` DestinationPodNamespace string `json:"destinationPodNamespace"` DestinationNodeName string `json:"destinationNodeName"` DestinationClusterIP string `json:"destinationClusterIP"` DestinationServicePort uint16 `json:"destinationServicePort"` DestinationServicePortName string `json:"destinationServicePortName"` IngressNetworkPolicyName string `json:"ingressNetworkPolicyName"` IngressNetworkPolicyNamespace string `json:"ingressNetworkPolicyNamespace"` IngressNetworkPolicyRuleName string `json:"ingressNetworkPolicyRuleName"` IngressNetworkPolicyRuleAction uint8 `json:"ingressNetworkPolicyRuleAction"` IngressNetworkPolicyType uint8 `json:"ingressNetworkPolicyType"` EgressNetworkPolicyName string `json:"egressNetworkPolicyName"` EgressNetworkPolicyNamespace string `json:"egressNetworkPolicyNamespace"` EgressNetworkPolicyRuleName string `json:"egressNetworkPolicyRuleName"` EgressNetworkPolicyRuleAction uint8 `json:"egressNetworkPolicyRuleAction"` EgressNetworkPolicyType uint8 `json:"egressNetworkPolicyType"` TcpState string `json:"tcpState"` FlowType uint8 `json:"flowType"` SourcePodLabels string `json:"sourcePodLabels"` DestinationPodLabels string `json:"destinationPodLabels"` Throughput uint64 `json:"throughput,string"` ReverseThroughput uint64 `json:"reverseThroughput,string"` ThroughputFromSourceNode uint64 `json:"throughputFromSourceNode,string"` ThroughputFromDestinationNode uint64 `json:"throughputFromDestinationNode,string"` ReverseThroughputFromSourceNode uint64 `json:"reverseThroughputFromSourceNode,string"` ReverseThroughputFromDestinationNode uint64 `json:"reverseThroughputFromDestinationNode,string"` ClusterUUID string `json:"clusterUUID"` EgressName string `json:"egressName"` EgressIP string `json:"egressIP"` Trusted uint8 `json:"trusted"` }
func GetClickHouseOutput ¶ added in v0.7.1
func GetClickHouseOutput(t *testing.T, data *TestData, srcIP, dstIP, srcPort string, isDstService, checkAllRecords bool) []*ClickHouseFullRow
GetClickHouseOutput queries clickhouse with built-in client and checks if we have received all the expected records for a given flow with source IP, destination IP and source port. We send source port to ignore the control flows during the iperf test. Polling timeout is coded assuming IPFIX output has been checked first.
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
}
func CreateFlowVisibilitySetUpConfig ¶ added in v0.7.1
func CreateFlowVisibilitySetUpConfig(sparkOperator, grafana, clickHouseLocalPv, flowAggregator, flowAggregatorOnly bool) FlowVisibilitySetUpConfig
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) CollectPodCIDRInfo ¶ added in v0.7.1
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 *v1beta1.NetworkPolicy) (*v1beta1.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) GetClientSet ¶ added in v0.7.1
func (data *TestData) GetClientSet() kubernetes.Interface
func (*TestData) GetClusterName ¶ added in v0.7.1
func (*TestData) GetControlPlaneNodeIP ¶ added in v0.7.1
func (*TestData) GetFlowAggregator ¶ added in v0.7.1
GetFlowAggregator retrieves the name of the Flow-Aggregator Pod (flow-aggregator-*) running on a specific Node.
func (*TestData) GetFlowAggregatorConfigMap ¶ added in v0.7.1
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) GetPodV4NetworkCIDR ¶ added in v0.7.1
func (*TestData) GetPodV6NetworkCIDR ¶ added in v0.7.1
func (*TestData) GetService ¶
GetService is a convenience function for getting Service
func (*TestData) InitProvider ¶
func (*TestData) KillProcesses ¶ added in v0.7.1
func (*TestData) MutateFlowAggregatorConfigMap ¶ added in v0.7.1
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) PodWaitForReady ¶ added in v0.7.1
PodWaitForReady polls the k8s apiserver until the specified Pod is in the "Ready" status (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) SetClusterName ¶ added in v0.7.1
type TestOptions ¶
type TestOptions struct {
// contains filtered or unexported fields
}