mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-30 04:22:49 +00:00
helm consul toegevoegd ma nie als submodule?
This commit is contained in:
44
consul-helm/test/unit/sync-catalog-podsecuritypolicy.bats
Normal file
44
consul-helm/test/unit/sync-catalog-podsecuritypolicy.bats
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load _helpers
|
||||
|
||||
@test "syncCatalog/PodSecurityPolicy: disabled by default" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/sync-catalog-podsecuritypolicy.yaml \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "syncCatalog/PodSecurityPolicy: disabled by default with syncCatalog enabled" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/sync-catalog-podsecuritypolicy.yaml \
|
||||
--set 'syncCatalog.enabled=true' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "syncCatalog/PodSecurityPolicy: disabled with syncCatalog disabled and global.enablePodSecurityPolicies=true" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/sync-catalog-podsecuritypolicy.yaml \
|
||||
--set 'syncCatalog.enabled=false' \
|
||||
--set 'global.enablePodSecurityPolicies=true' \
|
||||
. | tee /dev/stderr |
|
||||
yq 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "false" ]
|
||||
}
|
||||
|
||||
@test "syncCatalog/PodSecurityPolicy: enabled with syncCatalog enabled and global.enablePodSecurityPolicies=true" {
|
||||
cd `chart_dir`
|
||||
local actual=$(helm template \
|
||||
-x templates/sync-catalog-podsecuritypolicy.yaml \
|
||||
--set 'syncCatalog.enabled=true' \
|
||||
--set 'global.enablePodSecurityPolicies=true' \
|
||||
. | tee /dev/stderr |
|
||||
yq -s 'length > 0' | tee /dev/stderr)
|
||||
[ "${actual}" = "true" ]
|
||||
}
|
Reference in New Issue
Block a user