From 4a557ba2cfb99181cd36744bc8460a6e84438605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Wed, 6 Dec 2023 17:27:10 +0100 Subject: [PATCH] chore: convert chainsaw tests to Test resource (#9094) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .../no-admission-event/01-policy.yaml | 13 -------- .../no-admission-event/02-resource.yaml | 11 ------- .../no-admission-event/03-event.yaml | 13 -------- .../no-admission-event/chainsaw-test.yaml | 23 ++++++++++++++ .../no-admission-report/01-policy.yaml | 13 -------- .../no-admission-report/02-resource.yaml | 11 ------- .../no-admission-report/03-report.yaml | 11 ------- .../no-admission-report/chainsaw-test.yaml | 21 +++++++++++++ .../not-rejected/01-policy.yaml | 13 -------- .../not-rejected/02-resource.yaml | 11 ------- .../not-rejected/chainsaw-test.yaml | 17 ++++++++++ .../policy/no-admission-event/01-policy.yaml | 13 -------- .../no-admission-event/02-resource.yaml | 11 ------- .../policy/no-admission-event/03-event.yaml | 13 -------- .../no-admission-event/chainsaw-test.yaml | 23 ++++++++++++++ .../policy/no-admission-report/01-policy.yaml | 13 -------- .../no-admission-report/02-resource.yaml | 11 ------- .../policy/no-admission-report/03-report.yaml | 11 ------- .../no-admission-report/chainsaw-test.yaml | 21 +++++++++++++ .../policy/not-rejected/01-policy.yaml | 13 -------- .../policy/not-rejected/02-resource.yaml | 11 ------- .../policy/not-rejected/chainsaw-test.yaml | 17 ++++++++++ .../clusterpolicy/cleanup-pod/01-rbac.yaml | 11 ------- .../clusterpolicy/cleanup-pod/02-pod.yaml | 13 -------- .../clusterpolicy/cleanup-pod/03-policy.yaml | 13 -------- .../clusterpolicy/cleanup-pod/04-sleep.yaml | 11 ------- .../clusterpolicy/cleanup-pod/05-check.yaml | 11 ------- .../cleanup-pod/chainsaw-test.yaml | 31 +++++++++++++++++++ .../context-cleanup-pod/01-rbac.yaml | 11 ------- .../context-cleanup-pod/02-pod.yaml | 13 -------- .../context-cleanup-pod/03-policy.yaml | 13 -------- .../context-cleanup-pod/04-sleep.yaml | 11 ------- .../context-cleanup-pod/05-check.yaml | 11 ------- .../context-cleanup-pod/chainsaw-test.yaml | 31 +++++++++++++++++++ .../cleanup/policy/cleanup-pod/01-rbac.yaml | 11 ------- .../cleanup/policy/cleanup-pod/02-pod.yaml | 13 -------- .../cleanup/policy/cleanup-pod/03-policy.yaml | 13 -------- .../cleanup/policy/cleanup-pod/04-sleep.yaml | 11 ------- .../cleanup/policy/cleanup-pod/05-check.yaml | 11 ------- .../policy/cleanup-pod/chainsaw-test.yaml | 31 +++++++++++++++++++ .../validation/cron-format/01-policy.yaml | 13 -------- .../cron-format/02-clusterpolicy.yaml | 13 -------- .../cron-format/03-invalidpolicy.yaml | 14 --------- .../validation/cron-format/chainsaw-test.yaml | 26 ++++++++++++++++ .../01-cleanuppolicy.yaml | 24 -------------- .../no-user-info-in-match/chainsaw-test.yaml | 24 ++++++++++++++ .../01-cleanup-policy.yaml | 19 ------------ .../chainsaw-test.yaml | 19 ++++++++++++ 48 files changed, 284 insertions(+), 452 deletions(-) delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/01-policy.yaml delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/02-resource.yaml delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/03-event.yaml create mode 100755 test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/01-policy.yaml delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/02-resource.yaml delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/03-report.yaml create mode 100755 test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/not-rejected/01-policy.yaml delete mode 100644 test/conformance/chainsaw/background-only/cluster-policy/not-rejected/02-resource.yaml create mode 100755 test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/no-admission-event/01-policy.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/no-admission-event/02-resource.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/no-admission-event/03-event.yaml create mode 100755 test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/no-admission-report/01-policy.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/no-admission-report/02-resource.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/no-admission-report/03-report.yaml create mode 100755 test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/not-rejected/01-policy.yaml delete mode 100644 test/conformance/chainsaw/background-only/policy/not-rejected/02-resource.yaml create mode 100755 test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/01-rbac.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/02-pod.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/03-policy.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/04-sleep.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/05-check.yaml create mode 100755 test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/01-rbac.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/02-pod.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/03-policy.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/04-sleep.yaml delete mode 100644 test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/05-check.yaml create mode 100755 test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/cleanup/policy/cleanup-pod/01-rbac.yaml delete mode 100644 test/conformance/chainsaw/cleanup/policy/cleanup-pod/02-pod.yaml delete mode 100644 test/conformance/chainsaw/cleanup/policy/cleanup-pod/03-policy.yaml delete mode 100644 test/conformance/chainsaw/cleanup/policy/cleanup-pod/04-sleep.yaml delete mode 100644 test/conformance/chainsaw/cleanup/policy/cleanup-pod/05-check.yaml create mode 100755 test/conformance/chainsaw/cleanup/policy/cleanup-pod/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/cleanup/validation/cron-format/01-policy.yaml delete mode 100644 test/conformance/chainsaw/cleanup/validation/cron-format/02-clusterpolicy.yaml delete mode 100644 test/conformance/chainsaw/cleanup/validation/cron-format/03-invalidpolicy.yaml create mode 100755 test/conformance/chainsaw/cleanup/validation/cron-format/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/01-cleanuppolicy.yaml create mode 100755 test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/chainsaw-test.yaml delete mode 100644 test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/01-cleanup-policy.yaml create mode 100755 test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/chainsaw-test.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/01-policy.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/01-policy.yaml deleted file mode 100644 index 6134698445..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/01-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/02-resource.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/02-resource.yaml deleted file mode 100644 index e750d48225..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/02-resource.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: resource -spec: - timeouts: {} - try: - - apply: - file: resource.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/03-event.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/03-event.yaml deleted file mode 100644 index d4f0ab909a..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/03-event.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: event -spec: - timeouts: {} - try: - - assert: - file: background-event.yaml - - error: - file: admission-event.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml new file mode 100755 index 0000000000..1b04d86664 --- /dev/null +++ b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml @@ -0,0 +1,23 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: no-admission-event +spec: + steps: + - name: step-01 + try: + - apply: + file: policy.yaml + - assert: + file: policy-assert.yaml + - name: step-02 + try: + - apply: + file: resource.yaml + - name: step-03 + try: + - assert: + file: background-event.yaml + - error: + file: admission-event.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/01-policy.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/01-policy.yaml deleted file mode 100644 index 6134698445..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/01-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/02-resource.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/02-resource.yaml deleted file mode 100644 index e750d48225..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/02-resource.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: resource -spec: - timeouts: {} - try: - - apply: - file: resource.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/03-report.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/03-report.yaml deleted file mode 100644 index f417d28aed..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/03-report.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: report -spec: - timeouts: {} - try: - - error: - file: admission-report.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml new file mode 100755 index 0000000000..19248d7484 --- /dev/null +++ b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml @@ -0,0 +1,21 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: no-admission-report +spec: + steps: + - name: step-01 + try: + - apply: + file: policy.yaml + - assert: + file: policy-assert.yaml + - name: step-02 + try: + - apply: + file: resource.yaml + - name: step-03 + try: + - error: + file: admission-report.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/01-policy.yaml b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/01-policy.yaml deleted file mode 100644 index 6134698445..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/01-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/02-resource.yaml b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/02-resource.yaml deleted file mode 100644 index e750d48225..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/02-resource.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: resource -spec: - timeouts: {} - try: - - apply: - file: resource.yaml diff --git a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml new file mode 100755 index 0000000000..cb87369ca5 --- /dev/null +++ b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml @@ -0,0 +1,17 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: not-rejected +spec: + steps: + - name: step-01 + try: + - apply: + file: policy.yaml + - assert: + file: policy-assert.yaml + - name: step-02 + try: + - apply: + file: resource.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event/01-policy.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event/01-policy.yaml deleted file mode 100644 index 6134698445..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-event/01-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event/02-resource.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event/02-resource.yaml deleted file mode 100644 index e750d48225..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-event/02-resource.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: resource -spec: - timeouts: {} - try: - - apply: - file: resource.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event/03-event.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event/03-event.yaml deleted file mode 100644 index d4f0ab909a..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-event/03-event.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: event -spec: - timeouts: {} - try: - - assert: - file: background-event.yaml - - error: - file: admission-event.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml new file mode 100755 index 0000000000..1b04d86664 --- /dev/null +++ b/test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml @@ -0,0 +1,23 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: no-admission-event +spec: + steps: + - name: step-01 + try: + - apply: + file: policy.yaml + - assert: + file: policy-assert.yaml + - name: step-02 + try: + - apply: + file: resource.yaml + - name: step-03 + try: + - assert: + file: background-event.yaml + - error: + file: admission-event.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report/01-policy.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report/01-policy.yaml deleted file mode 100644 index 6134698445..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-report/01-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report/02-resource.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report/02-resource.yaml deleted file mode 100644 index e750d48225..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-report/02-resource.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: resource -spec: - timeouts: {} - try: - - apply: - file: resource.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report/03-report.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report/03-report.yaml deleted file mode 100644 index f417d28aed..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-report/03-report.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: report -spec: - timeouts: {} - try: - - error: - file: admission-report.yaml diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml new file mode 100755 index 0000000000..19248d7484 --- /dev/null +++ b/test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml @@ -0,0 +1,21 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: no-admission-report +spec: + steps: + - name: step-01 + try: + - apply: + file: policy.yaml + - assert: + file: policy-assert.yaml + - name: step-02 + try: + - apply: + file: resource.yaml + - name: step-03 + try: + - error: + file: admission-report.yaml diff --git a/test/conformance/chainsaw/background-only/policy/not-rejected/01-policy.yaml b/test/conformance/chainsaw/background-only/policy/not-rejected/01-policy.yaml deleted file mode 100644 index 6134698445..0000000000 --- a/test/conformance/chainsaw/background-only/policy/not-rejected/01-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml diff --git a/test/conformance/chainsaw/background-only/policy/not-rejected/02-resource.yaml b/test/conformance/chainsaw/background-only/policy/not-rejected/02-resource.yaml deleted file mode 100644 index e750d48225..0000000000 --- a/test/conformance/chainsaw/background-only/policy/not-rejected/02-resource.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: resource -spec: - timeouts: {} - try: - - apply: - file: resource.yaml diff --git a/test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml new file mode 100755 index 0000000000..cb87369ca5 --- /dev/null +++ b/test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml @@ -0,0 +1,17 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: not-rejected +spec: + steps: + - name: step-01 + try: + - apply: + file: policy.yaml + - assert: + file: policy-assert.yaml + - name: step-02 + try: + - apply: + file: resource.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/01-rbac.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/01-rbac.yaml deleted file mode 100644 index 36f4242fac..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/01-rbac.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: rbac -spec: - timeouts: {} - try: - - apply: - file: rbac.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/02-pod.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/02-pod.yaml deleted file mode 100644 index b6172499fe..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/02-pod.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: pod -spec: - timeouts: {} - try: - - apply: - file: pod.yaml - - assert: - file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/03-policy.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/03-policy.yaml deleted file mode 100644 index 909c002ac4..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/03-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/04-sleep.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/04-sleep.yaml deleted file mode 100644 index 93582f2837..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/04-sleep.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: sleep -spec: - timeouts: {} - try: - - sleep: - duration: 65s diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/05-check.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/05-check.yaml deleted file mode 100644 index 7571906109..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/05-check.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: check -spec: - timeouts: {} - try: - - error: - file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/chainsaw-test.yaml new file mode 100755 index 0000000000..a4c2e269ed --- /dev/null +++ b/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/chainsaw-test.yaml @@ -0,0 +1,31 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: cleanup-pod +spec: + steps: + - name: step-01 + try: + - apply: + file: rbac.yaml + - name: step-02 + try: + - apply: + file: pod.yaml + - assert: + file: pod-assert.yaml + - name: step-03 + try: + - apply: + file: policy.yaml + - assert: + file: policy.yaml + - name: step-04 + try: + - sleep: + duration: 1m5s + - name: step-05 + try: + - error: + file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/01-rbac.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/01-rbac.yaml deleted file mode 100644 index 36f4242fac..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/01-rbac.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: rbac -spec: - timeouts: {} - try: - - apply: - file: rbac.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/02-pod.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/02-pod.yaml deleted file mode 100644 index b6172499fe..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/02-pod.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: pod -spec: - timeouts: {} - try: - - apply: - file: pod.yaml - - assert: - file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/03-policy.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/03-policy.yaml deleted file mode 100644 index 909c002ac4..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/03-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/04-sleep.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/04-sleep.yaml deleted file mode 100644 index 403e87f011..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/04-sleep.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: sleep -spec: - timeouts: {} - try: - - sleep: - duration: 5s diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/05-check.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/05-check.yaml deleted file mode 100644 index 7571906109..0000000000 --- a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/05-check.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: check -spec: - timeouts: {} - try: - - error: - file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml new file mode 100755 index 0000000000..cad06833d2 --- /dev/null +++ b/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml @@ -0,0 +1,31 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: context-cleanup-pod +spec: + steps: + - name: step-01 + try: + - apply: + file: rbac.yaml + - name: step-02 + try: + - apply: + file: pod.yaml + - assert: + file: pod-assert.yaml + - name: step-03 + try: + - apply: + file: policy.yaml + - assert: + file: policy.yaml + - name: step-04 + try: + - sleep: + duration: 5s + - name: step-05 + try: + - error: + file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/01-rbac.yaml b/test/conformance/chainsaw/cleanup/policy/cleanup-pod/01-rbac.yaml deleted file mode 100644 index 36f4242fac..0000000000 --- a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/01-rbac.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: rbac -spec: - timeouts: {} - try: - - apply: - file: rbac.yaml diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/02-pod.yaml b/test/conformance/chainsaw/cleanup/policy/cleanup-pod/02-pod.yaml deleted file mode 100644 index b6172499fe..0000000000 --- a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/02-pod.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: pod -spec: - timeouts: {} - try: - - apply: - file: pod.yaml - - assert: - file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/03-policy.yaml b/test/conformance/chainsaw/cleanup/policy/cleanup-pod/03-policy.yaml deleted file mode 100644 index 909c002ac4..0000000000 --- a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/03-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy.yaml diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/04-sleep.yaml b/test/conformance/chainsaw/cleanup/policy/cleanup-pod/04-sleep.yaml deleted file mode 100644 index 93582f2837..0000000000 --- a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/04-sleep.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: sleep -spec: - timeouts: {} - try: - - sleep: - duration: 65s diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/05-check.yaml b/test/conformance/chainsaw/cleanup/policy/cleanup-pod/05-check.yaml deleted file mode 100644 index 7571906109..0000000000 --- a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/05-check.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: check -spec: - timeouts: {} - try: - - error: - file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/policy/cleanup-pod/chainsaw-test.yaml new file mode 100755 index 0000000000..a4c2e269ed --- /dev/null +++ b/test/conformance/chainsaw/cleanup/policy/cleanup-pod/chainsaw-test.yaml @@ -0,0 +1,31 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: cleanup-pod +spec: + steps: + - name: step-01 + try: + - apply: + file: rbac.yaml + - name: step-02 + try: + - apply: + file: pod.yaml + - assert: + file: pod-assert.yaml + - name: step-03 + try: + - apply: + file: policy.yaml + - assert: + file: policy.yaml + - name: step-04 + try: + - sleep: + duration: 1m5s + - name: step-05 + try: + - error: + file: pod-assert.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/01-policy.yaml b/test/conformance/chainsaw/cleanup/validation/cron-format/01-policy.yaml deleted file mode 100644 index 909c002ac4..0000000000 --- a/test/conformance/chainsaw/cleanup/validation/cron-format/01-policy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: policy -spec: - timeouts: {} - try: - - apply: - file: policy.yaml - - assert: - file: policy.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/02-clusterpolicy.yaml b/test/conformance/chainsaw/cleanup/validation/cron-format/02-clusterpolicy.yaml deleted file mode 100644 index eabab883d3..0000000000 --- a/test/conformance/chainsaw/cleanup/validation/cron-format/02-clusterpolicy.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: clusterpolicy -spec: - timeouts: {} - try: - - apply: - file: clusterpolicy.yaml - - assert: - file: clusterpolicy.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/03-invalidpolicy.yaml b/test/conformance/chainsaw/cleanup/validation/cron-format/03-invalidpolicy.yaml deleted file mode 100644 index 709f748d92..0000000000 --- a/test/conformance/chainsaw/cleanup/validation/cron-format/03-invalidpolicy.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: invalidpolicy -spec: - timeouts: {} - try: - - apply: - expect: - - check: - ($error != null): true - file: invalidpolicy.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/validation/cron-format/chainsaw-test.yaml new file mode 100755 index 0000000000..c1b5eb1e07 --- /dev/null +++ b/test/conformance/chainsaw/cleanup/validation/cron-format/chainsaw-test.yaml @@ -0,0 +1,26 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: cron-format +spec: + steps: + - name: step-01 + try: + - apply: + file: policy.yaml + - assert: + file: policy.yaml + - name: step-02 + try: + - apply: + file: clusterpolicy.yaml + - assert: + file: clusterpolicy.yaml + - name: step-03 + try: + - apply: + expect: + - check: + ($error != null): true + file: invalidpolicy.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/01-cleanuppolicy.yaml b/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/01-cleanuppolicy.yaml deleted file mode 100644 index cccf7f08e4..0000000000 --- a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/01-cleanuppolicy.yaml +++ /dev/null @@ -1,24 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: cleanuppolicy -spec: - timeouts: {} - try: - - apply: - expect: - - check: - ($error != null): true - file: cleanuppolicy-with-subjects.yaml - - apply: - expect: - - check: - ($error != null): true - file: cleanuppolicy-with-roles.yaml - - apply: - expect: - - check: - ($error != null): true - file: cleanuppolicy-with-clusterroles.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/chainsaw-test.yaml new file mode 100755 index 0000000000..37cc1a70c0 --- /dev/null +++ b/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/chainsaw-test.yaml @@ -0,0 +1,24 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: no-user-info-in-match +spec: + steps: + - name: step-01 + try: + - apply: + expect: + - check: + ($error != null): true + file: cleanuppolicy-with-subjects.yaml + - apply: + expect: + - check: + ($error != null): true + file: cleanuppolicy-with-roles.yaml + - apply: + expect: + - check: + ($error != null): true + file: cleanuppolicy-with-clusterroles.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/01-cleanup-policy.yaml b/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/01-cleanup-policy.yaml deleted file mode 100644 index a49b470aba..0000000000 --- a/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/01-cleanup-policy.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -apiVersion: chainsaw.kyverno.io/v1alpha1 -kind: TestStep -metadata: - creationTimestamp: null - name: cleanup-policy -spec: - timeouts: {} - try: - - apply: - expect: - - check: - ($error != null): true - file: cleanuppolicy-with-image-registry.yaml - - apply: - expect: - - check: - ($error != null): true - file: cleanuppolicy-with-configmap.yaml diff --git a/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/chainsaw-test.yaml new file mode 100755 index 0000000000..a2eebcf270 --- /dev/null +++ b/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/chainsaw-test.yaml @@ -0,0 +1,19 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + creationTimestamp: null + name: not-supported-attributes-in-context +spec: + steps: + - name: step-01 + try: + - apply: + expect: + - check: + ($error != null): true + file: cleanuppolicy-with-image-registry.yaml + - apply: + expect: + - check: + ($error != null): true + file: cleanuppolicy-with-configmap.yaml