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