Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iurly committed Dec 18, 2024
1 parent d1fde1f commit a24b752
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,18 @@ tests:
- contains:
path: users
content: "system:serviceaccount:shield-namespace:release-name-shield-cluster"

- it: Creates SecurityContextConstraints when the extraCapability has been set
set:
extra_capabilities_api_versions:
- security.openshift.io/v1
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: SecurityContextConstraints
apiVersion: security.openshift.io/v1
name: release-name-shield-cluster
- contains:
path: users
content: "system:serviceaccount:shield-namespace:release-name-shield-cluster"
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ tests:
path: users
content: "system:serviceaccount:shield-namespace:release-name-shield-host"

- it: Creates SecurityContextConstraints when the extraCapability has been set
set:
extra_capabilities_api_versions:
- security.openshift.io/v1
asserts:
- hasDocuments:
count: 1
- containsDocument:
kind: SecurityContextConstraints
apiVersion: security.openshift.io/v1
name: release-name-shield-host
- contains:
path: users
content: "system:serviceaccount:shield-namespace:release-name-shield-host"

- it: SecurityContextConstraints allowedCapabilities is empty when host.privileged is true
capabilities:
apiVersions:
Expand Down

0 comments on commit a24b752

Please sign in to comment.