-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathe2e.bats
58 lines (49 loc) · 2.14 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bats
@test "Test anyIn" {
run kwctl run --request-path test_data/deployment_anyin.json --settings-path test_data/settings_anyin.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":true.*') -ne 0 ]
}
@test "Test anyIn with name only" {
run kwctl run --request-path test_data/deployment_anyin.json --settings-path test_data/settings_anyin_names_only.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":true.*') -ne 0 ]
}
@test "Test anyNotIn" {
run kwctl run --request-path test_data/deployment_anynotin.json --settings-path test_data/settings_anynotin.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":true.*') -ne 0 ]
}
@test "Test anyNotIn with names only" {
run kwctl run --request-path test_data/deployment_anynotin.json --settings-path test_data/settings_anynotin_names_only.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":true.*') -ne 0 ]
}
@test "Test allAreUsed" {
run kwctl run --request-path test_data/deployment_allareused.json --settings-path test_data/settings_allareused.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":false.*') -ne 0 ]
}
@test "Test allAreUsed with names only" {
run kwctl run --request-path test_data/deployment_allareused.json --settings-path test_data/settings_allareused_names_only.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":false.*') -ne 0 ]
}
@test "Test notAllAreUsed" {
run kwctl run --request-path test_data/deployment_notallareused.json --settings-path test_data/settings_notallareused.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":false.*') -ne 0 ]
}
@test "Test notAllAreUsed with names only" {
run kwctl run --request-path test_data/deployment_notallareused.json --settings-path test_data/settings_notallareused_names_only.json annotated-policy.wasm
[ "$status" -eq 0 ]
echo "$output"
[ $(expr "$output" : '.*"allowed":false.*') -ne 0 ]
}