Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 010_Aggregation.robot
1 *** Settings ***
2 Documentation       Test suite to verify unification operation on different models.
3 ...                 Before test starts, configurational file have to be rewriten to change listners 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 install features required for tested models, clear karaf logs for further synchronization. Tests themselves send configurational
6 ...                 xmls and verify output. Topology-id on the end of each urls 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/SetupUtils.robot
17 Resource            ../../../libraries/TopoprocessingKeywords.robot
18
19 Suite Setup         Setup Environment
20 Suite Teardown      Clean Environment
21 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
22 Test Teardown       Delete Overlay Topology
23
24
25 *** Test Cases ***
26 Unification Node
27     [Documentation]    Test unification operation on Network Topology model
28     ${model}    Set Variable    network-topology-model
29     ${request}    Prepare Unification Topology Request
30     ...    ${UNIFICATION_NT}
31     ...    ${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     ...    tp_count=14
45     ...    tp-ref_count=14
46     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:5    bgp:10
47     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:9
48     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:8
49     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:7
50     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:6
51     Check Aggregated Node in Topology    ${model}    ${resp.content}    4    bgp:3    bgp:4
52     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:2
53     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    bgp:1
54
55 Unification Node Inventory
56     [Documentation]    Test unification operation on inventory model
57     ${model}    Set Variable    opendaylight-inventory-model
58     ${request}    Prepare Unification Topology Request
59     ...    ${UNIFICATION_NT}
60     ...    ${model}
61     ...    node
62     ...    openflow-topo:1
63     ...    openflow-topo:2
64     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_IP_ADDRESS}    0
65     ${request}    Insert Target Field    ${request}    1    ${OPENFLOW_NODE_IP_ADDRESS}    0
66     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
67     ${resp}    Wait Until Keyword Succeeds
68     ...    3x
69     ...    1s
70     ...    Output Topo Should Be Complete
71     ...    node_count=7
72     ...    supporting-node_count=10
73     ...    tp_count=12
74     ...    tp-ref_count=12
75     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:10    of-node:4
76     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:7    of-node:9
77     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:8
78     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    of-node:6    of-node:1
79     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    of-node:5
80     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:3
81     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:2
82
83 Unification Scripting Node
84     [Documentation]    Test unification operation on Network Topology model using scripting
85     ${model}    Set Variable    network-topology-model
86     ${request}    Prepare Unification Topology Request
87     ...    ${UNIFICATION_NT}
88     ...    ${model}
89     ...    node
90     ...    network-topo:1
91     ...    network-topo:2
92     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
93     ${request}    Insert Target Field    ${request}    1    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
94     ${request}    Insert Scripting into Request
95     ...    ${request}
96     ...    javascript
97     ...    if (originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.1") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.3") > -1 || originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.3") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.1") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);}
98     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
99     ${resp}    Wait Until Keyword Succeeds
100     ...    3x
101     ...    1s
102     ...    Output Topo Should Be Complete
103     ...    node_count=9
104     ...    supporting-node_count=10
105     ...    tp_count=14
106     ...    tp-ref_count=14
107     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:10
108     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:9
109     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:8
110     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:7
111     Check Aggregated Node in Topology    ${model}    ${resp.content}    4    bgp:1    bgp:6
112     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:5
113     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:4
114     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    bgp:3
115     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:2
116
117 Unification Scripting Node Inventory
118     [Documentation]    Test unification operation on inventory model using scripting
119     ${model}    Set Variable    opendaylight-inventory-model
120     ${request}    Prepare Unification Topology Request
121     ...    ${UNIFICATION_NT}
122     ...    ${model}
123     ...    node
124     ...    openflow-topo:1
125     ...    openflow-topo:2
126     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_IP_ADDRESS}    0
127     ${request}    Insert Target Field    ${request}    1    ${OPENFLOW_NODE_IP_ADDRESS}    0
128     ${request}    Insert Scripting into Request
129     ...    ${request}
130     ...    javascript
131     ...    if (originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.2") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.4") > -1 || originalItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.4") > -1 && newItem.getLeafNodes().get(java.lang.Integer.valueOf('0')).getValue().indexOf("192.168.1.2") > -1) {aggregable.setResult(true);} else { aggregable.setResult(false);}
132     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
133     ${resp}    Wait Until Keyword Succeeds
134     ...    3x
135     ...    1s
136     ...    Output Topo Should Be Complete
137     ...    node_count=9
138     ...    supporting-node_count=10
139     ...    tp_count=12
140     ...    tp-ref_count=12
141     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:10
142     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:9
143     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:2    of-node:8
144     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:7
145     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:6
146     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    of-node:5
147     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:4
148     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    of-node:3
149     Check Aggregated Node in Topology    ${model}    ${resp.content}    2    of-node:1
150
151 Unification Node Inside
152     [Documentation]    Test of unification type of aggregation inside on nodes on Network Topology model
153     ${model}    Set Variable    network-topology-model
154     ${request}    Prepare Unification Inside Topology Request
155     ...    ${UNIFICATION_NT_AGGREGATE_INSIDE}
156     ...    ${model}
157     ...    node
158     ...    network-topo:1
159     ${request}    Insert Target Field    ${request}    0    ${ISIS_NODE_TE_ROUTER_ID_IPV4}    0
160     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
161     ${resp}    Wait Until Keyword Succeeds
162     ...    3x
163     ...    1s
164     ...    Output Topo Should Be Complete
165     ...    node_count=4
166     ...    supporting-node_count=5
167     ...    tp_count=8
168     ...    tp-ref_count=8
169     Check Aggregated Node in Topology    ${model}    ${resp.content}    1    bgp:5
170     Check Aggregated Node in Topology    ${model}    ${resp.content}    4    bgp:3    bgp:4
171     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    bgp:2
172     Check Aggregated Node in Topology    ${model}    ${resp.content}    3    bgp:1
173
174 Unification Node Inside Inventory
175     [Documentation]    Test of unification type of aggregation inside on nodes on Inventory model
176     ${model}    Set Variable    opendaylight-inventory-model
177     ${request}    Prepare Unification Inside Topology Request
178     ...    ${UNIFICATION_NT_AGGREGATE_INSIDE}
179     ...    ${model}
180     ...    node
181     ...    openflow-topo:2
182     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_IP_ADDRESS}    0
183     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
184     ${resp}    Wait Until Keyword Succeeds
185     ...    3x
186     ...    1s
187     ...    Output Topo Should Be Complete
188     ...    node_count=4
189     ...    supporting-node_count=5
190     ...    tp_count=0
191     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:10
192     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:7    of-node:9
193     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:8
194     Check Aggregated Node in Topology    ${model}    ${resp.content}    0    of-node:6
195
196 Unification Termination Point Inside
197     [Documentation]    Test aggregate inside operation on termination points
198     ${model}    Set Variable    network-topology-model
199     ${request}    Prepare Unification Inside Topology Request
200     ...    ${UNIFICATION_NT_AGGREGATE_INSIDE}
201     ...    ${model}
202     ...    termination-point
203     ...    network-topo:1
204     ${request}    Insert Target Field    ${request}    0    ${OVSDB_OFPORT}    0
205     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
206     ${resp}    Wait Until Keyword Succeeds
207     ...    3x
208     ...    1s
209     ...    Output Topo Should Be Complete
210     ...    node_count=5
211     ...    supporting-node_count=5
212     ...    tp_count=6
213     ...    tp-ref_count=8
214     ${topology_id}    Set Variable    network-topo:1
215     Check Aggregated Termination Point in Node
216     ...    ${model}
217     ...    ${resp.content}
218     ...    ${topology_id}
219     ...    bgp:1
220     ...    tp:1:1
221     ...    tp:1:1
222     ...    tp:1:2
223     Check Aggregated Termination Point in Node
224     ...    ${model}
225     ...    ${resp.content}
226     ...    ${topology_id}
227     ...    bgp:1
228     ...    tp:1:3
229     ...    tp:1:3
230     Check Aggregated Termination Point in Node
231     ...    ${model}
232     ...    ${resp.content}
233     ...    ${topology_id}
234     ...    bgp:3
235     ...    tp:3:1
236     ...    tp:3:1
237     Check Aggregated Termination Point in Node
238     ...    ${model}
239     ...    ${resp.content}
240     ...    ${topology_id}
241     ...    bgp:3
242     ...    tp:3:2
243     ...    tp:3:2
244     Check Aggregated Termination Point in Node
245     ...    ${model}
246     ...    ${resp.content}
247     ...    ${topology_id}
248     ...    bgp:4
249     ...    tp:4:1
250     ...    tp:4:1
251     ...    tp:4:2
252     Check Aggregated Termination Point in Node
253     ...    ${model}
254     ...    ${resp.content}
255     ...    ${topology_id}
256     ...    bgp:5
257     ...    tp:5:1
258     ...    tp:5:1
259
260 Unification Termination Point Inside Inventory
261     [Documentation]    Test aggregate inside operation on termination points
262     ${model}    Set Variable    opendaylight-inventory-model
263     ${request}    Prepare Unification Inside Topology Request
264     ...    ${UNIFICATION_NT_AGGREGATE_INSIDE}
265     ...    ${model}
266     ...    termination-point
267     ...    openflow-topo:1
268     ${request}    Insert Target Field    ${request}    0    ${OPENFLOW_NODE_CONNECTOR_PORT_NUMBER}    0
269     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
270     ${resp}    Wait Until Keyword Succeeds
271     ...    3x
272     ...    1s
273     ...    Output Topo Should Be Complete
274     ...    node_count=5
275     ...    supporting-node_count=5
276     ...    tp_count=8
277     ...    tp-ref_count=12
278     ${topology_id}    Set Variable    openflow-topo:1
279     Check Aggregated Termination Point in Node
280     ...    ${model}
281     ...    ${resp.content}
282     ...    ${topology_id}
283     ...    of-node:5
284     ...    tp:5:1
285     ...    tp:5:1
286     Check Aggregated Termination Point in Node
287     ...    ${model}
288     ...    ${resp.content}
289     ...    ${topology_id}
290     ...    of-node:4
291     ...    tp:4:1
292     ...    tp:4:1
293     ...    tp:4:2
294     ...    tp:4:3
295     Check Aggregated Termination Point in Node
296     ...    ${model}
297     ...    ${resp.content}
298     ...    ${topology_id}
299     ...    of-node:3
300     ...    tp:3:1
301     ...    tp:3:1
302     ...    tp:3:2
303     Check Aggregated Termination Point in Node
304     ...    ${model}
305     ...    ${resp.content}
306     ...    ${topology_id}
307     ...    of-node:3
308     ...    tp:3:3
309     ...    tp:3:3
310     Check Aggregated Termination Point in Node
311     ...    ${model}
312     ...    ${resp.content}
313     ...    ${topology_id}
314     ...    of-node:2
315     ...    tp:2:1
316     ...    tp:2:1
317     Check Aggregated Termination Point in Node
318     ...    ${model}
319     ...    ${resp.content}
320     ...    ${topology_id}
321     ...    of-node:2
322     ...    tp:2:2
323     ...    tp:2:2
324     Check Aggregated Termination Point in Node
325     ...    ${model}
326     ...    ${resp.content}
327     ...    ${topology_id}
328     ...    of-node:2
329     ...    tp:2:3
330     ...    tp:2:3
331     Check Aggregated Termination Point in Node
332     ...    ${model}
333     ...    ${resp.content}
334     ...    ${topology_id}
335     ...    of-node:1
336     ...    tp:1:1
337     ...    tp:1:1
338     ...    tp:1:2