From 2a6805011690e1eb112a4461dea7dcf80165cea4 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Wed, 15 Nov 2023 10:48:37 +0100 Subject: [PATCH] test: add missing fields to e2e fixtures Signed-off-by: Flavio Castelli --- e2e.bats | 10 ++++++++-- test_data/ns_with_labels.json | 10 ++++++++-- test_data/ns_without_labels.json | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/e2e.bats b/e2e.bats index 85da7e9..af292eb 100644 --- a/e2e.bats +++ b/e2e.bats @@ -6,8 +6,11 @@ --allow-context-aware \ --replay-host-capabilities-interactions test_data/session_project_found.yml \ annotated-policy.wasm + + # this prints the output when one the checks below fails + echo "output = ${output}" + [ "$status" -eq 0 ] - echo "$output" [ $(expr "$output" : '.*"allowed":true.*') -ne 0 ] [ $(expr "$output" : '.*JSONPatch.*') -ne 0 ] } @@ -18,8 +21,11 @@ --allow-context-aware \ --replay-host-capabilities-interactions test_data/session_project_found.yml \ annotated-policy.wasm + + # this prints the output when one the checks below fails + echo "output = ${output}" + [ "$status" -eq 0 ] - echo "$output" [ $(expr "$output" : '.*"allowed":true.*') -ne 0 ] [ $(expr "$output" : '.*JSONPatch.*') -eq 0 ] } diff --git a/test_data/ns_with_labels.json b/test_data/ns_with_labels.json index 37c3465..b0c5e97 100644 --- a/test_data/ns_with_labels.json +++ b/test_data/ns_with_labels.json @@ -1,9 +1,15 @@ { "uid": "1299d386-525b-4032-98ae-1949f69f9cfc", "kind": { + "group": "", "kind": "Namespace", "version": "v1" }, + "resource": { + "group": "", + "version": "v1", + "resource": "namespaces" + }, "object": { "metadata": { "name": "test", @@ -14,11 +20,11 @@ "io.kubewarden.psp_profile": "strict" } }, - "spec": { - } + "spec": {} }, "operation": "CREATE", "requestKind": { + "group": "", "version": "v1", "kind": "Namespace" }, diff --git a/test_data/ns_without_labels.json b/test_data/ns_without_labels.json index 02ba520..2bca748 100644 --- a/test_data/ns_without_labels.json +++ b/test_data/ns_without_labels.json @@ -1,9 +1,15 @@ { "uid": "1299d386-525b-4032-98ae-1949f69f9cfc", "kind": { + "group": "", "kind": "Namespace", "version": "v1" }, + "resource": { + "group": "", + "version": "v1", + "resource": "namespaces" + }, "object": { "metadata": { "name": "test", @@ -11,11 +17,11 @@ "field.cattle.io/projectId": "local:p-5fcf4" } }, - "spec": { - } + "spec": {} }, "operation": "CREATE", "requestKind": { + "group": "", "version": "v1", "kind": "Namespace" },