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
* test-partner: Partner debug pods definition for use on a k8s CNF Certification cluster. Used to run platform and networking tests.
5
12
* test-target: A trivial example CNF (including a replicaset/deployment, a CRD and an operator), primarily intended to be used to run [test-network-function](https://github.com/test-network-function/test-network-function) test suites on a development machine.
6
13
@@ -24,17 +31,21 @@ export TNF_EXAMPLE_CNF_NAMESPACE="tnf" #tnf for example
24
31
```
25
32
26
33
## On-demand vs always on debug pods
34
+
27
35
By default debug pods are installed on demand when the tnf test suite is deployed. To deploy debug pods on all nodes in the cluster, configure the following environment variable:
36
+
28
37
```shell-script
29
38
export ON_DEMAND_DEBUG_PODS=false
30
39
```
40
+
31
41
## Cloning the repository
32
42
33
43
The repository can be cloned to local machine using:
In order to create and deploy the partner debug pods (daemonset), use the following:
@@ -43,21 +54,21 @@ In order to create and deploy the partner debug pods (daemonset), use the follow
43
54
make install-partner-pods
44
55
```
45
56
46
-
This will create a deployment named "partner" in the "default" namespace. This Pod is the test partner for running CNF tests.
57
+
This will create a deployment named "partner" in the "default" namespace. This Pod is the test partner for running CNF tests.
47
58
For disconnected environments, override the default image repo `quay.io/testnetworkfunction` by setting the environment variable named `TNF_PARTNER_REPO` to the local repo.
48
59
For environments with slow internet connection, override the default deployment timeout value (120s) by setting the environment variable named `TNF_DEPLOYMENT_TIMEOUT`.
49
60
50
61
# Installing the Test-target
51
62
52
63
Although any CNF Certification results should be generated using a proper CNF Certification cluster, there are times
53
-
in which using a local emulator can greatly help with test development. As such, [test-target](./test-target)
54
-
provides a very simple PUT, OT, CRD, which satisfies the minimal requirements to perform test cases.
64
+
in which using a local emulator can greatly help with test development. As such, [test-target](./test-target)
65
+
provides a simple PUT, OT, CRD, which satisfies the minimal requirements to perform test cases.
55
66
These can be used in conjunction with a local [kind](https://kind.sigs.k8s.io/) cluster to perform local test development.
56
67
57
-
58
68
## Dependencies
59
69
60
70
In order to run the local test setup, the following dependencies are needed:
71
+
61
72
*[vagrant](https://www.vagrantup.com/downloads)
62
73
*[kind](https://kind.sigs.k8s.io/)
63
74
*[Docker](https://docs.docker.com/get-docker/)
@@ -67,6 +78,7 @@ In order to run the local test setup, the following dependencies are needed:
67
78
## Setup with docker and kind
68
79
69
80
Install the latest docker version ( https://docs.docker.com/engine/install/fedora ):
Configure a cluster with 4 worker nodes and one master node ( dual stack ):
162
+
Configure a cluster with 4 worker nodes and one master node ( dual stack ):
163
+
143
164
```shell-script
144
165
cat <<- EOF > config.yaml
145
166
kind: Cluster
@@ -155,19 +176,22 @@ EOF
155
176
kind create cluster --config=config.yaml
156
177
```
157
178
158
-
Increase max files limit to prevent issue due to the large cluster size ( see https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files )
179
+
Increase max files limit to prevent issue due to the large cluster size ( see https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files ):
180
+
159
181
```shell-script
160
182
sudo sysctl fs.inotify.max_user_watches=524288
161
183
sudo sysctl fs.inotify.max_user_instances=512
162
184
```
185
+
163
186
To make the changes persistent, edit the file /etc/sysctl.conf and add these lines:
187
+
164
188
```shell-script
165
189
fs.inotify.max_user_watches = 524288
166
190
fs.inotify.max_user_instances = 512
167
-
168
191
fs.inotify.max_user_watches = 524288
169
192
fs.inotify.max_user_instances = 512
170
193
```
194
+
171
195
### Deploy both test target and test partner as a local-test-infra
172
196
173
197
To create the resources, issue the following command:
@@ -182,13 +206,14 @@ will use this local infrastructure by default.
182
206
183
207
Note that this command also creates OT and CRD resources.
184
208
185
-
To verify `test` pods are running:
209
+
To verify `test` pods are running:
186
210
187
211
```shell-script
188
212
oc get pods -n $TNF_EXAMPLE_CNF_NAMESPACE -o wide
189
213
```
190
214
191
215
You should see something like this (note that the 2 test pods are running on different nodes due to a anti-affinity rule):
To tear down the local test infrastructure from the cluster, use the following command. It may take some time to completely stop the PUT, CRD, OT, and DP:
@@ -209,7 +235,8 @@ make clean
209
235
210
236
## Setup with Vagrant, docker and kind (Mac OS support)
211
237
212
-
Install vagrant for your platform
238
+
Install vagrant for your platform:
239
+
213
240
```shell-script
214
241
https://www.vagrantup.com/downloads
215
242
```
@@ -222,6 +249,7 @@ make vagrant-build
222
249
223
250
The kubeconfig for the new environment will override the file located at ~/.kube/config
224
251
Just start running commands from the command line to test the new cluster:
252
+
225
253
```shell-script
226
254
oc get pods -A
227
255
```
@@ -233,14 +261,17 @@ make vagrant-destroy
233
261
```
234
262
235
263
To access the virtual machine supporting the cluster, do the following:
264
+
236
265
```shell-script
237
266
cd config/vagrant
238
267
user@fedora vagrant]$ vagrant ssh
239
268
[vagrant@k8shost ~]$
240
269
```
270
+
241
271
The partner repo scripts are located in ~/partner
242
272
243
273
## License
274
+
244
275
CNF Certification Test Partner is copyright [Red Hat, Inc.](https://www.redhat.com) and available
This folder is going to house some example YAMLs that will make the test suite fail if applied to a cluster. Not all test suites have an example to show but more examples can be added in the future.
@@ -7,6 +8,7 @@ Please refer to the [CATALOG](https://github.com/test-network-function/test-netw
7
8
## Examples by Test Suite
8
9
9
10
Please find an example below that ties to a specific test case you are interested in.
Creates necessary role, role binding, service account, and pod that causes a failure in the `accesscontrol` suite of tests because the rolebinding cannot cross namespaces.
* container-is-certified (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#container-is-certified)
39
39
* operator-is-certified (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#operator-is-certified)
40
40
41
-
42
41
### lifecycle
43
42
44
43
Note: We might need the following flag set in the environment in which you are testing these YAMLs to avoid any draining, cluster-intrusive issues, etc.
@@ -72,7 +71,6 @@ Creates a pod with no "owner". It does not belong to a replicaset or a deployme
72
71
73
72
* stateful-scaling (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#statefulset-scaling)
74
73
75
-
76
74
### networking
77
75
78
76
* icmpv4-connectivity (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#icmpv4-connectivity)
@@ -104,4 +102,3 @@ Creates an `echo-server` pod which does some logging to the stdout. The test ch
104
102
* isredhat-release (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#isredhat-release)
105
103
* sysctl-config (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#sysctl-config)
106
104
* tainted-node-kernel (no example) - [Catalog Link](https://github.com/test-network-function/test-network-function/blob/main/CATALOG.md#tainted-node-kernel)
0 commit comments