@@ -108,6 +108,18 @@ function ensureAccessToNamespace {
108108 kubectl get pods,svc,deploy -n $namespaceName || fail " It was expected that the namespace setup is completed at this point."
109109}
110110
111+ function ensureAllResourcesAreSupported {
112+ namespaceName=$1
113+
114+ # IMPORTANT
115+ # you should not test custom CRD resources here, because that is an additional test dependency which might
116+ # come in conflict with existing CRDs, depending on the cluster where this test is run
117+ cat " tests/allowed-resources/rbac.yaml" | sed " s/{{NAMESPACE}}/$namespaceName /g" \
118+ | kubectl apply -f -
119+ cat " tests/allowed-resources/networking.yaml" | sed " s/{{NAMESPACE}}/$namespaceName /g" \
120+ | kubectl apply -f -
121+ }
122+
111123function expectApplyToFail {
112124 hasFailed=" no"
113125
@@ -167,6 +179,7 @@ function test_invalidDefinitions {
167179
168180# Tests following business cases:
169181# - user can create a cops namespace and gain rights inside it
182+ # - the rights are additionaly tested by deploying different sample k8s resources, which should all succeed
170183# - all other users are denied access
171184function test_shouldDeployEmpireCnsWithValidRbac {
172185 logTestStarted ${FUNCNAME[0]}
@@ -183,6 +196,7 @@ function test_shouldDeployEmpireCnsWithValidRbac {
183196
184197 # Assert
185198 ensureAccessToNamespace $namespaceName
199+ ensureAllResourcesAreSupported $namespaceName
186200
187201 # no access for other accounts
188202 kubectl config use-context $kyloRenAccount
0 commit comments