diff --git a/library/common-test/Chart.yaml b/library/common-test/Chart.yaml index 8f35abd6..5bafe0a7 100644 --- a/library/common-test/Chart.yaml +++ b/library/common-test/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "" dependencies: - name: common repository: file://../common - version: ~15.1.0 + version: ~15.2.0 deprecated: false description: Helper chart to test different use cases of the common library home: https://github.com/truecharts/apps/tree/master/charts/library/common-test diff --git a/library/common-test/tests/pod/host_ipc_test.yaml b/library/common-test/tests/pod/host_ipc_test.yaml new file mode 100644 index 00000000..06a88b1c --- /dev/null +++ b/library/common-test/tests/pod/host_ipc_test.yaml @@ -0,0 +1,78 @@ +suite: pod hostIPC test +templates: + - common.yaml +release: + name: test-release-name + namespace: test-release-namespace +tests: + - it: should pass with hostIPC disabled from "global" + set: + podOptions: + hostIPC: false + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: {} + asserts: + - documentIndex: &deploymentDoc 0 + isKind: + of: Deployment + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostIPC + value: false + + - it: should pass with hostIPC enabled from "global" + set: + podOptions: + hostIPC: true + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: {} + asserts: + - documentIndex: *deploymentDoc + isKind: + of: Deployment + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostIPC + value: true + + - it: should pass with disabled hostIPC from pod + set: + podOptions: + hostIPC: true + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: + hostIPC: false + asserts: + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostIPC + value: false + + - it: should pass with enabled hostIPC from pod + set: + podOptions: + hostIPC: false + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: + hostIPC: true + asserts: + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostIPC + value: true diff --git a/library/common-test/tests/pod/host_users_test.yaml b/library/common-test/tests/pod/host_users_test.yaml new file mode 100644 index 00000000..6e43c03d --- /dev/null +++ b/library/common-test/tests/pod/host_users_test.yaml @@ -0,0 +1,316 @@ +suite: pod hostUsers test +templates: + - common.yaml +release: + name: test-release-name + namespace: test-release-namespace +tests: + - it: should pass with hostUsers enabled from "global" + set: + podOptions: + hostUsers: true + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: {} + asserts: + - documentIndex: &deploymentDoc 0 + isKind: + of: Deployment + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostUsers + value: true + + - it: should pass with hostUsers enabled from podSpec + set: + podOptions: + hostUsers: false + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: + hostUsers: true + asserts: + - documentIndex: *deploymentDoc + isKind: + of: Deployment + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostUsers + value: true + + - it: should pass with enabled hostUsers because of pvc + set: + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: {} + persistence: + vol1: + enabled: true + type: pvc + asserts: + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostUsers + value: true + + - it: should pass with enabled hostUsers because of hostNet + set: + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: true + asserts: + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostUsers + value: true + + - it: should pass with enabled hostUsers because of hostPID + set: + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: + hostPID: true + asserts: + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostUsers + value: true + + - it: should pass with enabled hostUsers because of hostIPC + set: + workload: + workload-name1: + enabled: true + primary: true + type: Deployment + podSpec: + hostIPC: true + asserts: + - documentIndex: *deploymentDoc + equal: + path: spec.template.spec.hostUsers + value: true + + # Tests that eq