k8wiz
Kyverno
Hard
Testing

What does the 'kyverno test' command read to run policy tests?

Select your answer:

Show answer and explanation

Answer: kyverno-test.yaml files listing policies, resources and expected results

Explanation

'kyverno test <dir>' finds kyverno-test.yaml files, applies the listed policies to the listed resources without a cluster, and compares each rule's result (pass, fail or skip) with the expected one. Running it in CI catches policy regressions before they reach a cluster.