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