2 Documentation Test Suite for ITM
3 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
5 Test Teardown Get Model Dump ${ODL_SYSTEM_IP} ${bfd_data_models}
6 Library OperatingSystem
8 Library RequestsLibrary
9 Variables ../../variables/Variables.py
10 Variables ../../variables/genius/Modules.py
11 Resource ../../libraries/DataModels.robot
13 Resource ../../libraries/Utils.robot
14 Resource ../../libraries/CompareStream.robot
19 ${genius_config_dir} ${CURDIR}/../../variables/genius
24 Create and Verify VTEP -No Vlan
25 [Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs without VLAN and Gateway configured in Json.
26 ${Dpn_id_1} Get Dpn Ids ${conn_id_1}
27 ${Dpn_id_2} Get Dpn Ids ${conn_id_2}
28 Set Global Variable ${Dpn_id_1}
29 Set Global Variable ${Dpn_id_2}
30 ${vlan}= Set Variable 0
31 ${gateway-ip}= Set Variable 0.0.0.0
32 Create Vteps ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
33 Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet} ${vlan}
34 ... ${Dpn_id_1} ${TOOLS_SYSTEM_IP} ${Dpn_id_2} ${TOOLS_SYSTEM_2_IP}
35 ${type} set variable odl-interface:tunnel-type-vxlan
36 ${tunnel-1} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_1} ${Dpn_id_2}
38 Set Global Variable ${tunnel-1}
39 ${tunnel-2} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
41 Set Global Variable ${tunnel-2}
42 ${tunnel-type}= Set Variable type: vxlan
43 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
44 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
45 Log >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
46 Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_1} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP}
47 ... ${tunnel-1} ${tunnel-type}
48 Log >>>>OVS Validation in Switch 2 for Tunnel Created<<<<<
49 Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_2} ${TOOLS_SYSTEM_2_IP} ${TOOLS_SYSTEM_IP}
50 ... ${tunnel-2} ${tunnel-type}
51 Log >>>> Getting Network Topology Operational <<<<<<
52 ${resp} Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${Bridge-1} ${Bridge-2}
53 ... ${tunnel-1} ${tunnel-2} ${OPERATIONAL_TOPO_API}
54 Log >>>>Validating Interface 1 & 2 states<<<<
55 ${return} Validate interface state ${tunnel-1} ${Dpn_id_1} ${tunnel-2} ${Dpn_id_2}
57 ${lower-layer-if-1} Get from List ${return} 0
58 ${port-num-1} Get From List ${return} 1
59 ${lower-layer-if-2} Get from List ${return} 2
60 ${port-num-2} Get From List ${return} 3
61 Log >>>>>Verify Oper data base of Interface state<<<<<
62 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/
63 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
65 Should Be Equal As Strings ${resp.status_code} 200
66 Should Contain ${resp.content} ${Dpn_id_1} ${tunnel-1}
67 Should Contain ${resp.content} ${Dpn_id_2} ${tunnel-2}
68 Log >>>>> Checking Entry in table 0 on OVS 1<<<<<
69 ${check-3} Wait Until Keyword Succeeds 40 10 Check Table0 Entry for 2 Dpn ${conn_id_1} ${Bridge-1}
71 Log >>>>> Checking Entry in table 0 on OVS 2<<<<<
72 ${check-4} Wait Until Keyword Succeeds 40 10 Check Table0 Entry for 2 Dpn ${conn_id_2} ${Bridge-2}
74 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/opendaylight-inventory:nodes/
75 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
77 Should Be Equal As Strings ${resp.status_code} 200
78 Should Contain ${resp.content} ${lower-layer-if-1} ${lower-layer-if-2}
80 Delete and Verify VTEP -No Vlan
81 [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns.
82 Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
83 Wait Until Keyword Succeeds 40 10 Verify Data Base after Delete ${Dpn_id_1} ${Dpn_id_2} ${tunnel-1}
86 Create and Verify VTEP IPv6 - No Vlan
87 [Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs without VLAN and Gateway configured in Json.
88 Pass Execution If "${ODL_STREAM}" == "boron" IPV6 support is not available in boron or before
89 ${Dpn_id_1} Get Dpn Ids ${conn_id_1}
90 ${Dpn_id_2} Get Dpn Ids ${conn_id_2}
91 Set Global Variable ${Dpn_id_1}
92 Set Global Variable ${Dpn_id_2}
93 ${vlan}= Set Variable 0
94 ${gateway-ip}= Set Variable ::
95 ${TOOLS_SYSTEM_IP} Set Variable fd96:2a25:4ad3:3c7d:0:0:0:1000
96 ${TOOLS_SYSTEM_2_IP} Set Variable fd96:2a25:4ad3:3c7d:0:0:0:2000
97 Create Vteps IPv6 ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
98 Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet} ${vlan}
99 ... ${Dpn_id_1} ${TOOLS_SYSTEM_IP} ${Dpn_id_2} ${TOOLS_SYSTEM_2_IP}
100 ${type} set variable odl-interface:tunnel-type-vxlan
101 ${tunnel-1} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_1} ${Dpn_id_2}
103 Set Global Variable ${tunnel-1}
104 ${tunnel-2} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
106 Set Global Variable ${tunnel-2}
107 ${tunnel-type}= Set Variable type: vxlan
108 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/ headers=${ACCEPT_XML}
109 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/ headers=${ACCEPT_XML}
110 Log >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
111 Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_1} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP}
112 ... ${tunnel-1} ${tunnel-type}
113 Log >>>>OVS Validation in Switch 2 for Tunnel Created<<<<<
114 Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_2} ${TOOLS_SYSTEM_2_IP} ${TOOLS_SYSTEM_IP}
115 ... ${tunnel-2} ${tunnel-type}
116 Log >>>> Getting Network Topology Operational <<<<<<
117 ${resp} Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${Bridge-1} ${Bridge-2}
118 ... ${tunnel-1} ${tunnel-2} ${OPERATIONAL_TOPO_API}
120 Delete and Verify VTEP IPv6 -No Vlan
121 [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns.
122 Pass Execution If "${ODL_STREAM}" == "boron" IPV6 support is not available in boron or before
123 Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
124 Wait Until Keyword Succeeds 40 10 Verify Data Base after Delete ${Dpn_id_1} ${Dpn_id_2} ${tunnel-1}
127 Create and Verify VTEP-Vlan
128 [Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs with VLAN and \ without Gateway configured in Json.
129 ${vlan}= Set Variable 100
130 ${gateway-ip}= Set Variable 0.0.0.0
131 Create Vteps ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
132 ${get} Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet}
133 ... ${vlan} ${Dpn_id_1} ${TOOLS_SYSTEM_IP} ${Dpn_id_2} ${TOOLS_SYSTEM_2_IP}
135 ${type} set variable odl-interface:tunnel-type-vxlan
136 ${tunnel-3} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_1} ${Dpn_id_2}
139 Set Global Variable ${tunnel-3}
140 ${tunnel-4} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
143 Set Global Variable ${tunnel-4}
144 ${tunnel-type}= Set Variable type: vxlan
145 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
146 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
147 Log >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
148 Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_1} ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP}
149 ... ${tunnel-3} ${tunnel-type}
150 Log >>>>OVS Validation in Switch 2 for Tunnel Created<<<<<
151 Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_2} ${TOOLS_SYSTEM_2_IP} ${TOOLS_SYSTEM_IP}
152 ... ${tunnel-4} ${tunnel-type}
153 Log >>>>> Checking Network opertional Topology <<<<<<
154 ${url_2} set variable ${OPERATIONAL_API}/network-topology:network-topology/
155 Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${Bridge-1} ${Bridge-2} ${tunnel-3}
156 ... ${tunnel-4} ${url_2}
157 ${return} Validate interface state ${tunnel-3} ${Dpn_id_1} ${tunnel-4} ${Dpn_id_2}
159 ${lower-layer-if-1} Get from List ${return} 0
160 ${port-num-1} Get From List ${return} 1
161 ${lower-layer-if-2} Get from List ${return} 2
162 ${port-num-2} Get From List ${return} 3
163 Log >>>>>Verify Oper data base of Interface state<<<<<
164 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/
165 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
167 Should Contain ${resp.content} ${Dpn_id_1} ${tunnel-3}
168 Should Contain ${resp.content} ${Dpn_id_2} ${tunnel-4}
169 Log >>>>> Checking Entry in table 0 on OVS 1<<<<<
170 Wait Until Keyword Succeeds 40 10 Check Table0 Entry for 2 Dpn ${conn_id_1} ${Bridge-1} ${port-num-1}
171 Log >>>>> Checking Entry in table 0 on OVS \ 2<<<<<
172 Wait Until Keyword Succeeds 40 10 Check Table0 Entry for 2 Dpn ${conn_id_2} ${Bridge-2} ${port-num-2}
173 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/opendaylight-inventory:nodes/
174 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
176 Should Be Equal As Strings ${resp.status_code} 200
177 Should Contain ${resp.content} ${lower-layer-if-2} ${lower-layer-if-1}
179 Delete and Verify VTEP -Vlan
180 [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns.
181 Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
182 Wait Until Keyword Succeeds 40 10 Verify Data Base after Delete ${Dpn_id_1} ${Dpn_id_2} ${tunnel-3}
185 Create VTEP - Vlan and Gateway
186 [Documentation] This testcase creates a Internal Transport Manager - ITM tunnel between 2 DPNs with VLAN and Gateway configured in Json.
187 ${vlan}= Set Variable 101
188 ${substr} Should Match Regexp ${TOOLS_SYSTEM_IP} [0-9]\{1,3}\.[0-9]\{1,3}\.[0-9]\{1,3}\.
189 ${subnet} Catenate ${substr}0
190 ${gateway-ip} Catenate ${substr}1
192 Create Vteps ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
193 Wait Until Keyword Succeeds 40 10 Get ITM ${itm_created[0]} ${subnet} ${vlan}
194 ... ${Dpn_id_1} ${TOOLS_SYSTEM_IP} ${Dpn_id_2} ${TOOLS_SYSTEM_2_IP}
195 ${type} set variable odl-interface:tunnel-type-vxlan
196 ${tunnel-5} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_1} ${Dpn_id_2}
199 Set Global Variable ${tunnel-5}
200 ${tunnel-6} Wait Until Keyword Succeeds 40 10 Get Tunnel ${Dpn_id_2} ${Dpn_id_1}
203 Set Global Variable ${tunnel-6}
204 ${tunnel-type}= Set Variable type: vxlan
205 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
206 Wait Until Keyword Succeeds 40 5 Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
207 Log >>>>OVS Validation in Switch 1 for Tunnel Created<<<<<
208 ${check-1} Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_1} ${TOOLS_SYSTEM_IP}
209 ... ${TOOLS_SYSTEM_2_IP} ${tunnel-5} ${tunnel-type}
211 ${check-2} Wait Until Keyword Succeeds 40 10 Ovs Verification 2 Dpn ${conn_id_2} ${TOOLS_SYSTEM_2_IP}
212 ... ${TOOLS_SYSTEM_IP} ${tunnel-6} ${tunnel-type}
214 ${resp} Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${Bridge-1} ${Bridge-2}
215 ... ${tunnel-5} ${tunnel-6} ${OPERATIONAL_TOPO_API}
217 ${return} Validate interface state ${tunnel-5} ${Dpn_id_1} ${tunnel-6} ${Dpn_id_2}
219 ${lower-layer-if-1} Get from List ${return} 0
220 ${port-num-1} Get From List ${return} 1
221 ${lower-layer-if-2} Get from List ${return} 2
222 ${port-num-2} Get From List ${return} 3
223 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/
224 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
226 Should Contain ${resp.content} ${Dpn_id_1} ${tunnel-5}
227 Should Contain ${resp.content} ${Dpn_id_2} ${tunnel-6}
228 ${check-3} Wait Until Keyword Succeeds 40 10 Check Table0 Entry for 2 Dpn ${conn_id_1} ${Bridge-1}
231 ${check-4} Wait Until Keyword Succeeds 40 10 Check Table0 Entry for 2 Dpn ${conn_id_2} ${Bridge-2}
234 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/opendaylight-inventory:nodes/
235 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
237 Should Be Equal As Strings ${resp.status_code} 200
238 Should Contain ${resp.content} ${lower-layer-if-2} ${lower-layer-if-1}
240 Delete VTEP -Vlan and gateway
241 [Documentation] This testcase deletes the ITM tunnel created between 2 dpns.
242 Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/
243 Wait Until Keyword Succeeds 40 10 Verify Data Base after Delete ${Dpn_id_1} ${Dpn_id_2} ${tunnel-5}
248 [Arguments] ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
249 [Documentation] This keyword creates VTEPs between ${TOOLS_SYSTEM_IP} and ${TOOLS_SYSTEM_2_IP}
250 ${body} OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan.json
251 ${substr} Should Match Regexp ${TOOLS_SYSTEM_IP} [0-9]\{1,3}\.[0-9]\{1,3}\.[0-9]\{1,3}\.
252 ${subnet} Catenate ${substr}0
254 Set Global Variable ${subnet}
255 ${vlan}= Set Variable ${vlan}
256 ${gateway-ip}= Set Variable ${gateway-ip}
257 ${body} set json ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip} ${subnet}
258 Post Log Check ${CONFIG_API}/itm:transport-zones/ ${body} 204
261 [Arguments] ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip}
262 [Documentation] This keyword creates VTEPs between ${TOOLS_SYSTEM_IP} and ${TOOLS_SYSTEM_2_IP}
263 ${body} OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan.json
264 ${substr} Should Match Regexp ${TOOLS_SYSTEM_IP} [0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:[0-9a-fA-F]{1,4}:
265 ${subnet} Catenate ${substr}0
267 Set Global Variable ${subnet}
268 ${vlan}= Set Variable ${vlan}
269 ${gateway-ip}= Set Variable ${gateway-ip}
270 ${body} set json ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip} ${subnet}
271 Post Log Check ${CONFIG_API}/itm:transport-zones/ ${body} 204
274 [Arguments] ${connection_id}
275 [Documentation] This keyword gets the DPN id of the switch after configuring bridges on it.It returns the captured DPN id.
276 Switch connection ${connection_id}
277 ${cmd} set Variable sudo ovs-vsctl show | grep Bridge | awk -F "\\"" '{print $2}'
278 ${Bridgename1} Execute command ${cmd}
280 ${output1} Execute command sudo ovs-ofctl show -O Openflow13 ${Bridgename1} | head -1 | awk -F "dpid:" '{ print $2 }'
282 ${Dpn_id} Execute command echo \$\(\(16\#${output1}\)\)
287 [Arguments] ${src} ${dst} ${type}
288 [Documentation] This Keyword Gets the Tunnel /Interface name which has been created between 2 DPNS by passing source , destination DPN Ids along with the type of tunnel which is configured.
289 ${resp} RequestsLibrary.Get Request session ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${src}/${dst}/${type}/
290 Log ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${src}/${dst}/
291 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
293 Should Be Equal As Strings ${resp.status_code} 200
294 Should Contain ${resp.content} ${src} ${dst} TUNNEL:
295 ${json}= evaluate json.loads('''${resp.content}''') json
296 log to console \nOriginal JSON:\n${json}
297 ${expected_tunnel_interface_name} = Set_Variable_If_At_Least_Carbon tunnel-interface-names tunnel-interface-name
298 ${Tunnels} Collections.Get From Dictionary ${json["internal-tunnel"][0]} ${expected_tunnel_interface_name}
299 Log To Console ${Tunnels}
301 ${tunnel_interface} = Set_Variable_If_At_Least_Carbon ${Tunnels[0]} ${Tunnels}
302 [Return] ${tunnel_interface}
304 Validate interface state
305 [Arguments] ${tunnel-1} ${dpid-1} ${tunnel-2} ${dpid-2}
306 [Documentation] Validates the created Interface Tunnel by checking its Operational status as UP/DOWN from the dump.
307 Log ${tunnel-1},${dpid-1},${tunnel-2},${dpid-2}
308 ${data1-2} Wait Until Keyword Succeeds 40 10 Check Interface status ${tunnel-1} ${dpid-1}
309 ${data2-1} Wait Until Keyword Succeeds 40 10 Check Interface status ${tunnel-2} ${dpid-2}
310 @{data} combine lists ${data1-2} ${data2-1}
314 Check Table0 Entry for 2 Dpn
315 [Arguments] ${connection_id} ${Bridgename} ${port-num1}
316 [Documentation] Checks the Table 0 entry in the OVS when flows are dumped.
317 Switch Connection ${connection_id}
319 ${check} Execute Command sudo ovs-ofctl -O OpenFlow13 dump-flows ${Bridgename}
321 Should Contain ${check} in_port=${port-num1}
324 Ovs Verification 2 Dpn
325 [Arguments] ${connection_id} ${local} ${remote-1} ${tunnel} ${tunnel-type}
326 [Documentation] Checks whether the created Interface is seen on OVS or not.
327 Switch Connection ${connection_id}
329 ${check} Execute Command sudo ovs-vsctl show
331 Should Contain ${check} local_ip="${local}" remote_ip="${remote-1}" ${tunnel}
332 Should Contain ${check} ${tunnel-type}
336 [Arguments] ${itm_created[0]} ${subnet} ${vlan} ${Dpn_id_1} ${TOOLS_SYSTEM_IP} ${Dpn_id_2}
337 ... ${TOOLS_SYSTEM_2_IP}
338 [Documentation] It returns the created ITM Transport zone with the passed values during the creation is done.
339 Log ${itm_created[0]},${subnet}, ${vlan}, ${Dpn_id_1},${TOOLS_SYSTEM_IP}, ${Dpn_id_2}, ${TOOLS_SYSTEM_2_IP}
340 @{Itm-no-vlan} Create List ${itm_created[0]} ${subnet} ${vlan} ${Dpn_id_1} ${Bridge-1}-eth1
341 ... ${TOOLS_SYSTEM_IP} ${Dpn_id_2} ${Bridge-2}-eth1 ${TOOLS_SYSTEM_2_IP}
342 Check For Elements At URI ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]} ${Itm-no-vlan}
344 Get Network Topology with Tunnel
345 [Arguments] ${Bridge-1} ${Bridge-2} ${tunnel-1} ${tunnel-2} ${url}
346 [Documentation] Returns the Network topology with Tunnel info in it.
347 @{bridges} Create List ${Bridge-1} ${Bridge-2} ${tunnel-1} ${tunnel-2}
348 Check For Elements At URI ${url} ${bridges}
350 Get Network Topology without Tunnel
351 [Arguments] ${url} ${tunnel-1} ${tunnel-2}
352 [Documentation] Returns the Network Topology after Deleting of ITM transport zone is done , which wont be having any TUNNEL info in it.
353 @{tunnels} create list ${tunnel-1} ${tunnel-2}
354 Check For Elements Not At URI ${url} ${tunnels}
356 Validate interface state Delete
357 [Arguments] ${tunnel}
358 [Documentation] Check for the Tunnel / Interface absence in OPERATIONAL data base of IETF interface after ITM transport zone is deleted.
360 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${tunnel}/
361 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
363 Should Be Equal As Strings ${resp.status_code} 404
364 Should not contain ${resp.content} ${tunnel}
367 [Arguments] ${TOOLS_SYSTEM_IP} ${TOOLS_SYSTEM_2_IP} ${vlan} ${gateway-ip} ${subnet}
368 [Documentation] Sets Json with the values passed for it.
369 ${body} OperatingSystem.Get File ${genius_config_dir}/Itm_creation_no_vlan.json
370 ${body} replace string ${body} 1.1.1.1 ${subnet}
371 ${body} replace string ${body} "dpn-id": 101 "dpn-id": ${Dpn_id_1}
372 ${body} replace string ${body} "dpn-id": 102 "dpn-id": ${Dpn_id_2}
373 ${body} replace string ${body} "ip-address": "2.2.2.2" "ip-address": "${TOOLS_SYSTEM_IP}"
374 ${body} replace string ${body} "ip-address": "3.3.3.3" "ip-address": "${TOOLS_SYSTEM_2_IP}"
375 ${body} replace string ${body} "vlan-id": 0 "vlan-id": ${vlan}
376 ${body} replace string ${body} "gateway-ip": "0.0.0.0" "gateway-ip": "${gateway-ip}"
378 [Return] ${body} # returns complete json that has been updated
380 check-Tunnel-delete-on-ovs
381 [Arguments] ${connection-id} ${tunnel}
382 [Documentation] Verifies the Tunnel is deleted from OVS
384 Switch Connection ${connection-id}
386 ${return} Execute Command sudo ovs-vsctl show
388 Should Not Contain ${return} ${tunnel}
391 check interface status
392 [Arguments] ${tunnel} ${dpid}
393 [Documentation] Verifies the operational state of the interface .
394 ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${tunnel}/
395 Log ${OPERATIONAL_API}/ietf-interfaces:interfaces-state/interface/${tunnel}/
396 ${respjson} RequestsLibrary.To Json ${resp.content} pretty_print=True
398 Should Be Equal As Strings ${resp.status_code} 200
399 Should not contain ${resp.content} down
400 Should Contain ${resp.content} ${tunnel} up up
401 ${result-1} re.sub <.*?> , ${resp.content}
403 ${lower_layer_if} Should Match Regexp ${result-1} openflow:${dpid}:[0-9]+
404 log ${lower_layer_if}
405 @{resp_array} Split String ${lower_layer_if} :
406 ${port-num} Get From List ${resp_array} 2
408 [Return] ${lower_layer_if} ${port-num}
410 Verify Data Base after Delete
411 [Arguments] ${Dpn_id_1} ${Dpn_id_2} ${tunnel-1} ${tunnel-2}
412 [Documentation] Verifies the config database after the Tunnel deletion is done.
413 ${type} set variable odl-interface:tunnel-type-vxlan
414 No Content From URI session ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${Dpn_id_1}/${Dpn_id_2}/${type}/
415 No Content From URI session ${CONFIG_API}/itm-state:tunnel-list/internal-tunnel/${Dpn_id_2}/${Dpn_id_1}/${type}/
416 No Content From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_1}/
417 No Content From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${Dpn_id_2}/
418 ${resp_7} RequestsLibrary.Get Request session ${CONFIG_API}/ietf-interfaces:interfaces/
419 Run Keyword if '${resp_7.content}'=='404' Response is 404
420 Run Keyword if '${resp_7.content}'=='200' Response is 200
421 ${resp_8} Wait Until Keyword Succeeds 40 10 Get Network Topology without Tunnel ${CONFIG_TOPO_API} ${tunnel-1}
424 ${Ovs-del-1} Wait Until Keyword Succeeds 40 10 check-Tunnel-delete-on-ovs ${conn_id_1} ${tunnel-1}
426 ${Ovs-del-2} Wait Until Keyword Succeeds 40 10 check-Tunnel-delete-on-ovs ${conn_id_2} ${tunnel-2}
428 Log >>>>>>> Getting Network Topology Config without Tunnels<<<<<<<
429 Wait Until Keyword Succeeds 40 10 Get Network Topology without Tunnel ${OPERATIONAL_TOPO_API} ${tunnel-1} ${tunnel-2}
430 Wait Until Keyword Succeeds 40 10 Validate interface state Delete ${tunnel-1}
431 Wait Until Keyword Succeeds 40 10 Validate interface state Delete ${tunnel-2}