-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.hurl
50 lines (45 loc) · 1.1 KB
/
test.hurl
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
# # Verify rules start empty
# GET http://localhost:9988/firewall/rules
# HTTP 200
# [Asserts]
# header "Content-Type" == "application/json"
# body == "[]"
# Submit a rule
POST http://localhost:9988/firewall/rules
Content-Type: application/json
{
"name": "Disable pings",
"description": "Forbidden ICMPs",
"rule": {
"action":"drop",
"matches":{"protocol":"ICMP"},
"applies_to":"destination"
}
}
HTTP 200
[Captures]
rule-id: jsonpath "$['id']"
POST http://localhost:9988/firewall/rules
Content-Type: application/json
{
"name": "Block 8080",
"description": "Block access to port 8080",
"rule": {
"action":"drop",
"matches":{ "port": 8080 },
"applies_to":"destination"
}
}
HTTP 200
[Captures]
rule-id2: jsonpath "$['id']"
GET http://localhost:9988/firewall/rules/{{rule-id}}
HTTP 200
GET http://localhost:9988/firewall/rules/{{rule-id2}}
HTTP 200
POST http://localhost:9988/firewall/rules/{{rule-id}}/enable
HTTP 200
POST http://localhost:9988/firewall/rules/{{rule-id2}}/enable
HTTP 200
POST http://localhost:9988/firewall/state/start
HTTP 200