Skip to content

Commit

Permalink
test: add missing fields to e2e fixtures
Browse files Browse the repository at this point in the history
Signed-off-by: Flavio Castelli <[email protected]>
  • Loading branch information
flavio committed Nov 15, 2023
1 parent 000c7d5 commit 2a68050
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
10 changes: 8 additions & 2 deletions e2e.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
}
Expand All @@ -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 ]
}
10 changes: 8 additions & 2 deletions test_data/ns_with_labels.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -14,11 +20,11 @@
"io.kubewarden.psp_profile": "strict"
}
},
"spec": {
}
"spec": {}
},
"operation": "CREATE",
"requestKind": {
"group": "",
"version": "v1",
"kind": "Namespace"
},
Expand Down
10 changes: 8 additions & 2 deletions test_data/ns_without_labels.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
{
"uid": "1299d386-525b-4032-98ae-1949f69f9cfc",
"kind": {
"group": "",
"kind": "Namespace",
"version": "v1"
},
"resource": {
"group": "",
"version": "v1",
"resource": "namespaces"
},
"object": {
"metadata": {
"name": "test",
"annotations": {
"field.cattle.io/projectId": "local:p-5fcf4"
}
},
"spec": {
}
"spec": {}
},
"operation": "CREATE",
"requestKind": {
"group": "",
"version": "v1",
"kind": "Namespace"
},
Expand Down

0 comments on commit 2a68050

Please sign in to comment.