Skip to content

Commit 82b2341

Browse files
committed
Update integtation tests
1 parent 668a5d1 commit 82b2341

File tree

5 files changed

+85
-35
lines changed

5 files changed

+85
-35
lines changed

playbooks/roles/dcnm_interface/dcnm_tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
ansible_eth_intf22: Ethernet1/22
4040
ansible_eth_intf23: Ethernet1/23
4141
ansible_eth_intf24: Ethernet1/24
42+
ansible_parent_intf1: Ethernet1/25
43+
ansible_sub_intf1: Ethernet1/25.100
4244

4345
roles:
4446
- dcnm_interface

playbooks/roles/ndfc_interface/ndfc_tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
port_channel_1: port-channel801
4040
port_channel_2: port-channel802
4141
port_channel_3: port-channel803
42+
port_channel_4: port-channel804
4243

4344
roles:
4445
- ndfc_interface

tests/integration/targets/dcnm_interface/tasks/dcnm.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
tags: sanity
1818

1919
- name: run test cases (connection=httpapi)
20-
include: "{{ test_case_to_run }}"
20+
ansible.builtin.include_tasks: "{{ test_case_to_run }}"
2121
with_items: "{{ test_items }}"
2222
loop_control:
2323
loop_var: test_case_to_run
@@ -43,7 +43,7 @@
4343
method: DELETE
4444
path: "{{ [vpc_delete_path[controller_version], ansible_vxlan_fabric_sno1] | join ('') }}"
4545
register: result
46-
ignore_errors: yes
46+
ignore_errors: true
4747
when: (ansible_vxlan_fabric is defined and ansible_vxlan_fabric_sno1 is defined and ansible_vxlan_fabric_sno2 is defined)
4848

4949
- name: Wait for 10 secs
@@ -61,7 +61,7 @@
6161
path: "{{ vxlan_config_save_path[controller_version] }}"
6262
register: result
6363
when: (ansible_vxlan_fabric is defined and ansible_vxlan_fabric_sno1 is defined and ansible_vxlan_fabric_sno2 is defined)
64-
ignore_errors: yes
64+
ignore_errors: true
6565

6666
##############################################
6767
## DEPLOY VXLAN VPC PAIR ##
@@ -75,7 +75,7 @@
7575
with_sequence: count=1
7676
loop_control:
7777
pause: 5
78-
ignore_errors: yes
78+
ignore_errors: true
7979
when: (ansible_vxlan_fabric is defined and ansible_vxlan_fabric_sno1 is defined and ansible_vxlan_fabric_sno2 is defined)
8080

8181
##############################################
@@ -86,7 +86,7 @@
8686
method: DELETE
8787
path: "{{ [vpc_delete_path[controller_version], ansible_cxt_fabric_sno1] | join ('') }}"
8888
register: result
89-
ignore_errors: yes
89+
ignore_errors: true
9090
when: (ansible_cxt_fabric is defined and ansible_cxt_fabric_sno1 is defined and ansible_cxt_fabric_sno2 is defined)
9191

9292
- name: Wait for 10 secs
@@ -104,7 +104,7 @@
104104
path: "{{ cxt_config_save_path[controller_version] }}"
105105
register: result
106106
when: (ansible_cxt_fabric is defined and ansible_cxt_fabric_sno1 is defined and ansible_cxt_fabric_sno2 is defined)
107-
ignore_errors: yes
107+
ignore_errors: true
108108

109109
##############################################
110110
## DEPLOY CXT VPC PAIR ##
@@ -118,7 +118,7 @@
118118
with_sequence: count=1
119119
loop_control:
120120
pause: 5
121-
ignore_errors: yes
121+
ignore_errors: true
122122
when: (ansible_cxt_fabric is defined and ansible_cxt_fabric_sno1 is defined and ansible_cxt_fabric_sno2 is defined)
123123

124124
- name: Final Cleanup - delete my_vpc my_lacp my_interface_vlan and my_hsrp policies that we created during init
@@ -160,4 +160,4 @@
160160
that:
161161
- 'item["RETURN_CODE"] == 200'
162162
loop: '{{ result.response }}'
163-
tags: sanity
163+
tags: sanity
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
- { include: dcnm.yaml, tags: ['dcnm'] }
2+
- { ansible.builtin.include_tasks: dcnm.yaml, tags: ['dcnm'] }

tests/integration/targets/dcnm_interface/tests/dcnm/dcnm_delete_diff_options.yaml

Lines changed: 73 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,42 @@
2222
##############################################
2323
## MERGE ##
2424
##############################################
25+
26+
- name: Put Parent Interface for Sub-Interface into routed mode
27+
cisco.dcnm.dcnm_interface:
28+
check_deploy: False
29+
fabric: "{{ ansible_it_fabric }}"
30+
state: merged # only choose form [merged, replaced, deleted, overridden, query]
31+
config:
32+
- name: "{{ ansible_parent_intf1 }}" # should be of the form eth<port-id>
33+
type: eth # choose from this list [pc, vpc, sub_int, lo, eth, svi]
34+
switch:
35+
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
36+
deploy: false # choose from [true, false]
37+
profile:
38+
admin_state: true # choose from [true, false]
39+
mode: routed # choose from [trunk, access, routed, monitor, epl_routed]
40+
description: "Parent Interface for Sub-Interface test"
41+
2542
- name: Create interfaces to check various delete form 1
2643
cisco.dcnm.dcnm_interface:
27-
check_deploy: True
44+
check_deploy: False
2845
fabric: "{{ ansible_it_fabric }}"
2946
state: merged # only choose form [merged, replaced, deleted, overridden, query]
3047
config:
3148
- name: po333 # should be of the form po<port-id>
3249
type: pc # choose from this list [pc, vpc, sub_int, lo, eth, svi]
3350
switch:
3451
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
35-
deploy: true # choose from [true, false]
52+
deploy: false # choose from [true, false]
3653
profile:
3754
mode: trunk # choose from [trunk, access, l3, monitor]
3855

3956
- name: "{{ ansible_sub_intf1 }}" # should be of the form eth<port-num>.<port-id>
4057
type: sub_int # choose from this list [pc, vpc, sub_int, lo, eth, svi]
4158
switch:
4259
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
43-
deploy: true # choose from [true, false]
60+
deploy: false # choose from [true, false]
4461
profile:
4562
mode: subint # choose from [subint]
4663
vlan: 100 # vlan ID [min:2, max:3967]
@@ -51,7 +68,7 @@
5168
type: lo # choose from this list [pc, vpc, sub_int, lo, eth, svi]
5269
switch:
5370
- "{{ ansible_switch1 }}" # provide the switch where to deploy the config
54-
deploy: true # choose from [true, false]
71+
deploy: false # choose from [true, false]
5572
profile:
5673
mode: lo # choose from [lo]
5774
ipv4_addr: 193.168.2.1 # ipv4 address for the loopback interface
@@ -61,7 +78,7 @@
6178
switch: # provide switches of vPC pair
6279
- "{{ ansible_switch1 }}"
6380
- "{{ ansible_switch2 }}"
64-
deploy: true # choose from [true, false]
81+
deploy: false # choose from [true, false]
6582
profile:
6683
admin_state: true # choose from [true, false]
6784
mode: trunk # choose from [trunk, access]
@@ -88,7 +105,7 @@
88105
- '(result["diff"][0]["deleted"] | length) == 0'
89106
- '(result["diff"][0]["replaced"] | length) == 0'
90107
- '(result["diff"][0]["overridden"] | length) == 0'
91-
- '(result["diff"][0]["deploy"] | length) == 4'
108+
- '(result["diff"][0]["deploy"] | length) == 0'
92109

93110
- assert:
94111
that:
@@ -101,7 +118,7 @@
101118

102119
- name: Delete all interfaces form 1
103120
cisco.dcnm.dcnm_interface:
104-
check_deploy: True
121+
check_deploy: False
105122
fabric: "{{ ansible_it_fabric }}"
106123
state: deleted # only choose form [merged, replaced, deleted, overridden,query]
107124
register: result
@@ -124,25 +141,41 @@
124141
## MERGE ##
125142
##############################################
126143

144+
- name: Put Parent Interface for Sub-Interface into routed mode
145+
cisco.dcnm.dcnm_interface:
146+
check_deploy: False
147+
fabric: "{{ ansible_it_fabric }}"
148+
state: merged # only choose form [merged, replaced, deleted, overridden, query]
149+
config:
150+
- name: "{{ ansible_parent_intf1 }}" # should be of the form eth<port-id>
151+
type: eth # choose from this list [pc, vpc, sub_int, lo, eth, svi]
152+
switch:
153+
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
154+
deploy: false # choose from [true, false]
155+
profile:
156+
admin_state: true # choose from [true, false]
157+
mode: routed # choose from [trunk, access, routed, monitor, epl_routed]
158+
description: "Parent Interface for Sub-Interface test"
159+
127160
- name: Create all interfaces to check delete form 2
128161
cisco.dcnm.dcnm_interface:
129-
check_deploy: True
162+
check_deploy: False
130163
fabric: "{{ ansible_it_fabric }}"
131164
state: merged # only choose form [merged, replaced, deleted, overridden, query]
132165
config:
133166
- name: po333 # should be of the form po<port-id>
134167
type: pc # choose from this list [pc, vpc, sub_int, lo, eth, svi]
135168
switch:
136169
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
137-
deploy: true # choose from [true, false]
170+
deploy: false # choose from [true, false]
138171
profile:
139172
mode: trunk # choose from [trunk, access, l3, monitor]
140173

141174
- name: "{{ ansible_sub_intf1 }}" # should be of the form eth<port-num>.<port-id>
142175
type: sub_int # choose from this list [pc, vpc, sub_int, lo, eth, svi]
143176
switch:
144177
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
145-
deploy: true # choose from [true, false]
178+
deploy: false # choose from [true, false]
146179
profile:
147180
mode: subint # choose from [subint]
148181
vlan: 100 # vlan ID [min:2, max:3967]
@@ -153,7 +186,7 @@
153186
type: lo # choose from this list [pc, vpc, sub_int, lo, eth, svi]
154187
switch:
155188
- "{{ ansible_switch1 }}" # provide the switch where to deploy the config
156-
deploy: true # choose from [true, false]
189+
deploy: false # choose from [true, false]
157190
profile:
158191
mode: lo # choose from [lo]
159192
ipv4_addr: 193.168.2.1 # ipv4 address for the loopback interface
@@ -163,7 +196,7 @@
163196
switch: # provide switches of vPC pair
164197
- "{{ ansible_switch1 }}"
165198
- "{{ ansible_switch2 }}"
166-
deploy: true # choose from [true, false]
199+
deploy: false # choose from [true, false]
167200
profile:
168201
admin_state: true # choose from [true, false]
169202
mode: trunk # choose from [trunk, access]
@@ -190,7 +223,7 @@
190223
- '(result["diff"][0]["deleted"] | length) == 0'
191224
- '(result["diff"][0]["replaced"] | length) == 0'
192225
- '(result["diff"][0]["overridden"] | length) == 0'
193-
- '(result["diff"][0]["deploy"] | length) == 4'
226+
- '(result["diff"][0]["deploy"] | length) == 0'
194227

195228
- assert:
196229
that:
@@ -203,13 +236,11 @@
203236

204237
- name: Delete all interfaces form 2
205238
cisco.dcnm.dcnm_interface:
206-
check_deploy: True
239+
check_deploy: False
207240
fabric: "{{ ansible_it_fabric }}"
208241
state: deleted # only choose form [merged, replaced, deleted, overridden,query]
209242
config:
210243
- switch:
211-
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
212-
- "{{ ansible_switch1 }}"
213244
- "{{ ansible_switch2 }}" # provide the switch where to deploy the config
214245
register: result
215246

@@ -220,7 +251,7 @@
220251
- '(result["diff"][0]["deleted"] | length) == 4'
221252
- '(result["diff"][0]["replaced"] | length) != 0'
222253
- '(result["diff"][0]["overridden"] | length) == 0'
223-
- '(result["diff"][0]["deploy"] | length) != 0'
254+
- '(result["diff"][0]["deploy"] | length) == 0'
224255

225256
- assert:
226257
that:
@@ -231,25 +262,41 @@
231262
## MERGE ##
232263
##############################################
233264

265+
- name: Put Parent Interface for Sub-Interface into routed mode
266+
cisco.dcnm.dcnm_interface:
267+
check_deploy: False
268+
fabric: "{{ ansible_it_fabric }}"
269+
state: merged # only choose form [merged, replaced, deleted, overridden, query]
270+
config:
271+
- name: "{{ ansible_parent_intf1 }}" # should be of the form eth<port-id>
272+
type: eth # choose from this list [pc, vpc, sub_int, lo, eth, svi]
273+
switch:
274+
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
275+
deploy: false # choose from [true, false]
276+
profile:
277+
admin_state: true # choose from [true, false]
278+
mode: routed # choose from [trunk, access, routed, monitor, epl_routed]
279+
description: "Parent Interface for Sub-Interface test"
280+
234281
- name: Create all interfaces to check delete form 3
235282
cisco.dcnm.dcnm_interface:
236-
check_deploy: True
283+
check_deploy: False
237284
fabric: "{{ ansible_it_fabric }}"
238285
state: merged # only choose form [merged, replaced, deleted, overridden, query]
239286
config:
240287
- name: po333 # should be of the form po<port-id>
241288
type: pc # choose from this list [pc, vpc, sub_int, lo, eth, svi]
242289
switch:
243290
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
244-
deploy: true # choose from [true, false]
291+
deploy: false # choose from [true, false]
245292
profile:
246293
mode: trunk # choose from [trunk, access, l3, monitor]
247294

248295
- name: "{{ ansible_sub_intf1 }}" # should be of the form eth<port-num>.<port-id>
249296
type: sub_int # choose from this list [pc, vpc, sub_int, lo, eth, svi]
250297
switch:
251298
- "{{ ansible_switch1 }}" # provide the switch information where the config is to be deployed
252-
deploy: true # choose from [true, false]
299+
deploy: false # choose from [true, false]
253300
profile:
254301
mode: subint # choose from [subint]
255302
vlan: 100 # vlan ID [min:2, max:3967]
@@ -260,7 +307,7 @@
260307
type: lo # choose from this list [pc, vpc, sub_int, lo, eth, svi]
261308
switch:
262309
- "{{ ansible_switch1 }}" # provide the switch where to deploy the config
263-
deploy: true # choose from [true, false]
310+
deploy: false # choose from [true, false]
264311
profile:
265312
mode: lo # choose from [lo]
266313
ipv4_addr: 193.168.2.1 # ipv4 address for the loopback interface
@@ -270,7 +317,7 @@
270317
switch: # provide switches of vPC pair
271318
- "{{ ansible_switch1 }}"
272319
- "{{ ansible_switch2 }}"
273-
deploy: true # choose from [true, false]
320+
deploy: false # choose from [true, false]
274321
profile:
275322
admin_state: true # choose from [true, false]
276323
mode: trunk # choose from [trunk, access]
@@ -297,7 +344,7 @@
297344
- '(result["diff"][0]["deleted"] | length) == 0'
298345
- '(result["diff"][0]["replaced"] | length) == 0'
299346
- '(result["diff"][0]["overridden"] | length) == 0'
300-
- '(result["diff"][0]["deploy"] | length) == 4'
347+
- '(result["diff"][0]["deploy"] | length) == 0'
301348

302349
- assert:
303350
that:
@@ -310,7 +357,7 @@
310357

311358
- name: Delete all interfaces form 3
312359
cisco.dcnm.dcnm_interface:
313-
check_deploy: True
360+
check_deploy: False
314361
fabric: "{{ ansible_it_fabric }}"
315362
state: deleted # only choose form [merged, replaced, deleted, overridden,query]
316363
config:
@@ -351,7 +398,7 @@
351398

352399
- name: Put fabric to default state
353400
cisco.dcnm.dcnm_interface:
354-
check_deploy: True
401+
check_deploy: False
355402
fabric: "{{ ansible_it_fabric }}"
356403
state: overridden # only choose form [merged, replaced, deleted, overridden, query]
357404
register: result
@@ -361,4 +408,4 @@
361408
that:
362409
- 'item["RETURN_CODE"] == 200'
363410
loop: '{{ result.response }}'
364-
when: IT_CONTEXT is not defined
411+
when: IT_CONTEXT is not defined

0 commit comments

Comments
 (0)