Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

Commit 2879355

Browse files
hamadiseedcdavidjc-rh
authored
update readme (#473)
* update readme * Update README.md * Update README.md * Update README.md Co-authored-by: edcdavid <[email protected]> * fix Jun's comments * more fixes Co-authored-by: edcdavid <[email protected]> Co-authored-by: Jun Chen <[email protected]>
1 parent bced9a4 commit 2879355

File tree

2 files changed

+16
-60
lines changed

2 files changed

+16
-60
lines changed

README.md

+15-30
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,14 @@ The Test Network Function support autodiscovery using labels and annotations. Th
2626

2727
### targetNameSpaces
2828

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+
```
3035
### 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.
3237
```shell script
3338
targetPodLabels:
3439
- prefix: test-network-function.com
@@ -56,32 +61,19 @@ The autodiscovery mechanism will create a list of all CRD names in the cluster w
5661

5762
### testTarget
5863
#### 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:
6365

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).
6969

7070
For Network Interfaces:
7171

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.
8475

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.
8577

8678
#### operators
8779

@@ -133,13 +125,6 @@ export TNF_PARTNER_SRC_DIR=/home/userid/code/cnf-certification-test-partner
133125

134126
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.
135127

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-
143128
### Disconnected environment
144129
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:
145130

test-network-function/tnf_config.yml

+1-30
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,6 @@ targetPodLabels:
77
targetCrdFilters:
88
- nameSuffix: "group1.test.com"
99
- nameSuffix: "test-network-function.com"
10-
# The following section does not require manual configuration as autodiscovery is on by default
11-
# Containers and pods will be found through matching targetPodLabels. Operators will be found if
12-
# labelled with "test-network-function.com/operator". Their subscription name will be read from
13-
# annotation named "subscription_name".
14-
#
15-
# To add additional test targets, uncomment the section and configuree the values
16-
#
17-
# testTarget:
18-
# containersUnderTest:
19-
# - namespace: tnf
20-
# podName: test
21-
# containerName: test
22-
# defaultNetworkDevice: eth0
23-
# multusIpAddresses:
24-
# - 10.217.0.8
25-
# podsUnderTest:
26-
# - name: test
27-
# namespace: tnf
28-
# operators:
29-
# - name: etcdoperator.v0.9.4
30-
# namespace: default
31-
# subscriptionName: etcd
32-
# autogenerate: false
33-
34-
3510
# The following section does not require manual configuration as autodiscovery is on by default.
3611
# Partner pods deployed automatically from the cnf-test-partner-repo should have all the labels
3712
# used by autodiscovery
@@ -47,11 +22,7 @@ targetCrdFilters:
4722
# - namespace: tnf
4823
# podName: node-master
4924
# containerName: master
50-
# defaultNetworkDevice: eth0
51-
# fsDiffMasterContainer:
52-
# namespace: tnf
53-
# podName: node-master
54-
# containerName: master
25+
# defaultNetworkDevice: eth0
5526
# testOrchestrator:
5627
# namespace: tnf
5728
# podName: partner

0 commit comments

Comments
 (0)