2 Variables ../variables/Variables.py
3 Variables ../variables/topoprocessing/Topologies.py
4 Variables ../variables/topoprocessing/TopologyRequests.py
5 Library RequestsLibrary
8 Resource CompareStream.robot
9 Resource KarafKeywords.robot
10 Resource SetupUtils.robot
15 ${CONFIGURATION_XML} ${CURDIR}/../suites/topoprocessing/configuration.xml
16 ${OPERATIONAL_XML} ${CURDIR}/../suites/topoprocessing/operational.xml
17 ${CONFIGURATION_CFG} ${CURDIR}/../suites/topoprocessing/configuration.cfg
18 ${OPERATIONAL_CFG} ${CURDIR}/../suites/topoprocessing/operational.cfg
19 ${REMOTE_XML_FILE} ${WORKSPACE}/${BUNDLEFOLDER}/etc/opendaylight/karaf/80-topoprocessing-config.xml
20 ${REMOTE_CFG_FILE} ${WORKSPACE}/${BUNDLEFOLDER}/etc/org.opendaylight.topoprocessing.cfg
21 ${OUTPUT_TOPO_NAME} topo:1
22 ${OVERLAY_TOPO_URL} ${TOPOLOGY_URL}/${OUTPUT_TOPO_NAME}
27 [Documentation] Send a simple HTTP PUT request to Configurational datastore
28 [Arguments] ${request} ${overlay_topology_url}
29 ${resp} Put Request session ${CONFIG_API}/${overlay_topology_url} data=${request}
30 Log ${CONFIG_API}/${overlay_topology_url}
31 Should Match "${resp.status_code}" "20?"
32 Wait For Karaf Log Correlation configuration successfully read
33 Wait For Karaf Log Transaction successfully written
36 [Documentation] Send a simple HTTP GET request to a given URL
37 [Arguments] ${overlay_topology_url}
38 ${resp} Get On Session session ${OPERATIONAL_API}/${overlay_topology_url} expected_status=200
41 Send Basic Delete Request
42 [Documentation] Sends a HTTP/DELETE request to a given URL
44 ${resp} Delete Request session ${CONFIG_API}/${url}
45 Log Deleting ${CONFIG_API}/${url}
49 [Documentation] Deletes a node from an underlay topology
50 [Arguments] ${topology-id} ${node-id}
51 ${resp} Send Basic Delete Request ${TOPOLOGY_URL}/${topology-id}/node/${node-id}
54 Delete Underlay Termination Point
55 [Documentation] Deletes a termination point from an underlay topology
56 [Arguments] ${topology-id} ${node-id} ${tp-id}
57 ${resp} Send Basic Delete Request ${TOPOLOGY_URL}/${topology-id}/node/${node-id}/termination-point/${tp-id}
61 [Documentation] Deletes a link from an underlay topology
62 [Arguments] ${topology-id} ${link-id}
63 ${resp} Send Basic Delete Request ${TOPOLOGY_URL}/${topology-id}/link/${link-id}
67 [Documentation] Setup karaf enviroment for following tests
68 Log ---- Setup Environment ----
69 SetupUtils.Setup_Utils_For_Setup_And_Teardown
70 Open Connection ${ODL_SYSTEM_IP}
71 Flexible Controller Login
72 Put File ${CONFIGURATION_CFG} ${REMOTE_CFG_FILE}
74 Wait Until Keyword Succeeds
77 ... Issue Command On Karaf Console
78 ... log:set DEBUG org.opendaylight.topoprocessing
81 ... http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
83 ... headers=${SEND_ACCEPT_XML_HEADERS}
84 Prepare New Feature Installation
85 Insert Underlay topologies
88 [Documentation] Install features according to tested distribution
89 [Arguments] ${features} ${timeout}=180
90 Install Features for Other Distributions ${features} ${timeout}
92 Install Features for Beryllium Distribution
93 [Documentation] Will wait for features to install only once per run
94 [Arguments] ${features} ${timeout}
95 Install a Feature ${features} timeout=${timeout}
96 Set Global Variable If It Does Not Exist \${WAIT_FOR_FEATURES_TO_INSTALL} ${TRUE}
97 IF ${WAIT_FOR_FEATURES_TO_INSTALL}
98 Wait For Karaf Log Registering Topology Request Listener ${timeout}
99 Set Global Variable \${WAIT_FOR_FEATURES_TO_INSTALL} ${FALSE}
102 Install Features for Other Distributions
103 [Documentation] Will wait for features to install only if no topoprocessing feature was installed
104 [Arguments] ${features} ${timeout}
105 ${installed_features} Issue Command On Karaf Console feature:list -i
106 ${lines} Get Lines Containing String ${installed_features} odl-topoprocessing-framework
107 ${length} Get Length ${lines}
108 Install a Feature ${features} timeout=${timeout}
110 Wait For Karaf Log Registering Topology Request Listener ${timeout}
114 [Documentation] Revert startup changes
115 Log ---- Clean Environment ----
116 Open Connection ${ODL_SYSTEM_IP}
117 Flexible Controller Login
118 Put File ${OPERATIONAL_CFG} ${REMOTE_CFG_FILE}
122 Delete Overlay Topology
123 [Documentation] Delete overlay topologies from datastore
124 Run Keyword If Test Failed Print Output Topo
125 Log ---- Test Teardown ----
126 Log Deleting overlay topology from ${CONFIG_API}/${OVERLAY_TOPO_URL}
127 ${resp} Delete Request session ${CONFIG_API}/${OVERLAY_TOPO_URL}
128 Should Be Equal As Strings ${resp.status_code} 200
131 [Documentation] Waits a while to allow any hanging transactions to finnish and then logs the output topology
132 Log ---- Output Topo Dump After Cooldown----
134 ${resp} Wait Until Keyword Succeeds 5x 250ms Basic Request Get ${OVERLAY_TOPO_URL}
137 Refresh Underlay Topologies And Delete Overlay Topology
138 [Documentation] Deletes given overlay topology from datastore and overwrites the underlaying ones with initial topologies
139 Delete Overlay Topology
140 Insert Underlay Topologies
142 Prepare New Feature Installation
143 [Documentation] Clears karaf logs and CONFIGURATION datastore
144 ${resp} Delete Request session ${CONFIG_API}/network-topology:network-topology
145 ${resp} Delete Request session ${CONFIG_API}/opendaylight-inventory:nodes
146 Issue Command On Karaf Console log:clear
148 Insert Underlay Topologies
149 [Documentation] Insert underlay topologies used by following tests
150 Log Inserting underlay topologies
151 # Network underlay topologies
152 FOR ${index} IN RANGE 1 7
155 ... ${CONFIG_API}/${TOPOLOGY_URL}/network-topo:${index}
156 ... data=${NETWORK_UNDERLAY_TOPOLOGY_${index}}
158 Should Match "${resp.status_code}" "20?"
159 # Openflow underlay nodes
161 ${resp} Put Request session ${CONFIG_API}/opendaylight-inventory:nodes data=${OPENFLOW_UNDERLAY_NODES}
163 Should Match "${resp.status_code}" "20?"
164 # Openflow underlay topologies
165 FOR ${index} IN RANGE 1 7
168 ... ${CONFIG_API}/${TOPOLOGY_URL}/openflow-topo:${index}
169 ... data=${OPENFLOW_UNDERLAY_TOPOLOGY_${index}}
171 Should Match "${resp.status_code}" "20?"
173 Issue Command On Karaf Console log:clear
176 Prepare Unification Inside Topology Request
177 [Documentation] Prepare topology request for unification inside from template
178 [Arguments] ${request_template} ${model} ${correlation_item} ${underlay_topo1}
179 ${request_template} Set Element Text ${request_template} ${model} xpath=.//correlations/output-model
180 ${request_template} Set Element Text
181 ... ${request_template}
183 ... xpath=.//correlations/correlation/type
184 ${request_template} Set Element Text
185 ... ${request_template}
186 ... ${correlation_item}
187 ... xpath=.//correlation/correlation-item
188 ${request_template} Set Element Text
189 ... ${request_template}
191 ... xpath=.//correlation/aggregation/aggregation-type
192 ${request_template} Set Element Text
193 ... ${request_template}
195 ... xpath=.//correlation/aggregation/mapping[1]/input-model
196 ${request_template} Set Element Text
197 ... ${request_template}
198 ... ${underlay_topo1}
199 ... xpath=.//correlation/aggregation/mapping[1]/underlay-topology
200 ${request_template} Element to String ${request_template}
201 RETURN ${request_template}
203 Prepare Unification Topology Request
204 [Documentation] Prepare topology request for unification on two topologies from template
205 [Arguments] ${request_template} ${model} ${correlation_item} ${underlay_topo1} ${underlay_topo2}
206 ${request_template} Prepare Unification Inside Topology Request
207 ... ${request_template}
209 ... ${correlation_item}
210 ... ${underlay_topo1}
211 ${request_template} Set Element Text
212 ... ${request_template}
213 ... ${underlay_topo2}
214 ... xpath=.//correlation/aggregation/mapping[2]/underlay-topology
215 ${request_template} Set Element Text
216 ... ${request_template}
218 ... xpath=.//correlation/aggregation/mapping[2]/input-model
219 ${request_template} Element to String ${request_template}
220 RETURN ${request_template}
222 Prepare Unification Filtration Topology Request
223 [Documentation] Prepare topology request for unification on two topologies from template
224 [Arguments] ${request_template} ${model} ${correlation_item} ${target_field1} ${underlay_topo1} ${target_field2}
225 ... ${underlay_topo2}
226 ${request_template} Prepare Unification Filtration Inside Topology Request
227 ... ${request_template}
229 ... ${correlation_item}
231 ... ${underlay_topo1}
232 ${request_template} Set Element Text
233 ... ${request_template}
234 ... ${underlay_topo2}
235 ... xpath=.//correlation/aggregation/mapping[2]/underlay-topology
236 Insert Target Field ${request_template} 2 ${target_field2} 1
237 ${request_template} Set Element Text
238 ... ${request_template}
240 ... xpath=.//correlation/aggregation/mapping[2]/input-model
241 ${request_template} Element to String ${request_template}
242 RETURN ${request_template}
244 Prepare Unification Filtration Inside Topology Request
245 [Documentation] Prepare topology request for unification filtration inside from template
246 [Arguments] ${request_template} ${model} ${correlation_item} ${target-field} ${underlay_topo}
247 ${request_template} Set Element Text ${request_template} ${model} xpath=.//correlations/output-model
248 ${request_template} Set Element Text
249 ... ${request_template}
250 ... filtration-aggregation
251 ... xpath=.//correlations/correlation/type
252 ${request_template} Set Element Text
253 ... ${request_template}
254 ... ${correlation_item}
255 ... xpath=.//correlation/correlation-item
256 ${request_template} Set Element Text
257 ... ${request_template}
259 ... xpath=.//correlation/aggregation/aggregation-type
260 ${request_template} Set Element Text
261 ... ${request_template}
263 ... xpath=.//correlation/aggregation/mapping[1]/input-model
264 ${request_template} Set Element Text
265 ... ${request_template}
267 ... xpath=.//correlation/aggregation/mapping[1]/underlay-topology
268 Insert Target Field ${request_template} 1 ${target-field} 1
269 ${request_template} Set Element Text
270 ... ${request_template}
272 ... xpath=.//correlation/filtration/underlay-topology
273 ${request_template} Element to String ${request_template}
274 RETURN ${request_template}
277 [Arguments] ${request_template} ${mapping} ${filter_id}
278 ${request_template} Add Element
279 ... ${request_template}
281 ... xpath=.//correlation/aggregation/mapping[${mapping}]
282 ${request_template} Set Element Text
283 ... ${request_template}
285 ... xpath=.//correlation/aggregation/mapping[${mapping}]/apply-filters
286 RETURN ${request_template}
288 Prepare Filtration Topology Request
289 [Documentation] Prepare topology request for filtration from template
290 [Arguments] ${request_template} ${model} ${correlation_item} ${underlay_topo}
291 ${request_template} Set Element Text ${request_template} ${model} xpath=.//correlations/output-model
292 ${request_template} Set Element Text
293 ... ${request_template}
294 ... ${correlation_item}
295 ... xpath=.//correlation/correlation-item
296 ${request_template} Set Element Text
297 ... ${request_template}
299 ... xpath=.//correlation/filtration/underlay-topology
300 RETURN ${request_template}
303 [Documentation] Add target field to request
304 [Arguments] ${request_template} ${mapping_index} ${target_field_path} ${matching_key}
305 ${target_field_template} Set Element Text
307 ... ${target_field_path}
308 ... xpath=.//target-field-path
309 ${target_field_template} Set Element Text
310 ... ${target_field_template}
312 ... xpath=.//matching-key
313 ${request_template} Add Element
314 ... ${request_template}
315 ... ${target_field_template}
316 ... xpath=.//correlation/aggregation/mapping[${mapping_index}]
317 ${request_template} Element to String ${request_template}
318 RETURN ${request_template}
321 [Documentation] Add filter to filtration
322 [Arguments] ${request_template} ${filter_template} ${target_field}
323 ${request_template} Add Element ${request_template} ${filter_template} xpath=.//correlation/filtration
324 ${model} Get Element Text ${request_template} xpath=.//correlations/output-model
325 ${request_template} Set Element Text
326 ... ${request_template}
328 ... xpath=.//correlation/filtration/filter/input-model
329 ${request_template} Set Element Text
330 ... ${request_template}
332 ... xpath=.//correlation/filtration/filter/target-field
333 RETURN ${request_template}
335 Insert Filter With ID
336 [Documentation] Add filter to filtration with specified id
337 [Arguments] ${request_template} ${filter_template} ${target_field} ${filter_id}
338 ${request_template} Insert Filter ${request_template} ${filter_template} ${target_field}
339 ${request_template} Set Element Text
340 ... ${request_template}
342 ... xpath=.//correlation/filtration/filter/filter-id
343 RETURN ${request_template}
346 [Documentation] Set filter ipv4 address
347 [Arguments] ${request_template} ${ip_address}
348 ${request_template} Set Element Text
349 ... ${request_template}
351 ... xpath=.//correlation/filtration/filter/ipv4-address-filter/ipv4-address
352 ${request_template} Element to String ${request_template}
353 RETURN ${request_template}
355 Set Range Number Filter
356 [Documentation] Set filter minimum and maximum number values
357 [Arguments] ${request_template} ${min_number} ${max_number}
358 ${request_template} Set Element Text
359 ... ${request_template}
361 ... xpath=.//correlation/filtration/filter/range-number-filter/min-number-value
362 ${request_template} Set Element Text
363 ... ${request_template}
365 ... xpath=.//correlation/filtration/filter/range-number-filter/max-number-value
366 ${request_template} Element to String ${request_template}
367 RETURN ${request_template}
369 Set Range String Filter
370 [Documentation] Set filter minimum and maximum string values
371 [Arguments] ${request_template} ${min_value} ${max_value}
372 ${request_template} Set Element Text
373 ... ${request_template}
375 ... xpath=.//correlation/filtration/filter/range-string-filter/min-string-value
376 ${request_template} Set Element Text
377 ... ${request_template}
379 ... xpath=.//correlation/filtration/filter/range-string-filter/max-string-value
380 ${request_template} Element to String ${request_template}
381 RETURN ${request_template}
383 Set Specific Number Filter
384 [Documentation] Set filter number value
385 [Arguments] ${request_template} ${number}
386 ${request_template} Set Element Text
387 ... ${request_template}
389 ... xpath=.//correlation/filtration/filter/specific-number-filter/specific-number
390 ${request_template} Element to String ${request_template}
391 RETURN ${request_template}
393 Set Specific String Filter
394 [Documentation] Set filter string value
395 [Arguments] ${request_template} ${string_value}
396 ${request_template} Set Element Text
397 ... ${request_template}
399 ... xpath=.//correlation/filtration/filter/specific-string-filter/specific-string
400 ${request_template} Element to String ${request_template}
401 RETURN ${request_template}
404 [Documentation] Set filter ipv6 address
405 [Arguments] ${request_template} ${ip_address}
406 ${request_template} Set Element Text
407 ... ${request_template}
409 ... xpath=.//correlation/filtration/filter/ipv6-address-filter/ipv6-address
410 ${request_template} Element to String ${request_template}
411 RETURN ${request_template}
414 [Documentation] Set filter script
415 [Arguments] ${request_template} ${script_language} ${script}
416 ${request_template} Set Element Text
417 ... ${request_template}
418 ... ${script_language}
419 ... xpath=.//correlation/filtration/filter/script-filter/scripting/language
420 ${request_template} Set Element Text
421 ... ${request_template}
423 ... xpath=.//correlation/filtration/filter/script-filter/scripting/script
424 ${request_template} Element to String ${request_template}
425 RETURN ${request_template}
427 Insert Link Computation Inside
428 [Documentation] Add link computation to request
429 [Arguments] ${request_template} ${link_computation_template} ${input_model} ${underlay_topology}
430 ${request_template} Add Element ${request_template} ${link_computation_template} xpath=.
431 ${request_template} Set Element Text
432 ... ${request_template}
434 ... xpath=.//link-computation/node-info/input-model
435 ${request_template} Set Element Text
436 ... ${request_template}
438 ... xpath=.//link-computation/link-info/input-model
439 ${request_template} Set Element Text
440 ... ${request_template}
442 ... xpath=.//link-computation/output-model
443 ${request_template} Set Element Text
444 ... ${request_template}
445 ... ${underlay_topology}
446 ... xpath=.//link-computation/link-info/link-topology
447 ${request_template} Set Element Attribute
448 ... ${request_template}
450 ... urn:opendaylight:topology:correlation
451 ... xpath=./link-computation
452 ${request_template} Element to String ${request_template}
453 RETURN ${request_template}
455 Insert Link Computation
456 [Documentation] Add link computation to request
457 [Arguments] ${request_template} ${link_computation_template} ${input_model} ${underlay_topology_1} ${underlay_topology_2}
458 ${request_template} Add Element ${request_template} ${link_computation_template} xpath=.
459 ${request_template} Set Element Text
460 ... ${request_template}
462 ... xpath=.//link-computation/node-info/input-model
463 ${request_template} Set Element Text
464 ... ${request_template}
466 ... xpath=.//link-computation/link-info[1]/input-model
467 ${request_template} Set Element Text
468 ... ${request_template}
470 ... xpath=.//link-computation/link-info[2]/input-model
471 ${request_template} Set Element Text
472 ... ${request_template}
474 ... xpath=.//link-computation/output-model
475 ${request_template} Set Element Text
476 ... ${request_template}
477 ... ${underlay_topology_1}
478 ... xpath=.//link-computation/link-info[1]/link-topology
479 ${request_template} Set Element Text
480 ... ${request_template}
481 ... ${underlay_topology_2}
482 ... xpath=.//link-computation/link-info[2]/link-topology
483 ${request_template} Set Element Attribute
484 ... ${request_template}
486 ... urn:opendaylight:topology:correlation
487 ... xpath=./link-computation
488 ${request_template} Element to String ${request_template}
489 RETURN ${request_template}
491 Insert Scripting into Request
492 [Documentation] Insert Scripting into Request under aggregation node
493 [Arguments] ${request} ${language} ${script}
494 ${request} Add Element ${request} ${SCRIPTING} xpath=.//correlation/aggregation
495 ${request} Set Element Text ${request} ${script} xpath=.//correlation/aggregation/scripting/script
496 ${request} Set Element Text ${request} ${language} xpath=.//correlation/aggregation/scripting/language
497 ${request} Element to String ${request}
501 [Documentation] Create an isis node element with id and ip
502 [Arguments] ${node-id} ${ovs-version}=23 ${router-id-ipv4}=10.0.0.1
503 ${request} Set Element Text ${NODE_ISIS} ${node-id} xpath=.//node-id
504 ${request} Set Element Text ${request} ${ovs-version} xpath=.//ovs-version
505 ${request} Set Element Text
507 ... ${router-id-ipv4}
508 ... xpath=.//igp-node-attributes/isis-node-attributes/ted/te-router-id-ipv4
509 ${request} Element to String ${request}
513 [Documentation] Create an Openflow node element with id and ip
514 [Arguments] ${node-id} ${ip-address}=10.0.0.1 ${serial-number}=27
515 ${request} Set Element Text ${NODE_OPENFLOW} ${node-id} xpath=.//id
516 ${request} Set Element Text ${request} ${ip-address} xpath=.//ip-address
517 ${request} Set Element Text ${request} ${serial-number} xpath=.//serial-number
518 ${request} Element to String ${request}
521 Create OVSDB Termination Point
522 [Documentation] Create an OVSDB termination point element with id and port
523 [Arguments] ${tp-id} ${ofport}
524 ${request} Set Element Text ${TERMINATION_POINT_OVSDB} ${tp-id} xpath=.//tp-id
525 ${request} Set Element Text ${request} ${ofport} xpath=.//ofport
526 ${request} Element to String ${request}
529 Create Openflow Node Connector
530 [Documentation] Create an Openflow node connector element with id and port number
531 [Arguments] ${nc-id} ${port-number}
532 ${request} Set Element Text ${NODE_CONNECTOR_OPENFLOW} ${nc-id} xpath=.//id
533 ${request} Set Element Text ${request} ${port-number} xpath=.//port-number
534 ${request} Element to String ${request}
538 [Arguments] ${link-id} ${source-node} ${dest-node} ${name} ${metric}
539 ${request} Set Element Text ${LINK} ${link-id} xpath=.//link-id
540 ${request} Set Element Text ${request} ${source-node} xpath=.//source/source-node
541 ${request} Set Element Text ${request} ${dest-node} xpath=.//destination/dest-node
542 ${request} Set Element Text ${request} ${name} xpath=.//igp-link-attributes/name
543 ${request} Set Element Text ${request} ${metric} xpath=.//igp-link-attributes/metric
544 ${request} Element to String ${request}
547 Extract Node from Topology
548 [Documentation] Returns node that contains supporting node with ID specified in argument supp_node_id
549 [Arguments] ${topology} ${supp_node_id}
550 ${xpath} Set Variable .//node/supporting-node[node-ref='${supp_node_id}']/..
551 ${node} Get Element ${topology} xpath=${xpath}
552 ${node} Element to String ${node}
555 Extract Termination Point from Topology
556 [Documentation] Returns termination point that contains supporting termination point from specified topology, node and with specified id
557 [Arguments] ${model} ${topology} ${topo_id} ${node_id} ${tp_id}
558 Check Supported Model ${model}
559 ${xpath} Set Variable If
560 ... '${model}' == 'network-topology-model' or '${model}' == 'opendaylight-inventory-model'
561 ... .//termination-point[tp-ref='/network-topology:network-topology/topology/${topo_id}/node/${node_id}/termination-point/${tp_id}']
562 ... .//termination-point/supporting-termination-point[tp-ref='${tp_id}']/..
563 ${tp} Get Element ${topology} xpath=${xpath}
564 ${tp} Element to String ${tp}
567 Extract Link from Topology
568 [Documentation] Returns link that contains supporting link
569 [Arguments] ${model} ${topology} ${topo_id} ${link_id}
570 Check Supported Model ${model}
571 ${xpath} Set Variable If
572 ... '${model}' == 'network-topology-model' or '${model}' == 'opendaylight-inventory-model'
573 ... .//link/supporting-link[link-ref='/network-topology/topology/${topo_id}/link/${link_id}']/..
574 ... .//link/supporting-link[tp-ref='${tp_id}']/..
575 ${link} Get Element ${topology} xpath=${xpath}
576 ${link} Element to String ${link}
579 Check Supported Model
580 [Documentation] Checks if model is supported.
582 IF '${model}' != 'network-topology-model' and '${model}' != 'i2rs-model' and '${model}' != 'opendaylight-inventory-model'
583 Fail Not supported model
586 Check Aggregated Node in Topology
587 [Documentation] Checks number of termination points and concrete supporting nodes in aggregated node and returns overlay node id. Model should be 'network-topology-model', 'opendaylight-inventory-model' or 'i2rs-model'.
588 [Arguments] ${model} ${topology} ${tp_count} @{supp_node_ids}
589 Check Supported Model ${model}
590 ${node_id} Get From List ${supp_node_ids} 0
591 ${aggregated_node} Extract Node from Topology ${topology} ${node_id}
592 ${supp_node_count} Get Length ${supp_node_ids}
593 Should Contain X Times ${aggregated_node} <supporting-node> ${supp_node_count}
594 Should Contain X Times ${aggregated_node} <termination-point> ${tp_count}
595 Should Contain X Times ${aggregated_node} <tp-ref> ${tp_count}
596 FOR ${supp_node_id} IN @{supp_node_ids}
597 Element Text Should Be
598 ... ${aggregated_node}
600 ... xpath=.//supporting-node[node-ref='${supp_node_id}']/node-ref
602 ${overlay_node_id} Get Element Text ${aggregated_node} xpath=./node-id
603 RETURN ${overlay_node_id}
605 Check Aggregated Termination Point in Node
606 [Documentation] Checks supporting termination points in aggregated termination point. Model should be 'network-topology-model', 'opendaylight-inventory-model' or 'i2rs-model'.
607 [Arguments] ${model} ${topology} ${topology_id} ${node_id} ${tp_id} @{supp_tp_ids}
608 Check Supported Model ${model}
609 ${tp} Extract Termination Point from Topology
615 ${supp_tp_count} Get Length ${supp_tp_ids}
616 Should Contain X Times ${tp} <tp-ref> ${supp_tp_count}
617 FOR ${supp_tp_id} IN @{supp_tp_ids}
618 Should Contain X Times ${tp} ${supp_tp_id}</tp-ref> 1
621 Check Filtered Nodes in Topology
622 [Documentation] Checks nodes in filtered topology
623 [Arguments] ${topology} ${tp_count} @{node_ids}
624 FOR ${node_id} IN @{node_ids}
625 Element Text Should Be
628 ... xpath=.//node/supporting-node[node-ref='${node_id}']/node-ref
631 Check Filtered Termination Points in Node
632 [Documentation] Checks termination points in filtered topology
633 [Arguments] ${topology} ${supp_node_id} @{supp_tp_ids}
634 ${node} Extract Node from Topology ${topology} ${supp_node_id}
635 ${supp_tp_count} Get Length ${supp_tp_ids}
636 Should Contain X Times ${node} <supporting-node> 1
637 Should Contain X Times ${node} <termination-point> ${supp_tp_count}
638 Should Contain X Times ${node} <tp-ref> ${supp_tp_count}
639 FOR ${supp_tp_id} IN @{supp_tp_ids}
640 Should Contain X Times ${node} ${supp_tp_id} 1
643 Check Filtered Links In Topology
644 [Documentation] Checks links in filtered topology
645 [Arguments] ${topology} @{supp_link_ids}
646 FOR ${supp_link_id} IN @{supp_link_ids}
647 Should Contain X Times ${topology} ${supp_link_id}</link-ref> 1
650 Check Overlay Link Source And Destination
651 [Documentation] Checks if the overlay link's source and destination specified by a supporting link ref matches given source and destination
652 [Arguments] ${model} ${topology} ${topo_id} ${link_id} ${expected_source} ${expected_destination}
653 ${link} Extract Link from Topology ${model} ${topology} ${topo_id} ${link_id}
654 ${link_source} Get Element Text ${link} xpath=.//source-node
655 ${link_destination} Get Element Text ${link} xpath=.//dest-node
656 Should Be Equal As Strings ${link_source} ${expected_source}
657 Should Be Equal As Strings ${link_destination} ${expected_destination}
659 Output Topo Should Be Complete
660 [Documentation] Verifies that the output topology contains the expected amount of essential elements
661 [Arguments] ${node_count}=-1 ${supporting-node_count}=-1 ${node-ref_count}=-1 ${tp_count}=-1 ${tp-ref_count}=-1 ${link_count}=-1
662 ... ${link-ref_count}=-1
663 ${resp} Wait Until Keyword Succeeds 5x 250ms Basic Request Get ${OVERLAY_TOPO_URL}
664 Should Contain ${resp.text} <topology-id>${OUTPUT_TOPO_NAME}</topology-id>
666 Should Contain X Times ${resp.text} <node> ${node_count}
668 IF ${supporting-node_count}>-1
669 Should Contain X Times ${resp.text} <supporting-node> ${supporting-node_count}
671 IF ${node-ref_count}>-1
672 Should Contain X Times ${resp.text} <node-ref> ${node-ref_count}
675 Should Contain X Times ${resp.text} <link> ${link_count}
677 IF ${link-ref_count}>-1
678 Should Contain X Times ${resp.text} <link-ref> ${link-ref_count}
681 Should Contain X Times ${resp.text} <termination-point> ${tp_count}
683 IF ${tp-ref_count}>-1
684 Should Contain X Times ${resp.text} <tp-ref> ${tp-ref_count}
686 Log ---- Output Topo ----
690 Set Global Variable If It Does Not Exist
691 [Arguments] ${name} ${value}
692 ${status} ${message} Run Keyword And Ignore Error Variable Should Exist ${name}
693 IF "${status}" == "FAIL" Set Global Variable ${name} ${value}