1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/conformance/tests.yaml
Charles-Edouard Brétéché ad2cbd3b33
feat: add simple conformance tests (#5073)
* feat: add simple conformance tests
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-10-20 12:17:33 +00:00

51 lines
2.6 KiB
YAML

should-fail:
- description: Policy with backgound enabled and referencing user infos should be rejected
kubectl:
args:
- create
- -f
- test/conformance/manifests/should-fail/background-userinfo-1.yaml
expect:
exitcode: 1
stderr: >-
Error from server: error when creating "test/conformance/manifests/should-fail/background-userinfo-1.yaml":
admission webhook "validate-policy.kyverno.svc" denied the request: only select variables are allowed in background mode.
Set spec.background=false to disable background mode for this policy rule: variable "{{request.roles}} is not allowed
- description: Policy with backgound enabled and referencing user infos should be rejected
kubectl:
args:
- create
- -f
- test/conformance/manifests/should-fail/background-userinfo-2.yaml
expect:
exitcode: 1
stderr: >-
Error from server: error when creating "test/conformance/manifests/should-fail/background-userinfo-2.yaml":
admission webhook "validate-policy.kyverno.svc" denied the request:
only select variables are allowed in background mode.
Set spec.background=false to disable background mode for this policy rule:
invalid variable used at path: spec/rules[0]/match/clusterRoles
- description: Policy with backgound enabled and referencing user infos should be rejected
kubectl:
args:
- create
- -f
- test/conformance/manifests/should-fail/background-userinfo-3.yaml
expect:
exitcode: 1
stderr: >-
Error from server: error when creating "test/conformance/manifests/should-fail/background-userinfo-3.yaml":
admission webhook "validate-policy.kyverno.svc" denied the request: only select variables are allowed in background mode.
Set spec.background=false to disable background mode for this policy rule: variable "{{request.userInfo}} is not allowed
- description: Policy with backgound enabled and referencing user infos should be rejected
kubectl:
args:
- create
- -f
- test/conformance/manifests/should-fail/background-userinfo-4.yaml
expect:
exitcode: 1
stderr: >-
Error from server: error when creating "test/conformance/manifests/should-fail/background-userinfo-4.yaml":
admission webhook "validate-policy.kyverno.svc" denied the request: only select variables are allowed in background mode.
Set spec.background=false to disable background mode for this policy rule: variable "{{serviceAccountName}} is not allowed