mirror of
https://github.com/truenas/charts.git
synced 2026-06-16 23:19:15 +08:00
more tests
This commit is contained in:
61
library/common-test/tests/daemonset/generic_test.yaml
Normal file
61
library/common-test/tests/daemonset/generic_test.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
suite: daemonset generic test
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: should pass with controller set to DaemonSet
|
||||
documentIndex: &daemonsetDoc 0
|
||||
set:
|
||||
controller.type: DaemonSet
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- isKind:
|
||||
of: DaemonSet
|
||||
- isAPIVersion:
|
||||
of: apps/v1
|
||||
|
||||
|
||||
- it: should pass with podSecurityContext changed
|
||||
documentIndex: *daemonsetDoc
|
||||
set:
|
||||
controller.type: DaemonSet
|
||||
podSecurityContext:
|
||||
fsGroup: 0
|
||||
fsGroupChangePolicy: Always
|
||||
supplementalGroups:
|
||||
- 1000
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.securityContext
|
||||
value:
|
||||
fsGroup: 0
|
||||
fsGroupChangePolicy: Always
|
||||
supplementalGroups:
|
||||
- 1000
|
||||
|
||||
|
||||
- it: should pass with podSecurityContext changed
|
||||
documentIndex: *daemonsetDoc
|
||||
set:
|
||||
controller.type: DaemonSet
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
capabilities:
|
||||
add:
|
||||
- something
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].securityContext
|
||||
value:
|
||||
allowPrivilegeEscalation: false
|
||||
privileged: false
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
capabilities:
|
||||
add:
|
||||
- something
|
||||
drop:
|
||||
- ALL
|
||||
@@ -8,7 +8,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- isKind:
|
||||
of: StatefulSet
|
||||
of: Deployment
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
61
library/common-test/tests/statefulset/generic_test.yaml
Normal file
61
library/common-test/tests/statefulset/generic_test.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
suite: statefulset generic test
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: should pass with controller set to StatefulSet
|
||||
documentIndex: &statefulsetDoc 0
|
||||
set:
|
||||
controller.type: StatefulSet
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- isKind:
|
||||
of: StatefulSet
|
||||
- isAPIVersion:
|
||||
of: apps/v1
|
||||
|
||||
|
||||
- it: should pass with podSecurityContext changed
|
||||
documentIndex: *statefulsetDoc
|
||||
set:
|
||||
controller.type: StatefulSet
|
||||
podSecurityContext:
|
||||
fsGroup: 0
|
||||
fsGroupChangePolicy: Always
|
||||
supplementalGroups:
|
||||
- 1000
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.securityContext
|
||||
value:
|
||||
fsGroup: 0
|
||||
fsGroupChangePolicy: Always
|
||||
supplementalGroups:
|
||||
- 1000
|
||||
|
||||
|
||||
- it: should pass with podSecurityContext changed
|
||||
documentIndex: *statefulsetDoc
|
||||
set:
|
||||
controller.type: StatefulSet
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
capabilities:
|
||||
add:
|
||||
- something
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].securityContext
|
||||
value:
|
||||
allowPrivilegeEscalation: false
|
||||
privileged: false
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
capabilities:
|
||||
add:
|
||||
- something
|
||||
drop:
|
||||
- ALL
|
||||
Reference in New Issue
Block a user