mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 20:12:43 +00:00
helm consul toegevoegd ma nie als submodule?
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load _helpers
|
||||
|
||||
@test "enterpriseLicense/PodSecurityPolicy: disabled by default" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/enterprise-license-podsecuritypolicy.yaml \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "enterpriseLicense/PodSecurityPolicy: disabled with server=false, ent secret defined" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/enterprise-license-podsecuritypolicy.yaml \
|
||||
--set 'server.enabled=false' \
|
||||
--set 'server.enterpriseLicense.secretName=foo' \
|
||||
--set 'server.enterpriseLicense.secretKey=bar' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "enterpriseLicense/PodSecurityPolicy: disabled when ent secretName missing" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/enterprise-license-podsecuritypolicy.yaml \
|
||||
--set 'server.enterpriseLicense.secretKey=bar' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "enterpriseLicense/PodSecurityPolicy: disabled when ent secretKey missing" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/enterprise-license-podsecuritypolicy.yaml \
|
||||
--set 'server.enterpriseLicense.secretName=foo' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "enterpriseLicense/PodSecurityPolicy: disabled when enablePodSecurityPolicies=false" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/enterprise-license-podsecuritypolicy.yaml \
|
||||
--set 'server.enterpriseLicense.secretName=foo' \
|
||||
--set 'server.enterpriseLicense.secretKey=bar' \
|
||||
--set 'global.enablePodSecurityPolicies=false' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "enterpriseLicense/PodSecurityPolicy: enabled when ent license defined and enablePodSecurityPolicies=true" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/enterprise-license-podsecuritypolicy.yaml \
|
||||
--set 'server.enterpriseLicense.secretName=foo' \
|
||||
--set 'server.enterpriseLicense.secretKey=bar' \
|
||||
--set 'global.enablePodSecurityPolicies=true' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "true" ]
|
||||
}
|
Reference in New Issue
Block a user