Skip to content

Commit 7a3483d

Browse files
authored
tests: set missing zones (#43)
* tests: set missing zones * test cleanup
1 parent be2a049 commit 7a3483d

File tree

9 files changed

+83
-112
lines changed

9 files changed

+83
-112
lines changed

tests/integration/targets/cs_account/tasks/main.yml

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
- name: setup
3-
cs_account: name={{ cs_resource_prefix }}_user state=absent
3+
cs_account:
4+
name: "{{ cs_resource_prefix }}_username"
5+
state: absent
46
register: acc
5-
- name: verify setup
6-
assert:
7-
that:
8-
- acc is successful
97

108
- name: test fail if missing name
119
action: cs_account
@@ -42,7 +40,6 @@
4240
- name: verify results of create account in check mode
4341
assert:
4442
that:
45-
- acc is successful
4643
- acc is changed
4744

4845
- name: test create user account
@@ -58,7 +55,6 @@
5855
- name: verify results of create account
5956
assert:
6057
that:
61-
- acc is successful
6258
- acc is changed
6359
- acc.name == "{{ cs_resource_prefix }}_user"
6460
- acc.network_domain == "example.com"
@@ -79,7 +75,6 @@
7975
- name: verify results of create account idempotence
8076
assert:
8177
that:
82-
- acc is successful
8378
- acc is not changed
8479
- acc.name == "{{ cs_resource_prefix }}_user"
8580
- acc.network_domain == "example.com"
@@ -96,7 +91,6 @@
9691
- name: verify results of lock user account in check mode
9792
assert:
9893
that:
99-
- acc is successful
10094
- acc is changed
10195
- acc.name == "{{ cs_resource_prefix }}_user"
10296
- acc.network_domain == "example.com"
@@ -112,7 +106,6 @@
112106
- name: verify results of lock user account
113107
assert:
114108
that:
115-
- acc is successful
116109
- acc is changed
117110
- acc.name == "{{ cs_resource_prefix }}_user"
118111
- acc.network_domain == "example.com"
@@ -128,7 +121,6 @@
128121
- name: verify results of lock user account idempotence
129122
assert:
130123
that:
131-
- acc is successful
132124
- acc is not changed
133125
- acc.name == "{{ cs_resource_prefix }}_user"
134126
- acc.network_domain == "example.com"
@@ -145,7 +137,6 @@
145137
- name: verify results of disable user account in check mode
146138
assert:
147139
that:
148-
- acc is successful
149140
- acc is changed
150141
- acc.name == "{{ cs_resource_prefix }}_user"
151142
- acc.network_domain == "example.com"
@@ -161,7 +152,6 @@
161152
- name: verify results of disable user account
162153
assert:
163154
that:
164-
- acc is successful
165155
- acc is changed
166156
- acc.name == "{{ cs_resource_prefix }}_user"
167157
- acc.network_domain == "example.com"
@@ -177,7 +167,6 @@
177167
- name: verify results of disable user account idempotence
178168
assert:
179169
that:
180-
- acc is successful
181170
- acc is not changed
182171
- acc.name == "{{ cs_resource_prefix }}_user"
183172
- acc.network_domain == "example.com"
@@ -194,7 +183,6 @@
194183
- name: verify results of lock disabled user account in check mode
195184
assert:
196185
that:
197-
- acc is successful
198186
- acc is changed
199187
- acc.name == "{{ cs_resource_prefix }}_user"
200188
- acc.network_domain == "example.com"
@@ -210,7 +198,6 @@
210198
- name: verify results of lock disabled user account
211199
assert:
212200
that:
213-
- acc is successful
214201
- acc is changed
215202
- acc.name == "{{ cs_resource_prefix }}_user"
216203
- acc.network_domain == "example.com"
@@ -226,7 +213,6 @@
226213
- name: verify results of lock disabled user account idempotence
227214
assert:
228215
that:
229-
- acc is successful
230216
- acc is not changed
231217
- acc.name == "{{ cs_resource_prefix }}_user"
232218
- acc.network_domain == "example.com"
@@ -243,7 +229,6 @@
243229
- name: verify results of enable user account in check mode
244230
assert:
245231
that:
246-
- acc is successful
247232
- acc is changed
248233
- acc.name == "{{ cs_resource_prefix }}_user"
249234
- acc.network_domain == "example.com"
@@ -259,7 +244,6 @@
259244
- name: verify results of enable user account
260245
assert:
261246
that:
262-
- acc is successful
263247
- acc is changed
264248
- acc.name == "{{ cs_resource_prefix }}_user"
265249
- acc.network_domain == "example.com"
@@ -275,7 +259,6 @@
275259
- name: verify results of enable user account idempotence
276260
assert:
277261
that:
278-
- acc is successful
279262
- acc is not changed
280263
- acc.name == "{{ cs_resource_prefix }}_user"
281264
- acc.network_domain == "example.com"
@@ -292,7 +275,6 @@
292275
- name: verify results of remove user account in check mode
293276
assert:
294277
that:
295-
- acc is successful
296278
- acc is changed
297279
- acc.name == "{{ cs_resource_prefix }}_user"
298280
- acc.network_domain == "example.com"
@@ -308,7 +290,6 @@
308290
- name: verify results of remove user account
309291
assert:
310292
that:
311-
- acc is successful
312293
- acc is changed
313294
- acc.name == "{{ cs_resource_prefix }}_user"
314295
- acc.network_domain == "example.com"
@@ -324,7 +305,6 @@
324305
- name: verify results of remove user account idempotence
325306
assert:
326307
that:
327-
- acc is successful
328308
- acc is not changed
329309

330310
- name: test create user disabled account
@@ -341,7 +321,6 @@
341321
- name: verify results of create disabled account
342322
assert:
343323
that:
344-
- acc is successful
345324
- acc is changed
346325
- acc.name == "{{ cs_resource_prefix }}_user"
347326
- acc.network_domain == "example.com"
@@ -357,7 +336,6 @@
357336
- name: verify results of remove disabled user account
358337
assert:
359338
that:
360-
- acc is successful
361339
- acc is changed
362340
- acc.name == "{{ cs_resource_prefix }}_user"
363341
- acc.network_domain == "example.com"
@@ -379,7 +357,6 @@
379357
- name: verify results of create locked account
380358
assert:
381359
that:
382-
- acc is successful
383360
- acc is changed
384361
- acc.name == "{{ cs_resource_prefix }}_user"
385362
- acc.network_domain == "example.com"
@@ -395,7 +372,6 @@
395372
- name: verify results of remove locked user account
396373
assert:
397374
that:
398-
- acc is successful
399375
- acc is changed
400376
- acc.name == "{{ cs_resource_prefix }}_user"
401377
- acc.network_domain == "example.com"
@@ -417,7 +393,6 @@
417393
- name: verify results of create unlocked/enabled account
418394
assert:
419395
that:
420-
- acc is successful
421396
- acc is changed
422397
- acc.name == "{{ cs_resource_prefix }}_user"
423398
- acc.network_domain == "example.com"
@@ -433,7 +408,6 @@
433408
- name: verify results of remove unlocked/enabled user account
434409
assert:
435410
that:
436-
- acc is successful
437411
- acc is changed
438412
- acc.name == "{{ cs_resource_prefix }}_user"
439413
- acc.network_domain == "example.com"

tests/integration/targets/cs_firewall/tasks/main.yml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
network_domain: example.com
77
zone: "{{ cs_common_zone_adv }}"
88
register: net
9-
- name: verify network setup
10-
assert:
11-
that:
12-
- net is successful
139

1410
- name: setup instance to get network in implementation state
1511
cs_instance:
@@ -48,11 +44,6 @@
4844
ip_address: "{{ cs_firewall_ip_address }}"
4945
zone: "{{ cs_common_zone_adv }}"
5046
state: absent
51-
register: fw
52-
- name: verify setup
53-
assert:
54-
that:
55-
- fw is successful
5647

5748
- name: setup 5300
5849
cs_firewall:
@@ -65,11 +56,6 @@
6556
- 4.5.6.0/24
6657
zone: "{{ cs_common_zone_adv }}"
6758
state: absent
68-
register: fw
69-
- name: verify setup
70-
assert:
71-
that:
72-
- fw is successful
7359

7460
- name: setup all
7561
cs_firewall:
@@ -78,11 +64,6 @@
7864
type: egress
7965
zone: "{{ cs_common_zone_adv }}"
8066
state: absent
81-
register: fw
82-
- name: verify setup
83-
assert:
84-
that:
85-
- fw is successful
8667

8768
- name: test fail if missing params
8869
action: cs_firewall
@@ -128,7 +109,6 @@
128109
- name: verify results of present firewall rule ingress 80 in check mode
129110
assert:
130111
that:
131-
- fw is successful
132112
- fw is changed
133113

134114
- name: test present firewall rule ingress 80
@@ -140,7 +120,6 @@
140120
- name: verify results of present firewall rule ingress 80
141121
assert:
142122
that:
143-
- fw is successful
144123
- fw is changed
145124
- fw.cidr == "0.0.0.0/0"
146125
- fw.cidrs == [ '0.0.0.0/0' ]
@@ -159,7 +138,6 @@
159138
- name: verify results of present firewall rule ingress 80 idempotence
160139
assert:
161140
that:
162-
- fw is successful
163141
- fw is not changed
164142
- fw.cidr == "0.0.0.0/0"
165143
- fw.cidrs == [ '0.0.0.0/0' ]
@@ -184,7 +162,6 @@
184162
- name: verify results of present firewall rule ingress 5300 in check mode
185163
assert:
186164
that:
187-
- fw is successful
188165
- fw is changed
189166

190167
- name: test present firewall rule ingress 5300
@@ -201,7 +178,6 @@
201178
- name: verify results of present firewall rule ingress 5300
202179
assert:
203180
that:
204-
- fw is successful
205181
- fw is changed
206182
- fw.cidr == "1.2.3.0/24,4.5.6.0/24"
207183
- fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ]
@@ -225,7 +201,6 @@
225201
- name: verify results of present firewall rule ingress 5300 idempotence
226202
assert:
227203
that:
228-
- fw is successful
229204
- fw is not changed
230205
- fw.cidr == "1.2.3.0/24,4.5.6.0/24"
231206
- fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ]
@@ -246,7 +221,6 @@
246221
- name: verify results of present firewall rule egress all in check mode
247222
assert:
248223
that:
249-
- fw is successful
250224
- fw is changed
251225

252226
- name: test present firewall rule egress all
@@ -259,7 +233,6 @@
259233
- name: verify results of present firewall rule egress all
260234
assert:
261235
that:
262-
- fw is successful
263236
- fw is changed
264237
- fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24"
265238
- fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ]
@@ -277,7 +250,6 @@
277250
- name: verify results of present firewall rule egress all idempotence
278251
assert:
279252
that:
280-
- fw is successful
281253
- fw is not changed
282254
- fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24"
283255
- fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ]
@@ -296,7 +268,6 @@
296268
- name: verify results of absent firewall rule ingress 80 in check mode
297269
assert:
298270
that:
299-
- fw is successful
300271
- fw is changed
301272
- fw.cidr == "0.0.0.0/0"
302273
- fw.cidrs == [ '0.0.0.0/0' ]
@@ -316,7 +287,6 @@
316287
- name: verify results of absent firewall rule ingress 80
317288
assert:
318289
that:
319-
- fw is successful
320290
- fw is changed
321291
- fw.cidr == "0.0.0.0/0"
322292
- fw.cidrs == [ '0.0.0.0/0' ]
@@ -336,7 +306,6 @@
336306
- name: verify results of absent firewall rule ingress 80 idempotence
337307
assert:
338308
that:
339-
- fw is successful
340309
- fw is not changed
341310

342311
- name: test absent firewall rule ingress 5300 in check mode
@@ -355,7 +324,6 @@
355324
- name: verify results of absent firewall rule ingress 5300 in check mode
356325
assert:
357326
that:
358-
- fw is successful
359327
- fw is changed
360328
- fw.cidr == "1.2.3.0/24,4.5.6.0/24"
361329
- fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ]
@@ -380,7 +348,6 @@
380348
- name: verify results of absent firewall rule ingress 5300
381349
assert:
382350
that:
383-
- fw is successful
384351
- fw is changed
385352
- fw.cidr == "1.2.3.0/24,4.5.6.0/24"
386353
- fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ]
@@ -405,7 +372,6 @@
405372
- name: verify results of absent firewall rule ingress 5300 idempotence
406373
assert:
407374
that:
408-
- fw is successful
409375
- fw is not changed
410376

411377
- name: test absent firewall rule egress all in check mode
@@ -420,7 +386,6 @@
420386
- name: verify results of absent firewall rule egress all in check mode
421387
assert:
422388
that:
423-
- fw is successful
424389
- fw is changed
425390
- fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24"
426391
- fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ]
@@ -439,7 +404,6 @@
439404
- name: verify results of absent firewall rule egress all
440405
assert:
441406
that:
442-
- fw is successful
443407
- fw is changed
444408
- fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24"
445409
- fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ]
@@ -458,7 +422,6 @@
458422
- name: verify results of absent firewall rule egress all idempotence
459423
assert:
460424
that:
461-
- fw is successful
462425
- fw is not changed
463426

464427
- name: cleanup instance

0 commit comments

Comments
 (0)