-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test coverage for clusterrole + podsecuritypolicy
- Loading branch information
1 parent
5af4a55
commit f7c9e8f
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
charts/consul/test/unit/api-gateway-controller-podsecuritypolicy.bats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bats | ||
|
||
load _helpers | ||
|
||
@test "apiGateway/PodSecurityPolicy: disabled by default" { | ||
cd `chart_dir` | ||
assert_empty helm template \ | ||
-s templates/api-gateway-controller-podsecuritypolicy.yaml \ | ||
. | ||
} | ||
|
||
@test "apiGateway/PodSecurityPolicy: enabled with apiGateway.enabled=true and global.enablePodSecurityPolicies=true" { | ||
cd `chart_dir` | ||
local actual=$(helm template \ | ||
-s templates/api-gateway-controller-podsecuritypolicy.yaml \ | ||
--set 'global.enablePodSecurityPolicies=true' \ | ||
--set 'apiGateway.enabled=true' \ | ||
--set 'apiGateway.image=foo' \ | ||
. | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "true" ] | ||
} |