You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 26, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15-30
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,14 @@ The Test Network Function support autodiscovery using labels and annotations. Th
26
26
27
27
### targetNameSpaces
28
28
29
-
A single namespace should be specified in the [configuration file](test-network-function/tnf_config.yml). This namespace will be used by autodiscovery to find the Pods under test. To run multiple tests in different namespaces simultaneously, intrusive tests should be disabled by setting ``TNF_NON_INTRUSIVE_ONLY`` to true.
29
+
Multiple namespaces can be specified in the [configuration file](test-network-function/tnf_config.yml). Namespaces will be used by autodiscovery to find the Pods under test.
30
+
```shell script
31
+
targetNameSpaces:
32
+
- name: firstnamespace
33
+
- name: secondnamespace
34
+
```
30
35
### targetPodLabels
31
-
The goal of this section is to specify the label to be used to identify the CNF resources under test. It's highly recommended that the labels should be defined in pod definition rather than added after pod is created, as labels added later on will be lost in case the pod gets rescheduled. In case of pods defined as part a deployment, it's best to use the same label as the one defined in the `spec.selector.matchLabels` section of the deployment yaml. The prefix field can be used to avoid naming collision with other labels.
36
+
The goal of this section is to specify the labels to be used to identify the CNF resources under test. It's highly recommended that the labels should be defined in pod definition rather than added after pod is created, as labels added later on will be lost in case the pod gets rescheduled. In case of pods defined as part of a deployment, it's best to use the same label as the one defined in the `spec.selector.matchLabels` section of the deployment yaml. The prefix field can be used to avoid naming collision with other labels.
32
37
```shell script
33
38
targetPodLabels:
34
39
- prefix: test-network-function.com
@@ -56,32 +61,19 @@ The autodiscovery mechanism will create a list of all CRD names in the cluster w
56
61
57
62
### testTarget
58
63
#### podsUnderTest / containersUnderTest
59
-
This section is usually not required if labels defined in the section above cover all resources that should be tested. If label based discovery is not sufficient, this section can be manually populated as shown in the commented part of the [sample config](test-network-function/tnf_config.yml). However, intrusive tests need to be skipped ([see here](#disable-intrusive-tests)) for a reliable test result. The pods and containers explicitly configured here are added to the target pod/container lists populated through label matching.
60
-
61
-
For both configured and discovered pods/containers, the autodiscovery mechanism will attempt to identify the default network device and all the IP addresses of the pods it
62
-
needs for network connectivity tests, though that information can be explicitly set using annotations if needed. For Pod IPs:
64
+
The autodiscovery mechanism will attempt to identify the default network device and all the IP addresses of the pods it needs for network connectivity tests, though that information can be explicitly set using annotations if needed. For Pod IPs:
63
65
64
-
* The annotation `test-network-function.com/multusips` is the highest priority, and must contain a JSON-encoded list of
65
-
IP addresses to be tested for the pod. This must be explicitly set.
66
-
* If the above is not present, the `k8s.v1.cni.cncf.io/networks-status` annotation is checked and all IPs from it are
67
-
used. This annotation is automatically managed in OpenShift but may not be present in K8s.
68
-
* If neither of the above is present, then only known IPs associated with the pod are used (the pod `.status.ips` field).
66
+
* The annotation test-network-function.com/multusips is the highest priority, and must contain a JSON-encoded list of IP addresses to be tested for the pod. This must be explicitly set.
67
+
* If the above is not present, the k8s.v1.cni.cncf.io/networks-status annotation is checked and all IPs from it are used. This annotation is automatically managed in OpenShift but may not be present in K8s.
68
+
* If neither of the above is present, then only known IPs associated with the pod are used (the pod .status.ips field).
69
69
70
70
For Network Interfaces:
71
71
72
-
* The annotation `test-network-function.com/defaultnetworkinterface` is the highest priority, and must contain a
73
-
JSON-encoded string of the primary network interface for the pod. This must be explicitly set if needed. Examples can
74
-
be seen in [cnf-certification-test-partner](https://github.com/test-network-function/cnf-certification-test-partner/local-test-infra/local-pod-under-test/local-partner-pod.yaml)
75
-
* If the above is not present, the `k8s.v1.cni.cncf.io/networks-status` annotation is checked and the `"interface"` from
76
-
the first entry found with `"default"=true` is used. This annotation is automatically managed in OpenShift but may not
77
-
be present in K8s.
78
-
79
-
If multus IP addresses are discovered or configured, the partner pod needs to be deployed in the same namespace as the multus network interface for the connectivity test to pass. Refer to instruction [here](#specify-the-target-namespace-for-partner-pod-deployment).
80
-
81
-
If a pod is not suitable for network connectivity tests because it lacks binaries (e.g. `ping`), it should be
82
-
given the label `test-network-function.com/skip_connectivity_tests` to exclude it from those tests. The label value is
83
-
not important, only its presence. Equivalent to `excludeContainersFromConnectivityTests` in the config file.
72
+
* The annotation test-network-function.com/defaultnetworkinterface is the highest priority, and must contain a JSON-encoded string of the primary network interface for the pod. This must be explicitly set if needed. Examples can be seen in cnf-certification-test-partner
73
+
* If the above is not present, the k8s.v1.cni.cncf.io/networks-status annotation is checked and the "interface" from the first entry found with "default"=true is used. This annotation is automatically managed in OpenShift but may not be present in K8s.
74
+
* If multus IP addresses are discovered or configured, the partner pod needs to be deployed in the same namespace as the multus network interface for the connectivity test to pass. Refer to instruction here.
84
75
76
+
If a pod is not suitable for network connectivity tests because it lacks binaries (e.g. ping), it should be given the label test-network-function.com/skip_connectivity_tests to exclude it from those tests. The label value is not important, only its presence.
When this variable is set, the run-cnf-suites.sh script will deploy/refresh the partner deployments/pods in the cluster before starting the test run.
135
127
136
-
### Specify the target namespace for partner pod deployment
137
-
Set this variable to deploy partner pods in a custom namespace instead of the default `tnf` namespace.
138
-
139
-
```shell-script
140
-
export TNF_PARTNER_NAMESPACE="CNF-ns"
141
-
```
142
-
143
128
### Disconnected environment
144
129
In disconnected environment, only specific versions of images are mirrored to the local repo. For the `oc debug` command (used by a number of tests) to work, set TNF_OC_DEBUG_IMAGE_ID:
0 commit comments