Skip to content

Commit 050b122

Browse files
authored
DCNM_VRF: L3 VNI W/O VLAN IT Tests & Documentation (#481)
* Add L3VNI w/o VLAN option support for dcnm_vrf module, issue #337 * Adding IT Tests for L3VNI W/O VLAN * Documentation Updates * Fix TC Names * Fix TC Names * Fix Inconsitencies * Optimize L3VNI W/O VLAN TCs - Prevent Deployment of VRFs --------- Co-authored-by: = <=>
1 parent 4530996 commit 050b122

File tree

8 files changed

+809
-175
lines changed

8 files changed

+809
-175
lines changed

docs/cisco.dcnm.dcnm_vrf_module.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,26 @@ Parameters
555555
<div>Enable IPv6 link-local Option</div>
556556
</td>
557557
</tr>
558+
<tr>
559+
<td class="elbow-placeholder"></td>
560+
<td colspan="4">
561+
<div class="ansibleOptionAnchor" id="parameter-"></div>
562+
<b>l3vni_wo_vlan</b>
563+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
564+
<div style="font-size: small">
565+
<span style="color: purple">boolean</span>
566+
</div>
567+
</td>
568+
<td>
569+
<ul style="margin: 0; padding: 0"><b>Choices:</b>
570+
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
571+
<li>yes</li>
572+
</ul>
573+
</td>
574+
<td>
575+
<div>Enable L3 VNI without VLAN</div>
576+
</td>
577+
</tr>
558578
<tr>
559579
<td class="elbow-placeholder"></td>
560580
<td colspan="4">

plugins/modules/dcnm_vrf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@
134134
type: bool
135135
required: false
136136
default: true
137+
l3vni_wo_vlan:
138+
description:
139+
- Enable L3 VNI without VLAN
140+
type: bool
141+
required: false
142+
default: false
137143
trm_enable:
138144
description:
139145
- Enable Tenant Routed Multicast

tests/integration/targets/dcnm_vrf/tests/dcnm/deleted.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,87 @@
158158
- 'result_1c.response|length == 0'
159159
- 'result_1c.diff|length == 0'
160160

161+
- name: TEST.1e - DELETED - [merged] Create, Attach VRF ansible-vrf (L3VNI W/O VLAN)
162+
cisco.dcnm.dcnm_vrf:
163+
fabric: "{{ fabric_1 }}"
164+
state: merged
165+
config:
166+
- vrf_name: ansible-vrf-int1
167+
vrf_id: 9008011
168+
vrf_template: Default_VRF_Universal
169+
vrf_extension_template: Default_VRF_Extension_Universal
170+
l3vni_wo_vlan: true
171+
attach:
172+
- ip_address: "{{ switch_1 }}"
173+
- ip_address: "{{ switch_2 }}"
174+
deploy: false
175+
register: result_1e
176+
177+
- name: TEST.1f - DELETED - [query] query VRF state
178+
cisco.dcnm.dcnm_vrf:
179+
fabric: "{{ fabric_1 }}"
180+
state: query
181+
register: result_1f
182+
183+
- name: TEST.1g - DELETED - [debug] print result_1e
184+
debug:
185+
var: result_1e
186+
187+
- assert:
188+
that:
189+
- 'result_1e.changed == true'
190+
- 'result_1e.response[0].RETURN_CODE == 200'
191+
- 'result_1e.response[1].RETURN_CODE == 200'
192+
- '(result_1e.response[1].DATA|dict2items)[0].value == "SUCCESS"'
193+
- '(result_1e.response[1].DATA|dict2items)[1].value == "SUCCESS"'
194+
- '"{{ switch_1 }}" in result_1e.diff[0].attach[0].ip_address or "{{ switch_1 }}" in result_1e.diff[0].attach[1].ip_address'
195+
- '"{{ switch_2 }}" in result_1e.diff[0].attach[0].ip_address or "{{ switch_2 }}" in result_1e.diff[0].attach[1].ip_address'
196+
- 'result_1e.diff[0].vrf_name == "ansible-vrf-int1"'
197+
- '"enableL3VniNoVlan\":\"true\"" in result_1f.response[0].parent.vrfTemplateConfig'
198+
199+
- name: TEST.1h - DELETED - [deleted] Delete VRF ansible-vrf-int1
200+
cisco.dcnm.dcnm_vrf: &conf1h
201+
fabric: "{{ fabric_1 }}"
202+
state: deleted
203+
config:
204+
- vrf_name: ansible-vrf-int1
205+
vrf_id: 9008011
206+
vrf_template: Default_VRF_Universal
207+
vrf_extension_template: Default_VRF_Extension_Universal
208+
register: result_1h
209+
210+
- name: TEST.1j - DELETED - [debug] print result_1
211+
debug:
212+
var: result_1h
213+
214+
- assert:
215+
that:
216+
- 'result_1h.changed == true'
217+
- 'result_1h.response[0].RETURN_CODE == 200'
218+
- 'result_1h.response[1].RETURN_CODE == 200'
219+
- 'result_1h.response[1].MESSAGE == "OK"'
220+
- 'result_1h.response[2].RETURN_CODE == 200'
221+
- 'result_1h.response[2].METHOD == "DELETE"'
222+
- '(result_1h.response[0].DATA|dict2items)[0].value == "SUCCESS"'
223+
- '(result_1h.response[0].DATA|dict2items)[1].value == "SUCCESS"'
224+
- 'result_1h.diff[0].attach[0].deploy == false'
225+
- 'result_1h.diff[0].attach[1].deploy == false'
226+
- 'result_1h.diff[0].vrf_name == "ansible-vrf-int1"'
227+
228+
- name: TEST.1k - DELETED - [deleted] conf1h - Idempotence
229+
cisco.dcnm.dcnm_vrf: *conf1h
230+
register: result_1k
231+
232+
- name: TEST.1l - DELETED - [debug] print result_1k
233+
debug:
234+
var: result_1k
235+
236+
- assert:
237+
that:
238+
- 'result_1k.changed == false'
239+
- 'result_1k.response|length == 0'
240+
- 'result_1k.diff|length == 0'
241+
161242
- name: TEST.2 - DELETED - [merged] Create, Attach, Deploy VLAN+VRF+LITE ansible-vrf-int1 switch_2
162243
cisco.dcnm.dcnm_vrf:
163244
fabric: "{{ fabric_1 }}"

0 commit comments

Comments
 (0)