From 48e985e43e40e1e5bedc66b6f4c3f06af83e717d Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 8 Dec 2022 14:01:26 +0200 Subject: [PATCH] add first tests --- .../tests/portal/portal_host_test.yaml | 248 ++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 library/common-test/tests/portal/portal_host_test.yaml diff --git a/library/common-test/tests/portal/portal_host_test.yaml b/library/common-test/tests/portal/portal_host_test.yaml new file mode 100644 index 00000000..1b810e1e --- /dev/null +++ b/library/common-test/tests/portal/portal_host_test.yaml @@ -0,0 +1,248 @@ +suite: portal port test +templates: + - common.yaml +tests: + - it: should pass with default values + documentIndex: &deploymentDoc 0 + asserts: + - hasDocuments: + count: 3 + - isKind: + of: Deployment + + - it: should pass with hostNetwork single service + documentIndex: &portalDoc 2 + set: + hostNetwork: true + service: + main: + enabled: true + ports: + main: + enabled: true + port: 10000 + targetPort: 80 + asserts: + - isKind: + of: ConfigMap + - isAPIVersion: + of: v1 + - equal: + path: metadata.name + value: portal + - isSubset: + path: data + content: + port-main-main: 10000 + + - it: should pass with hostNetwork multiple service + documentIndex: &dualServicePortalDoc 3 + set: + hostNetwork: true + service: + main: + enabled: true + ports: + main: + enabled: true + port: 10000 + targetPort: 80 + other: + enabled: true + ports: + other: + enabled: true + port: 10001 + targetPort: 80 + asserts: + - isKind: + of: ConfigMap + - equal: + path: metadata.name + value: portal + - isSubset: + path: data + content: + port-main-main: 10000 + port-other-other: 10001 + + - it: should pass with hostNetwork multiple service and multiple port + documentIndex: *dualServicePortalDoc + set: + hostNetwork: true + service: + main: + enabled: true + ports: + main: + enabled: true + primary: true + port: 10000 + targetPort: 80 + main2: + enabled: true + port: 10002 + targetPort: 81 + other: + enabled: true + ports: + other: + enabled: true + primary: true + port: 10001 + targetPort: 80 + other2: + enabled: true + port: 10003 + targetPort: 80 + asserts: + - isKind: + of: ConfigMap + - equal: + path: metadata.name + value: portal + - isSubset: + path: data + content: + port-main-main: 10000 + port-main-main2: 10002 + port-other-other: 10001 + port-other-other2: 10003 + + - it: should pass with hostNetwork multiple service and multiple port and override on portal + documentIndex: *dualServicePortalDoc + set: + hostNetwork: true + portal: + main: + main: + port: 20000 + main2: + port: 20002 + other: + other: + port: 20001 + other2: + port: 20003 + service: + main: + enabled: true + ports: + main: + enabled: true + primary: true + port: 10000 + targetPort: 80 + main2: + enabled: true + port: 10002 + targetPort: 81 + other: + enabled: true + ports: + other: + enabled: true + primary: true + port: 10001 + targetPort: 80 + other2: + enabled: true + port: 10003 + targetPort: 80 + asserts: + - isKind: + of: ConfigMap + - equal: + path: metadata.name + value: portal + - isSubset: + path: data + content: + port-main-main: 20000 + port-main-main2: 20002 + port-other-other: 20001 + port-other-other2: 20003 + + - it: should pass with hostNetwork multiple service and multiple port and override on portal from tpl + documentIndex: *dualServicePortalDoc + set: + port1: 20000 + port2: 20002 + port3: 20001 + port4: 20003 + hostNetwork: true + portal: + main: + main: + port: "{{ .Values.port1 }}" + main2: + port: "{{ .Values.port2 }}" + other: + other: + port: "{{ .Values.port3 }}" + other2: + port: "{{ .Values.port4 }}" + service: + main: + enabled: true + ports: + main: + enabled: true + primary: true + port: 10000 + targetPort: 80 + main2: + enabled: true + port: 10002 + targetPort: 81 + other: + enabled: true + ports: + other: + enabled: true + primary: true + port: 10001 + targetPort: 80 + other2: + enabled: true + port: 10003 + targetPort: 80 + asserts: + - isKind: + of: ConfigMap + - equal: + path: metadata.name + value: portal + - isSubset: + path: data + content: + port-main-main: 20000 + port-main-main2: 20002 + port-other-other: 20001 + port-other-other2: 20003 + + - it: should pass with nodePort single service + documentIndex: &portalDoc 2 + set: + service: + main: + type: NodePort + enabled: true + ports: + main: + enabled: true + port: 10000 + nodePort: 11000 + targetPort: 80 + asserts: + - isKind: + of: ConfigMap + - isAPIVersion: + of: v1 + - equal: + path: metadata.name + value: portal + - isSubset: + path: data + content: + port-main-main: 11000