Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 080_Underlay_item_removal.robot
1 *** Settings ***
2 Documentation       Test suite to verify processing of removal requests on different models.
3 ...                 Before tests start, configurational files have to be rewriten to change listeners registration datastore type from CONFIG_API to OPERATIONAL_API.
4 ...                 Need for this change is also a reason why main feature (odl-topoprocessing-framework) is installed after file change and not during boot.
5 ...                 Suite setup also installs features required for tested models and clears karaf logs for further synchronization. Tests themselves send configurational
6 ...                 xmls and verify output. Topology-id on the end of each url must match topology-id from xml. Yang models of components in topology are defined in xmls.
7
8 Library             RequestsLibrary
9 Library             SSHLibrary
10 Library             XML
11 Variables           ../../../variables/topoprocessing/TopologyRequests.py
12 Variables           ../../../variables/topoprocessing/TargetFields.py
13 Variables           ../../../variables/Variables.py
14 Resource            ../../../libraries/KarafKeywords.robot
15 Resource            ../../../libraries/Utils.robot
16 Resource            ../../../libraries/TopoprocessingKeywords.robot
17
18 Suite Setup         Setup Environment
19 Suite Teardown      Clean Environment
20 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
21 Test Teardown       Refresh Underlay Topologies And Delete Overlay Topology
22
23
24 *** Test Cases ***
25 Unification Node Removal NT
26     [Documentation]    Test processing of node removal using unification operation on Network Topology model
27     ${model}    Set Variable    network-topology-model
28     #Create the original topology
29     ${request}    Prepare Unification Topology Request
30     ...    ${UNIFICATION_NT}
31     ...    network-topology-model
32     ...    node
33     ...    network-topo:1
34     ...    network-topo:2
35     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
36     ${request}    Insert Target Field    ${request}    1    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
37     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
38     ${resp}    Wait Until Keyword Succeeds
39     ...    3x
40     ...    1s
41     ...    Output Topo Should Be Complete
42     ...    node_count=8
43     ...    supporting-node_count=10
44     ...    node-ref_count=10
45     #Remove an underlay aggregated node, preserving the overlay node
46     Delete Underlay Node    network-topo:1    bgp:3
47     ${resp}    Wait Until Keyword Succeeds
48     ...    3x
49     ...    1s
50     ...    Output Topo Should Be Complete
51     ...    node_count=8
52     ...    supporting-node_count=9
53     ...    node-ref_count=9
54     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:4
55     #Remove an underlay aggregated node, expecting removal of the overlay node
56     Delete Underlay Node    network-topo:1    bgp:4
57     ${resp}    Wait Until Keyword Succeeds
58     ...    3x
59     ...    1s
60     ...    Output Topo Should Be Complete
61     ...    node_count=7
62     ...    supporting-node_count=8
63     ...    node-ref_count=8
64
65 Unification Node Removal Inventory
66     [Documentation]    Test processing of node removal using unification operation on Inventory model
67     ${model}    Set Variable    opendaylight-inventory-model
68     #Create the original topology
69     ${request}    Prepare Unification Topology Request
70     ...    ${UNIFICATION_NT}
71     ...    ${model}
72     ...    node
73     ...    openflow-topo:1
74     ...    openflow-topo:2
75     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_IP_ADDRESS}    0
76     ${request}    Insert Target Field    ${request}    1    ${OPENFLOW_NODE_IP_ADDRESS}    0
77     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
78     ${resp}    Wait Until Keyword Succeeds
79     ...    3x
80     ...    1s
81     ...    Output Topo Should Be Complete
82     ...    node_count=7
83     ...    supporting-node_count=10
84     ...    node-ref_count=10
85     #Remove an underlay aggregated node, preserving the overlay node
86     Delete Underlay Node    openflow-topo:2    of-node:6
87     ${resp}    Wait Until Keyword Succeeds
88     ...    3x
89     ...    1s
90     ...    Output Topo Should Be Complete
91     ...    node_count=7
92     ...    supporting-node_count=9
93     ...    node-ref_count=9
94     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    of-node:1
95     #Remove an underlay aggregated node, expecting removal of the overlay node
96     Delete Underlay Node    openflow-topo:1    of-node:1
97     ${resp}    Wait Until Keyword Succeeds
98     ...    3x
99     ...    1s
100     ...    Output Topo Should Be Complete
101     ...    node_count=6
102     ...    supporting-node_count=8
103     ...    node-ref_count=8
104
105 Filtration Range Number Node Removal NT
106     [Documentation]    Test processing of node removal using filtration operation on Network Topology model
107     ${model}    Set Variable    network-topology-model
108     #Create the original topology
109     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    ${model}    node    network-topo:2
110     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OVSDB_OVS_VERSION}
111     ${request}    Set Range Number Filter    ${request}    20    25
112     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
113     ${resp}    Wait Until Keyword Succeeds
114     ...    3x
115     ...    1s
116     ...    Output Topo Should Be Complete
117     ...    node_count=4
118     ...    supporting-node_count=4
119     ...    node-ref_count=4
120     ...    tp_count=5
121     ...    tp-ref_count=5
122     #Remove an underlay filtered node, expecting removal of the overlay node
123     Delete Underlay Node    network-topo:2    bgp:7
124     ${resp}    Wait Until Keyword Succeeds
125     ...    3x
126     ...    1s
127     ...    Output Topo Should Be Complete
128     ...    node_count=3
129     ...    supporting-node_count=3
130     ...    node-ref_count=3
131     ...    tp_count=3
132     ...    tp-ref_count=3
133
134 Filtration Range Number Node Removal Inventory
135     [Documentation]    Test processing of node removal using filtration operation on Inventory model
136     ${model}    Set Variable    opendaylight-inventory-model
137     #Create the original topology
138     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    ${model}    node    openflow-topo:2
139     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OPENFLOW_NODE_SERIAL_NUMBER}
140     ${request}    Set Range Number Filter    ${request}    20    25
141     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
142     ${resp}    Wait Until Keyword Succeeds
143     ...    3x
144     ...    1s
145     ...    Output Topo Should Be Complete
146     ...    node_count=3
147     ...    supporting-node_count=3
148     ...    node-ref_count=3
149     ...    tp_count=0
150     ...    tp-ref_count=0
151     #Remove an underlay filtered node, expecting removal of the overlay node
152     Delete Underlay Node    openflow-topo:2    of-node:8
153     ${resp}    Wait Until Keyword Succeeds
154     ...    3x
155     ...    1s
156     ...    Output Topo Should Be Complete
157     ...    node_count=2
158     ...    supporting-node_count=2
159     ...    node-ref_count=2
160     ...    tp_count=0
161     ...    tp-ref_count=0
162
163 Filtration Range Number Termination Point Removal NT
164     [Documentation]    Test processing of termination point removal using filtration operation on Network Topology model
165     ${model}    Set Variable    network-topology-model
166     #Create the original topology
167     ${request}    Prepare Filtration Topology Request
168     ...    ${FILTRATION_NT}
169     ...    ${model}
170     ...    termination-point
171     ...    network-topo:2
172     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OVSDB_OFPORT}
173     ${request}    Set Range Number Filter    ${request}    1115    1119
174     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
175     ${resp}    Wait Until Keyword Succeeds
176     ...    3x
177     ...    1s
178     ...    Output Topo Should Be Complete
179     ...    node_count=5
180     ...    supporting-node_count=5
181     ...    node-ref_count=5
182     ...    tp_count=3
183     ...    tp-ref_count=3
184     #Remove an underlay filtered termination point
185     Delete Underlay Termination Point    network-topo:2    bgp:7    tp:7:2
186     ${resp}    Wait Until Keyword Succeeds
187     ...    3x
188     ...    1s
189     ...    Output Topo Should Be Complete
190     ...    node_count=5
191     ...    supporting-node_count=5
192     ...    node-ref_count=5
193     ...    tp_count=2
194     ...    tp-ref_count=2
195     #Remove an underlay filtered termination point
196     Delete Underlay Termination Point    network-topo:2    bgp:7    tp:7:1
197     ${resp}    Wait Until Keyword Succeeds
198     ...    3x
199     ...    1s
200     ...    Output Topo Should Be Complete
201     ...    node_count=5
202     ...    supporting-node_count=5
203     ...    node-ref_count=5
204     ...    tp_count=1
205     ...    tp-ref_count=1
206
207 Filtration Range Number Termination Point Removal Inventory
208     [Documentation]    Test processing of termination point removal using filtration operation on Inventory model
209     ${model}    Set Variable    opendaylight-inventory-model
210     #Create the original topology
211     ${request}    Prepare Filtration Topology Request
212     ...    ${FILTRATION_NT}
213     ...    ${model}
214     ...    termination-point
215     ...    openflow-topo:1
216     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OPENFLOW_NODE_CONNECTOR_PORT_NUMBER}
217     ${request}    Set Range Number Filter    ${request}    2    4
218     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
219     ${resp}    Wait Until Keyword Succeeds
220     ...    3x
221     ...    1s
222     ...    Output Topo Should Be Complete
223     ...    node_count=5
224     ...    supporting-node_count=5
225     ...    node-ref_count=5
226     ...    tp_count=5
227     ...    tp-ref_count=5
228     #Remove an underlay filtered termination point
229     Delete Underlay Termination Point    openflow-topo:1    of-node:3    tp:3:2
230     ${resp}    Wait Until Keyword Succeeds
231     ...    3x
232     ...    1s
233     ...    Output Topo Should Be Complete
234     ...    node_count=5
235     ...    supporting-node_count=5
236     ...    node-ref_count=5
237     ...    tp_count=4
238     ...    tp-ref_count=4
239     #Remove an underlay filtered termination point
240     Delete Underlay Termination Point    openflow-topo:1    of-node:3    tp:3:1
241     ${resp}    Wait Until Keyword Succeeds
242     ...    3x
243     ...    1s
244     ...    Output Topo Should Be Complete
245     ...    node_count=5
246     ...    supporting-node_count=5
247     ...    node-ref_count=5
248     ...    tp_count=3
249     ...    tp-ref_count=3
250
251 Filtration Range Number Link Removal NT
252     [Documentation]    Test processing of link removal using filtration operation on NT model
253     #Create the original topology
254     ${request}    Prepare Filtration Topology Request
255     ...    ${FILTRATION_NT}
256     ...    network-topology-model
257     ...    link
258     ...    network-topo:1
259     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
260     ${request}    Set Range Number Filter    ${request}    11    13
261     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
262     ${resp}    Wait Until Keyword Succeeds
263     ...    3x
264     ...    1s
265     ...    Output Topo Should Be Complete
266     ...    link_count=3
267     ...    link-ref_count=3
268     #Remove an underlay filtered link, expecting removal of the overlay link
269     Delete Underlay Link    network-topo:1    link:1:3
270     ${resp}    Wait Until Keyword Succeeds
271     ...    3x
272     ...    1s
273     ...    Output Topo Should Be Complete
274     ...    link_count=2
275     ...    link-ref_count=2
276
277 Filtration Range Number Link Removal Inventory
278     [Documentation]    Test processing of link removal using filtration operation on Inventory model
279     #Create the original topology
280     ${request}    Prepare Filtration Topology Request
281     ...    ${FILTRATION_NT}
282     ...    opendaylight-inventory-model
283     ...    link
284     ...    openflow-topo:3
285     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
286     ${request}    Set Range Number Filter    ${request}    14    15
287     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
288     ${resp}    Wait Until Keyword Succeeds
289     ...    3x
290     ...    1s
291     ...    Output Topo Should Be Complete
292     ...    link_count=2
293     ...    link-ref_count=2
294     #Remove an underlay filtered link, expecting removal of the overlay link
295     Delete Underlay Link    openflow-topo:3    link:14:12
296     ${resp}    Wait Until Keyword Succeeds
297     ...    3x
298     ...    1s
299     ...    Output Topo Should Be Complete
300     ...    link_count=1
301     ...    link-ref_count=1
302
303 Unification Filtration Node Removal Inside NT
304     [Documentation]    Test processing of node removal using unification with filtration operation on Network Topology model
305     ${model}    Set Variable    network-topology-model
306     ${request}    Prepare Unification Filtration Inside Topology Request
307     ...    ${UNIFICATION_FILTRATION_NT_AGGREGATE_INSIDE}
308     ...    ${model}
309     ...    node
310     ...    ${ISIS_NODE_TE_ROUTER_ID_IPV4}
311     ...    network-topo:4
312     ${request}    Insert Filter With ID    ${request}    ${FILTER_IPV4}    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    1
313     ${request}    Insert Apply Filters    ${request}    1    1
314     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
315     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
316     ${resp}    Wait Until Keyword Succeeds
317     ...    3x
318     ...    1s
319     ...    Output Topo Should Be Complete
320     ...    node_count=2
321     ...    supporting-node_count=3
322     ...    node-ref_count=3
323     ...    tp_count=0
324     ...    tp-ref_count=0
325     #Remove an underlay aggregated node, preserving the overlay node
326     Delete Underlay Node    network-topo:4    bgp:20
327     ${resp}    Wait Until Keyword Succeeds
328     ...    3x
329     ...    1s
330     ...    Output Topo Should Be Complete
331     ...    node_count=2
332     ...    supporting-node_count=2
333     ...    node-ref_count=2
334     ...    tp_count=0
335     ...    tp-ref_count=0
336     #Remove an underlay aggregated node, expecting removal of the overlay node
337     Delete Underlay Node    network-topo:4    bgp:18
338     ${resp}    Wait Until Keyword Succeeds
339     ...    3x
340     ...    1s
341     ...    Output Topo Should Be Complete
342     ...    node_count=1
343     ...    supporting-node_count=1
344     ...    node-ref_count=1
345     ...    tp_count=0
346     ...    tp-ref_count=0
347
348 Unification Filtration Node Removal Inside Inventory
349     [Documentation]    Test processing of node removal using unification with filtration operation on Inventory model
350     ${model}    Set Variable    opendaylight-inventory-model
351     ${request}    Prepare Unification Filtration Inside Topology Request
352     ...    ${UNIFICATION_FILTRATION_NT_AGGREGATE_INSIDE}
353     ...    ${model}
354     ...    node
355     ...    ${OPENFLOW_NODE_IP_ADDRESS}
356     ...    openflow-topo:4
357     ${request}    Insert Filter With ID    ${request}    ${FILTER_IPV4}    ${OPENFLOW_NODE_IP_ADDRESS}    1
358     ${request}    Insert Apply Filters    ${request}    1    1
359     ${request}    Set IPV4 Filter    ${request}    192.168.2.1/24
360     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
361     ${resp}    Wait Until Keyword Succeeds
362     ...    3x
363     ...    1s
364     ...    Output Topo Should Be Complete
365     ...    node_count=2
366     ...    supporting-node_count=4
367     ...    node-ref_count=4
368     ...    tp_count=0
369     ...    tp-ref_count=0
370     #Remove an underlay aggregated node, preserving the overlay node
371     Delete Underlay Node    openflow-topo:4    of-node:17
372     ${resp}    Wait Until Keyword Succeeds
373     ...    3x
374     ...    1s
375     ...    Output Topo Should Be Complete
376     ...    node_count=2
377     ...    supporting-node_count=3
378     ...    node-ref_count=3
379     ...    tp_count=0
380     ...    tp-ref_count=0
381     #Remove an underlay aggregated node, expecting removal of the overlay node
382     Delete Underlay Node    openflow-topo:4    of-node:18
383     ${resp}    Wait Until Keyword Succeeds
384     ...    3x
385     ...    1s
386     ...    Output Topo Should Be Complete
387     ...    node_count=1
388     ...    supporting-node_count=2
389     ...    node-ref_count=2
390     ...    tp_count=0
391     ...    tp-ref_count=0
392
393 Link Computation Aggregation Inside Node Removal NT
394     [Documentation]    Test processing of node removal using unification with link computation operation on Network Topology model
395     ${model}    Set Variable    network-topology-model
396     ${request}    Prepare Unification Inside Topology Request
397     ...    ${UNIFICATION_NT_AGGREGATE_INSIDE}
398     ...    ${model}
399     ...    node
400     ...    network-topo:6
401     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
402     ${request}    Insert Link Computation Inside
403     ...    ${request}
404     ...    ${LINK_COMPUTATION_INSIDE}
405     ...    n:network-topology-model
406     ...    network-topo:6
407     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
408     ${resp}    Wait Until Keyword Succeeds
409     ...    3x
410     ...    1s
411     ...    Output Topo Should Be Complete
412     ...    node_count=4
413     ...    supporting-node_count=5
414     ...    node-ref_count=5
415     ...    link_count=4
416     ...    link-ref_count=4
417     Delete Underlay Node    network-topo:6    bgp:26
418     ${resp}    Wait Until Keyword Succeeds
419     ...    3x
420     ...    1s
421     ...    Output Topo Should Be Complete
422     ...    node_count=3
423     ...    supporting-node_count=4
424     ...    node-ref_count=4
425     ...    link_count=3
426     ...    link-ref_count=3
427     Delete Underlay Node    network-topo:6    bgp:28
428     ${resp}    Wait Until Keyword Succeeds
429     ...    3x
430     ...    1s
431     ...    Output Topo Should Be Complete
432     ...    node_count=3
433     ...    supporting-node_count=3
434     ...    node-ref_count=3
435     ...    link_count=2
436     ...    link-ref_count=2
437
438 Link Computation Aggregation Inside Link Removal NT
439     [Documentation]    Test processing of link removal using unification with link computation operation on Network Topology model
440     ${model}    Set Variable    network-topology-model
441     ${request}    Prepare Unification Inside Topology Request
442     ...    ${UNIFICATION_NT_AGGREGATE_INSIDE}
443     ...    ${model}
444     ...    node
445     ...    network-topo:6
446     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
447     ${request}    Insert Link Computation Inside
448     ...    ${request}
449     ...    ${LINK_COMPUTATION_INSIDE}
450     ...    n:network-topology-model
451     ...    network-topo:6
452     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
453     ${resp}    Wait Until Keyword Succeeds
454     ...    3x
455     ...    1s
456     ...    Output Topo Should Be Complete
457     ...    node_count=4
458     ...    supporting-node_count=5
459     ...    node-ref_count=5
460     ...    link_count=4
461     ...    link-ref_count=4
462     Delete Underlay Link    network-topo:6    link:26:28
463     ${resp}    Wait Until Keyword Succeeds
464     ...    3x
465     ...    1s
466     ...    Output Topo Should Be Complete
467     ...    node_count=4
468     ...    supporting-node_count=5
469     ...    node-ref_count=5
470     ...    link_count=3
471     ...    link-ref_count=3