2 Documentation Test suite for RESTCONF topology
6 Library RequestsLibrary
7 Library ../../../libraries/Common.py
8 Variables ../../../variables/Variables.py
10 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
11 Suite Teardown Delete All Sessions
15 ${REST_CONTEXT} /restconf/operational/network-topology:network-topology/topology/flow:1
20 [Documentation] Checks the number of switches
21 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
22 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
23 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
24 Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} node ${numnodes}
27 [Documentation] Checks the number of links
28 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
29 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
30 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
31 ${numlinks} Evaluate (${numnodes}-1)*2
32 Wait Until Keyword Succeeds 60s 2s Verify Element Count ${REST_CONTEXT} link ${numlinks}
37 [Arguments] ${URI} ${xpath_location} ${expected_count}
38 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} headers=${ACCEPT_XML}
40 Should Be Equal As Strings ${resp.status_code} 200
41 ${count} Get Element Count ${resp.content} xpath=${xpath_location}
42 Should Be Equal As Numbers ${count} ${expected_count}