port tests for portal

This commit is contained in:
Stavros kois
2022-12-08 14:13:54 +02:00
parent 48e985e43e
commit be0ac3b5fe
2 changed files with 814 additions and 248 deletions

View File

@@ -1,248 +0,0 @@
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

View File

@@ -0,0 +1,814 @@
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 single port override on portal
documentIndex: *dualServicePortalDoc
set:
hostNetwork: true
portal:
main:
main:
port: 20000
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: 10002
port-other-other: 10001
port-other-other2: 10003
- it: should pass with hostNetwork multiple service and multiple port and multiple port 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
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
- it: should pass with nodePort multiple service
documentIndex: *dualServicePortalDoc
set:
service:
main:
enabled: true
type: NodePort
ports:
main:
enabled: true
port: 10000
nodePort: 11000
targetPort: 80
other:
enabled: true
type: NodePort
ports:
other:
enabled: true
port: 10001
nodePort: 11001
targetPort: 80
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 11000
port-other-other: 11001
- it: should pass with nodePort multiple service
documentIndex: *dualServicePortalDoc
set:
service:
main:
enabled: true
type: NodePort
ports:
main:
enabled: true
primary: true
port: 10000
nodePort: 11000
targetPort: 80
main2:
enabled: true
port: 10001
nodePort: 11002
targetPort: 81
other:
enabled: true
type: NodePort
ports:
other:
enabled: true
primary: true
port: 10002
nodePort: 11001
targetPort: 80
other2:
enabled: true
port: 10003
nodePort: 11003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 11000
port-main-main2: 11002
port-other-other: 11001
port-other-other2: 11003
- it: should pass with nodePort multiple service and single override portal port
documentIndex: *dualServicePortalDoc
set:
portal:
other:
other2:
port: 21003
service:
main:
enabled: true
type: NodePort
ports:
main:
enabled: true
primary: true
port: 10000
nodePort: 11000
targetPort: 80
main2:
enabled: true
port: 10001
nodePort: 11002
targetPort: 81
other:
enabled: true
type: NodePort
ports:
other:
enabled: true
primary: true
port: 10002
nodePort: 11001
targetPort: 80
other2:
enabled: true
port: 10003
nodePort: 11003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 11000
port-main-main2: 11002
port-other-other: 11001
port-other-other2: 21003
- it: should pass with nodePort multiple service and multiple override portal port
documentIndex: *dualServicePortalDoc
set:
portal:
main:
main:
port: 21000
main2:
port: 21002
other:
other:
port: 21001
other2:
port: 21003
service:
main:
enabled: true
type: NodePort
ports:
main:
enabled: true
primary: true
port: 10000
nodePort: 11000
targetPort: 80
main2:
enabled: true
port: 10001
nodePort: 11002
targetPort: 81
other:
enabled: true
type: NodePort
ports:
other:
enabled: true
primary: true
port: 10002
nodePort: 11001
targetPort: 80
other2:
enabled: true
port: 10003
nodePort: 11003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 21000
port-main-main2: 21002
port-other-other: 21001
port-other-other2: 21003
- it: should pass with nodePort multiple service and multiple override portal port from tpl
documentIndex: *dualServicePortalDoc
set:
port1: 21000
port2: 21002
port3: 21001
port4: 21003
portal:
main:
main:
port: "{{ .Values.port1 }}"
main2:
port: "{{ .Values.port2 }}"
other:
other:
port: "{{ .Values.port3 }}"
other2:
port: "{{ .Values.port4 }}"
service:
main:
enabled: true
type: NodePort
ports:
main:
enabled: true
primary: true
port: 10000
nodePort: 11000
targetPort: 80
main2:
enabled: true
port: 10001
nodePort: 11002
targetPort: 81
other:
enabled: true
type: NodePort
ports:
other:
enabled: true
primary: true
port: 10002
nodePort: 11001
targetPort: 80
other2:
enabled: true
port: 10003
nodePort: 11003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 21000
port-main-main2: 21002
port-other-other: 21001
port-other-other2: 21003
## loadb
- it: should pass with loadBalancer single service
documentIndex: *portalDoc
set:
service:
main:
type: LoadBalancer
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 loadBalancer multiple service
documentIndex: *dualServicePortalDoc
set:
service:
main:
enabled: true
type: LoadBalancer
ports:
main:
enabled: true
port: 10000
targetPort: 80
other:
enabled: true
type: LoadBalancer
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 loadBalancer multiple service
documentIndex: *dualServicePortalDoc
set:
service:
main:
enabled: true
type: LoadBalancer
ports:
main:
enabled: true
primary: true
port: 10000
targetPort: 80
main2:
enabled: true
port: 10001
targetPort: 81
other:
enabled: true
type: LoadBalancer
ports:
other:
enabled: true
primary: true
port: 10002
targetPort: 80
other2:
enabled: true
port: 10003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 10000
port-main-main2: 10001
port-other-other: 10002
port-other-other2: 10003
- it: should pass with loadBalancer multiple service and single override portal port
documentIndex: *dualServicePortalDoc
set:
portal:
other:
other2:
port: 21003
service:
main:
enabled: true
type: LoadBalancer
ports:
main:
enabled: true
primary: true
port: 10000
targetPort: 80
main2:
enabled: true
port: 10001
targetPort: 81
other:
enabled: true
type: LoadBalancer
ports:
other:
enabled: true
primary: true
port: 10002
targetPort: 80
other2:
enabled: true
port: 10003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 10000
port-main-main2: 10001
port-other-other: 10002
port-other-other2: 21003
- it: should pass with loadBalancer multiple service and multiple override portal port
documentIndex: *dualServicePortalDoc
set:
portal:
main:
main:
port: 21000
main2:
port: 21002
other:
other:
port: 21001
other2:
port: 21003
service:
main:
enabled: true
type: LoadBalancer
ports:
main:
enabled: true
primary: true
port: 10000
targetPort: 80
main2:
enabled: true
port: 10001
targetPort: 81
other:
enabled: true
type: LoadBalancer
ports:
other:
enabled: true
primary: true
port: 10002
targetPort: 80
other2:
enabled: true
port: 10003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 21000
port-main-main2: 21002
port-other-other: 21001
port-other-other2: 21003
- it: should pass with loadBalancer multiple service and multiple override portal port from tpl
documentIndex: *dualServicePortalDoc
set:
port1: 21000
port2: 21002
port3: 21001
port4: 21003
portal:
main:
main:
port: "{{ .Values.port1 }}"
main2:
port: "{{ .Values.port2 }}"
other:
other:
port: "{{ .Values.port3 }}"
other2:
port: "{{ .Values.port4 }}"
service:
main:
enabled: true
type: LoadBalancer
ports:
main:
enabled: true
primary: true
port: 10000
targetPort: 80
main2:
enabled: true
port: 10001
targetPort: 81
other:
enabled: true
type: LoadBalancer
ports:
other:
enabled: true
primary: true
port: 10002
targetPort: 80
other2:
enabled: true
port: 10003
targetPort: 81
asserts:
- isKind:
of: ConfigMap
- equal:
path: metadata.name
value: portal
- isSubset:
path: data
content:
port-main-main: 21000
port-main-main2: 21002
port-other-other: 21001
port-other-other2: 21003