Skip to content

Commit 46bd197

Browse files
authored
Clean up duplicate partner pod definition and reorganize the local-test-infra folder to test-target and test-partner (#64)
1 parent bc2cb28 commit 46bd197

File tree

14 files changed

+21
-149
lines changed

14 files changed

+21
-149
lines changed

.github/workflows/partner-pod.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ on: [push, pull_request]
33
defaults:
44
run:
55
shell: bash
6-
working-directory: test-partner
76

87
jobs:
9-
test-local-test-infra:
8+
test-test-partner:
109
name: 'Test the partner pod on minikube'
1110
runs-on: ubuntu-20.04
1211
env:
@@ -20,13 +19,9 @@ jobs:
2019
- name: Start the minikube cluster
2120
uses: ./.github/actions/start-minikube
2221

23-
- name: Add a proper label to the minikube node
24-
run: oc label nodes minikube role=tnfpartner
25-
2622
- name: Create the partner pod using the instructions in the README
2723
run: |
28-
oc create -f ./namespace.yaml
29-
oc create -f ./partner.yaml
24+
make install-partner-pods
3025
3126
- name: Wait for the partner pod to be ready
3227
run: oc wait pod --for=condition=ready -l 'app=tnfpartner' -n $DEFAULT_NAMESPACE --timeout=$DEFAULT_TIMEOUT

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# CNF Certification Partner
22

33
This repository contains two main sections:
4-
* test-partner: A partner pod definition for use on a k8s CNF Certification cluster.
5-
* local-test-infra: A trivial example cluster, 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-
This is the basic infrastructure required for "testing the tester".
7-
Also includes a test operator.
4+
* test-partner: Partner pods definition for use on a k8s CNF Certification cluster.
5+
* 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+
7+
Together, they make up the basic infrastructure required for "testing the tester".
8+
89
# Glossary
910

1011
* Pod Under Test (PUT): The Vendor Pod, usually provided by a CNF Partner.
@@ -62,13 +63,11 @@ This will create a deployment named "partner" in the "default" namespace. This
6263
For disconnected environments, override the default image repo `quay.io/testnetworkfunction` by setting the environment variable named `TNF_PARTNER_REPO` to the local repo.
6364
For environments with slow internet connection, override the default deployment timeout value (120s) by setting the environment variable named `TNF_DEPLOYMENT_TIMEOUT`.
6465

65-
*Note*: Nodes have to be properly labeled (`role=tnfpartner`) for the partner pod to be started.
66-
67-
# local-test-infra
66+
# Test-target
6867

6968
Although any CNF Certification results should be generated using a proper CNF Certification cluster, there are times
70-
in which using a local emulator can greatly help with test development. As such, [local-test-infra](./local-test-infra)
71-
provides a very simple PUT, OT, CRD, DP and TPP containing the minimal requirements to perform test cases.
69+
in which using a local emulator can greatly help with test development. As such, [test-target](./test-target)
70+
provides a very simple PUT, OT, CRD, which satisfies the minimal requirements to perform test cases.
7271
These can be used in conjunction with a local kind or [minikube](https://minikube.sigs.k8s.io/docs/) cluster to perform local test development.
7372

7473

@@ -103,7 +102,7 @@ Or Alternatively, run:
103102
make rebuild-minikube
104103
```
105104

106-
## Start local-test-infra
105+
## Deploy both test target and test partner as a local-test-infra
107106

108107
To create the resources, issue the following command:
109108

@@ -144,9 +143,9 @@ You should see something like this (note that the 2 test pods are running on dif
144143
NAME NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
145144
tnfpartner-678db9858c-f9p4f 1/1 Running 0 142m 10.244.4.2 minikube-m05 <none> <none>
146145
```
147-
## Stop local-test-infra
146+
## Delete local-test-infra
148147

149-
To tear down the local test cluster use the following command. It may take some time to completely stop the PUT, CRD, OT, DP and TPP:
148+
To tear down the local test infrastruture from the cluster, use the following command. It may take some time to completely stop the PUT, CRD, OT, DP and TPP:
150149

151150
```shell-script
152151
make clean

local-test-infra/debugpartner.yaml

Lines changed: 0 additions & 93 deletions
This file was deleted.

scripts/deploy-debug-ds.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ then
1414
else
1515
echo "use registry $REDHAT_RHEL_REGISTRY"
1616
mkdir -p ./temp
17-
cat ./local-test-infra/debugpartner.yaml | $SCRIPT_DIR/mo > ./temp/debugpartner.yaml
17+
cat ./test-partner/debugpartner.yaml | $SCRIPT_DIR/mo > ./temp/debugpartner.yaml
1818
oc apply -f ./temp/debugpartner.yaml
1919
rm ./temp/debugpartner.yaml
2020
fi

scripts/deploy-partner-pods.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SCRIPT_DIR=$(dirname "$0")
55
source $SCRIPT_DIR/init-env.sh
66

77
mkdir -p ./temp
8-
cat ./local-test-infra/local-partner-deployment.yaml | $SCRIPT_DIR/mo > ./temp/rendered-partner-template.yaml
8+
cat ./test-partner/partner-deployment.yaml | $SCRIPT_DIR/mo > ./temp/rendered-partner-template.yaml
99
oc apply -f ./temp/rendered-partner-template.yaml
1010
rm ./temp/rendered-partner-template.yaml
1111
sleep 3

scripts/deploy-test-crds.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
SCRIPT_DIR=$(dirname "$0")
55
source $SCRIPT_DIR/init-env.sh
66

7-
oc apply -f ./local-test-infra/local-crd-under-test.yaml
7+
oc apply -f ./test-target/local-crd-under-test.yaml
88

99
oc wait crd crdexamples.test-network-function.com --timeout=5s --for=condition=established

scripts/deploy-test-pods.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source $SCRIPT_DIR/init-env.sh
88
oc create namespace ${TNF_EXAMPLE_CNF_NAMESPACE} 2>/dev/null
99

1010
mkdir -p ./temp
11-
cat ./local-test-infra/local-pod-under-test.yaml | $SCRIPT_DIR/mo > ./temp/rendered-local-pod-under-test-template.yaml
11+
cat ./test-target/local-pod-under-test.yaml | $SCRIPT_DIR/mo > ./temp/rendered-local-pod-under-test-template.yaml
1212
oc apply -f ./temp/rendered-local-pod-under-test-template.yaml
1313
rm ./temp/rendered-local-pod-under-test-template.yaml
1414
sleep 3

test-partner/debugpartner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
annotations:
66
debug.openshift.io/source-container: container-00
77
openshift.io/scc: node-exporter
8-
namespace: default
8+
namespace: {{ DEFAULT_NAMESPACE }}
99
name: debug
1010
spec:
1111
selector:

test-partner/namespace.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
# This is for future when we need to deploy partner pods to namespaces other than "default"
12
apiVersion: v1
23
kind: Namespace
34
metadata:
4-
name: tnf
5+
name: {{ DEFAULT_NAMESPACE }}
56
labels:
6-
name: tnf
7+
name: {{ DEFAULT_NAMESPACE }}

0 commit comments

Comments
 (0)