-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathe2e.bats
31 lines (26 loc) · 946 Bytes
/
e2e.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bats
@test "Accept" {
run kwctl run \
--request-path test_data/deployment.json \
--settings-path test_data/settings_accept.yaml \
--allow-context-aware \
--replay-host-capabilities-interactions test_data/session.yaml \
annotated-policy.wasm
# this prints the output when one the checks below fails
echo "output = ${output}"
[ "$status" -eq 0 ]
[ $(expr "$output" : '.*"allowed":true.*') -ne 0 ]
}
@test "Reject" {
run kwctl run \
--request-path test_data/deployment.json \
--settings-path test_data/settings_reject.yaml \
--allow-context-aware \
--replay-host-capabilities-interactions test_data/session.yaml \
annotated-policy.wasm
# this prints the output when one the checks below fails
echo "output = ${output}"
[ "$status" -eq 0 ]
[ $(expr "$output" : '.*"allowed":false.*') -ne 0 ]
[ $(expr "$output" : '.*Exceeded the number of allowed CVEs.*') -ne 0 ]
}