Documentation ¶
Index ¶
- func IsDirEmpty(name string) (bool, error)
- func RunCommandOnNode(nodeName string, cmd string) (code int, stdout string, stderr string, err error)
- type ClusterInfo
- type ClusterNode
- type Connectivity
- type KubernetesUtils
- func (k *KubernetesUtils) Bootstrap(namespaces, pods []string) (*map[string]string, error)
- func (k *KubernetesUtils) CleanACNPs() error
- func (k *KubernetesUtils) CleanANPs(namespaces []string) error
- func (k *KubernetesUtils) CleanNetworkPolicies(namespaces []string) error
- func (k *KubernetesUtils) Cleanup(namespaces []string) error
- func (k *KubernetesUtils) CreateNewTier(name string, tierPriority int32) (*secv1alpha1.Tier, error)
- func (k *KubernetesUtils) CreateOrUpdateACNP(cnp *secv1alpha1.ClusterNetworkPolicy) (*secv1alpha1.ClusterNetworkPolicy, error)
- func (k *KubernetesUtils) CreateOrUpdateANP(anp *secv1alpha1.NetworkPolicy) (*secv1alpha1.NetworkPolicy, error)
- func (k *KubernetesUtils) CreateOrUpdateDeployment(ns, deploymentName string, replicas int32, labels map[string]string) (*appsv1.Deployment, error)
- func (k *KubernetesUtils) CreateOrUpdateNamespace(n string, labels map[string]string) (*v1.Namespace, error)
- func (k *KubernetesUtils) CreateOrUpdateNetworkPolicy(ns string, netpol *v1net.NetworkPolicy) (*v1net.NetworkPolicy, error)
- func (k *KubernetesUtils) DeleteTier(name string) error
- func (k *KubernetesUtils) GetPod(ns string, name string) (*v1.Pod, error)
- func (k *KubernetesUtils) GetPods(ns string, key string, val string) ([]v1.Pod, error)
- func (k *KubernetesUtils) Probe(ns1, pod1, ns2, pod2 string, port int) (bool, error)
- func (k *KubernetesUtils) UpdateTier(tier *secv1alpha1.Tier) (*secv1alpha1.Tier, error)
- func (k *KubernetesUtils) Validate(allPods []Pod, reachability *Reachability, port int)
- type Pod
- type PodCondition
- type PodIPs
- type Reachability
- func (r *Reachability) Expect(pod1 Pod, pod2 Pod, isConnected bool)
- func (r *Reachability) ExpectAllEgress(pod Pod, connected bool)
- func (r *Reachability) ExpectAllIngress(pod Pod, connected bool)
- func (r *Reachability) ExpectConn(spec *Connectivity)
- func (r *Reachability) ExpectSelf(allPods []Pod, isConnected bool)
- func (r *Reachability) Observe(pod1 Pod, pod2 Pod, isConnected bool)
- func (r *Reachability) PrintSummary(printExpected bool, printObserved bool, printComparison bool)
- func (r *Reachability) Summary() (trueObs int, falseObs int, comparison *TruthTable)
- type TestData
- func (data *TestData) GetAgentFeatures(antreaNamespace string) (featuregate.FeatureGate, error)
- func (data *TestData) GetAntreaConfigMap(antreaNamespace string) (*corev1.ConfigMap, error)
- func (data *TestData) GetControllerFeatures(antreaNamespace string) (featuregate.FeatureGate, error)
- func (data *TestData) GetEncapMode() (config.TrafficEncapModeType, error)
- func (data *TestData) GetFlowAggregatorConfigMap() (*corev1.ConfigMap, error)
- func (data *TestData) GetGatewayInterfaceName(antreaNamespace string) (string, error)
- type TestOptions
- type TruthTable
- func (tt *TruthTable) Compare(other *TruthTable) *TruthTable
- func (tt *TruthTable) Get(from string, to string) bool
- func (tt *TruthTable) IsComplete() bool
- func (tt *TruthTable) PrettyPrint(indent string) string
- func (tt *TruthTable) Set(from string, to string, value bool)
- func (tt *TruthTable) SetAllFrom(from string, value bool)
- func (tt *TruthTable) SetAllTo(to string, value bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDirEmpty ¶
IsDirEmpty checks whether a directory is empty or not.
Types ¶
type ClusterInfo ¶
type ClusterInfo struct {
// contains filtered or unexported fields
}
type ClusterNode ¶
type ClusterNode struct {
// contains filtered or unexported fields
}
type Connectivity ¶ added in v0.8.0
type KubernetesUtils ¶ added in v0.8.0
type KubernetesUtils struct { *TestData // contains filtered or unexported fields }
func NewKubernetesUtils ¶ added in v0.8.0
func NewKubernetesUtils(data *TestData) (*KubernetesUtils, error)
func (*KubernetesUtils) Bootstrap ¶ added in v0.8.0
func (k *KubernetesUtils) Bootstrap(namespaces, pods []string) (*map[string]string, error)
func (*KubernetesUtils) CleanACNPs ¶ added in v0.12.0
func (k *KubernetesUtils) CleanACNPs() error
CleanACNPs is a convenience function for deleting AntreaClusterNetworkPolicies before startup of any new test.
func (*KubernetesUtils) CleanANPs ¶ added in v0.10.0
func (k *KubernetesUtils) CleanANPs(namespaces []string) error
CleanANPs is a convenience function for deleting Antrea NetworkPolicies before startup of any new test.
func (*KubernetesUtils) CleanNetworkPolicies ¶ added in v0.8.0
func (k *KubernetesUtils) CleanNetworkPolicies(namespaces []string) error
CleanNetworkPolicies is a convenience function for deleting network policies before startup of any new test.
func (*KubernetesUtils) Cleanup ¶ added in v0.8.0
func (k *KubernetesUtils) Cleanup(namespaces []string) error
func (*KubernetesUtils) CreateNewTier ¶ added in v0.10.0
func (k *KubernetesUtils) CreateNewTier(name string, tierPriority int32) (*secv1alpha1.Tier, error)
CreateTier is a convenience function for creating an Antrea Policy Tier by name and priority.
func (*KubernetesUtils) CreateOrUpdateACNP ¶ added in v0.12.0
func (k *KubernetesUtils) CreateOrUpdateACNP(cnp *secv1alpha1.ClusterNetworkPolicy) (*secv1alpha1.ClusterNetworkPolicy, error)
CreateOrUpdateACNP is a convenience function for updating/creating AntreaClusterNetworkPolicies.
func (*KubernetesUtils) CreateOrUpdateANP ¶ added in v0.10.0
func (k *KubernetesUtils) CreateOrUpdateANP(anp *secv1alpha1.NetworkPolicy) (*secv1alpha1.NetworkPolicy, error)
CreateOrUpdateANP is a convenience function for updating/creating Antrea NetworkPolicies.
func (*KubernetesUtils) CreateOrUpdateDeployment ¶ added in v0.8.0
func (k *KubernetesUtils) CreateOrUpdateDeployment(ns, deploymentName string, replicas int32, labels map[string]string) (*appsv1.Deployment, error)
CreateOrUpdateDeployment is a convenience function for idempotent setup of deployments
func (*KubernetesUtils) CreateOrUpdateNamespace ¶ added in v0.8.0
func (k *KubernetesUtils) CreateOrUpdateNamespace(n string, labels map[string]string) (*v1.Namespace, error)
CreateOrUpdateNamespace is a convenience function for idempotent setup of Namespaces
func (*KubernetesUtils) CreateOrUpdateNetworkPolicy ¶ added in v0.8.0
func (k *KubernetesUtils) CreateOrUpdateNetworkPolicy(ns string, netpol *v1net.NetworkPolicy) (*v1net.NetworkPolicy, error)
CreateOrUpdateNetworkPolicy is a convenience function for updating/creating netpols. Updating is important since some tests update a network policy to confirm that mutation works with a CNI.
func (*KubernetesUtils) DeleteTier ¶ added in v0.10.0
func (k *KubernetesUtils) DeleteTier(name string) error
DeleteTier is a convenience function for deleting an Antrea Policy Tier with specific name.
func (*KubernetesUtils) GetPod ¶ added in v0.8.0
GetPod returns a Pod with the matching Namespace and name
func (*KubernetesUtils) GetPods ¶ added in v0.8.0
GetPods returns an array of all Pods in the given Namespace having a k/v label pair.
func (*KubernetesUtils) Probe ¶ added in v0.8.0
func (k *KubernetesUtils) Probe(ns1, pod1, ns2, pod2 string, port int) (bool, error)
Probe execs into a Pod and checks its connectivity to another Pod. Of course it assumes that the target Pod is serving on the input port, and also that ncat is installed.
func (*KubernetesUtils) UpdateTier ¶ added in v0.12.0
func (k *KubernetesUtils) UpdateTier(tier *secv1alpha1.Tier) (*secv1alpha1.Tier, error)
UpdateTier is a convenience function for updating an Antrea Policy Tier.
func (*KubernetesUtils) Validate ¶ added in v0.8.0
func (k *KubernetesUtils) Validate(allPods []Pod, reachability *Reachability, port int)
type Reachability ¶ added in v0.8.0
type Reachability struct { Expected *TruthTable Observed *TruthTable Pods []Pod }
func NewReachability ¶ added in v0.8.0
func NewReachability(pods []Pod, defaultExpectation bool) *Reachability
func (*Reachability) Expect ¶ added in v0.8.0
func (r *Reachability) Expect(pod1 Pod, pod2 Pod, isConnected bool)
func (*Reachability) ExpectAllEgress ¶ added in v0.8.0
func (r *Reachability) ExpectAllEgress(pod Pod, connected bool)
ExpectAllEgress defines that any traffic going out of the pod will be allowed/denied (true/false)
func (*Reachability) ExpectAllIngress ¶ added in v0.8.0
func (r *Reachability) ExpectAllIngress(pod Pod, connected bool)
ExpectAllIngress defines that any traffic going into the pod will be allowed/denied (true/false)
func (*Reachability) ExpectConn ¶ added in v0.8.0
func (r *Reachability) ExpectConn(spec *Connectivity)
ExpectConn is an experimental way to describe connectivity with named fields
func (*Reachability) ExpectSelf ¶ added in v0.8.0
func (r *Reachability) ExpectSelf(allPods []Pod, isConnected bool)
func (*Reachability) Observe ¶ added in v0.8.0
func (r *Reachability) Observe(pod1 Pod, pod2 Pod, isConnected bool)
func (*Reachability) PrintSummary ¶ added in v0.8.0
func (r *Reachability) PrintSummary(printExpected bool, printObserved bool, printComparison bool)
func (*Reachability) Summary ¶ added in v0.8.0
func (r *Reachability) Summary() (trueObs int, falseObs int, comparison *TruthTable)
type TestData ¶
type TestData struct {
// contains filtered or unexported fields
}
TestData stores the state required for each test case.
func (*TestData) GetAgentFeatures ¶ added in v0.11.0
func (data *TestData) GetAgentFeatures(antreaNamespace string) (featuregate.FeatureGate, error)
func (*TestData) GetAntreaConfigMap ¶ added in v0.8.0
func (*TestData) GetControllerFeatures ¶ added in v0.11.0
func (data *TestData) GetControllerFeatures(antreaNamespace string) (featuregate.FeatureGate, error)
func (*TestData) GetEncapMode ¶ added in v0.4.0
func (data *TestData) GetEncapMode() (config.TrafficEncapModeType, error)
func (*TestData) GetFlowAggregatorConfigMap ¶ added in v0.12.0
type TestOptions ¶
type TestOptions struct {
// contains filtered or unexported fields
}
type TruthTable ¶ added in v0.8.0
type TruthTable struct { Items []string Values map[string]map[string]bool // contains filtered or unexported fields }
func NewTruthTable ¶ added in v0.8.0
func NewTruthTable(items []string, defaultValue *bool) *TruthTable
func (*TruthTable) Compare ¶ added in v0.8.0
func (tt *TruthTable) Compare(other *TruthTable) *TruthTable
func (*TruthTable) IsComplete ¶ added in v0.8.0
func (tt *TruthTable) IsComplete() bool
IsComplete returns true if there's a value set for every single pair of items, otherwise it returns false.
func (*TruthTable) PrettyPrint ¶ added in v0.8.0
func (tt *TruthTable) PrettyPrint(indent string) string
func (*TruthTable) Set ¶ added in v0.8.0
func (tt *TruthTable) Set(from string, to string, value bool)
func (*TruthTable) SetAllFrom ¶ added in v0.8.0
func (tt *TruthTable) SetAllFrom(from string, value bool)
func (*TruthTable) SetAllTo ¶ added in v0.8.0
func (tt *TruthTable) SetAllTo(to string, value bool)