mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-05 22:16:21 -03:00
add first tests
This commit is contained in:
248
library/common-test/tests/portal/portal_host_test.yaml
Normal file
248
library/common-test/tests/portal/portal_host_test.yaml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user