-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtest_firewall_policy.yml
220 lines (201 loc) · 5.04 KB
/
test_firewall_policy.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Firewall Policy Test
description: basic firewall policy test
cleanup:
- path: /project/f1b58d1c-9bf0-11e9-9b23-3ba766fa5e92
- path: /firewall-rule/fw_rule_test_firewall_policy_uuid
- path: /firewall-rule/global_fw_rule_test_firewall_policy_uuid
- path: /firewall-policy/test_firewall_policy_uuid
test_data:
admin_project: &admin_project
fq_name:
- default-domain
- admin_project
uuid: f1b58d1c-9bf0-11e9-9b23-3ba766fa5e92
parent_type: domain
parent_uuid: beefbeef-beef-beef-beef-beefbeef0002
quota: {}
firewall_rule: &firewall_rule
uuid: fw_rule_test_firewall_policy_uuid
parent_type: project
fq_name:
- default-domain
- admin_project
- test_firewall_rule
endpoint_1:
any: true
endpoint_2:
any: true
match_tags:
tag_list:
- application
service:
protocol: tcp
global_firewall_rule: &global_firewall_rule
uuid: global_fw_rule_test_firewall_policy_uuid
parent_type: policy-management
fq_name:
- default-policy-management
- test_firewall_rule
endpoint_1:
any: true
endpoint_2:
any: true
match_tags:
tag_list:
- application
service:
protocol: tcp
firewall_policy: &firewall_policy
uuid: test_firewall_policy_uuid
parent_type: policy-management
fq_name:
- default-policy-management
- test_firewall_policy
name: k8s-denyall
display_name: k8s-denyall
clients:
default:
id: alice
password: alice_password
insecure: true
scope:
project:
name: admin
workflow:
- name: create project admin
request:
path: /projects
method: POST
expected:
- 200
data:
project: *admin_project
expect:
project: *admin_project
- name: create firewall rule
request:
path: /firewall-rules
method: POST
expected: [200]
data:
firewall-rule: *firewall_rule
expect:
firewall-rule: *firewall_rule
- name: create firewall rule
request:
path: /firewall-rules
method: POST
expected: [200]
data:
firewall-rule: *global_firewall_rule
expect:
firewall-rule: *global_firewall_rule
- name: creating firewall policy with draft mode state property defined should fail
request:
path: /firewall-policys
method: POST
expected: [400]
data:
firewall-policy:
<<: *firewall_policy
draft_mode_state: created
- name: creating global firewall policy with scoped refs should fail
request:
path: /firewall-policys
method: POST
expected: [400]
data:
firewall-policy:
<<: *firewall_policy
firewall_rule_refs:
- uuid: fw_rule_test_firewall_policy_uuid
- name: create firewall policy
request:
path: /firewall-policys
method: POST
expected: [200]
data:
firewall-policy: *firewall_policy
expect:
firewall-policy: *firewall_policy
- name: updating firewall policy with draft-state-mode property defined should fail
request:
path: /firewall-policy/test_firewall_policy_uuid
method: PUT
expected: [400]
data:
firewall-policy:
uuid: test_firewall_policy_uuid
draft_mode_state: created
- name: updating global firewall policy with scoped refs should fail
request:
path: /firewall-policy/test_firewall_policy_uuid
method: PUT
expected: [400]
data:
firewall-policy:
uuid: test_firewall_policy_uuid
firewall_rule_refs:
- uuid: fw_rule_test_firewall_policy_uuid
- name: updating global firewall policy with global firewall rule
request:
path: /ref-update
method: POST
expected: [200]
data:
operation: ADD
type: firewall-policy
uuid: test_firewall_policy_uuid
ref-type: firewall-rule
ref-uuid: global_fw_rule_test_firewall_policy_uuid
expect:
uuid: test_firewall_policy_uuid
- name: update firewall policy
request:
path: /firewall-policy/test_firewall_policy_uuid
method: PUT
expected: [200]
data:
firewall-policy:
uuid: test_firewall_policy_uuid
annotations:
key_value_pair:
- value: denyall
key: name
- name: get updated firewall policy
request:
path: /firewall-policy/test_firewall_policy_uuid
method: GET
expected: [200]
expect:
firewall-policy:
uuid: test_firewall_policy_uuid
annotations:
key_value_pair:
- value: denyall
key: name
- name: delete firewall policy
request:
path: /firewall-policy/test_firewall_policy_uuid
method: DELETE
expected: [200]
expect: null
- name: delete firewall rule
request:
path: /firewall-rule/fw_rule_test_firewall_policy_uuid
method: DELETE
expected: [200]
expect: null
- name: delete firewall rule
request:
path: /firewall-rule/global_fw_rule_test_firewall_policy_uuid
method: DELETE
expected: [200]
expect: null
- name: delete admin project
request:
path: /project/f1b58d1c-9bf0-11e9-9b23-3ba766fa5e92
method: DELETE
expected:
- 200
expect: null