2 Documentation Test suite for RESTCONF inventory
5 Library RequestsLibrary
6 Library ../../../libraries/Common.py
7 Variables ../../../variables/Variables.py
9 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
10 Suite Teardown Delete All Sessions
14 ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
19 [Documentation] Get the inventory
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 Wait Until Keyword Succeeds 30s 2s Check Every Nodes ${numnodes}
25 Get nodeconnector for the root node
26 [Documentation] Get the inventory for the root node
27 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
28 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:1
30 Should Be Equal As Strings ${resp.status_code} 200
31 Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content}
33 Get nodeconnector for a node
34 [Documentation] Get the inventory for a node
35 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
36 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
37 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
38 Wait Until Keyword Succeeds 30s 2s Check Every Nodes Nodeconnector ${numnodes}
41 [Documentation] Get the stats for a node
42 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
43 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
44 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
45 Wait Until Keyword Succeeds 120s 2s Check Every Nodes Stats ${numnodes}
50 [Arguments] ${numnodes}
51 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}
52 Should Be Equal As Strings ${resp.status_code} 200
53 FOR ${IND} IN RANGE 1 ${numnodes+1}
54 Should Contain ${resp.content} openflow:${IND}
57 Check Every Nodes Stats
58 [Arguments] ${numnodes}
59 FOR ${IND} IN RANGE 1 ${numnodes+1}
60 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
62 Should Be Equal As Strings ${resp.status_code} 200
63 Should Contain ${resp.content} flow-capable-node-connector-statistics
64 Should Contain ${resp.content} flow-table-statistics
67 Check Every Nodes Nodeconnector
68 [Arguments] ${numnodes}
69 FOR ${IND} IN RANGE 2 ${numnodes+1}
70 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
72 Should Be Equal As Strings ${resp.status_code} 200
73 Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content}
77 [Arguments] ${arg} ${outerind} ${content}
78 FOR ${var} IN RANGE 1 ${arg+1}
79 Should Contain ${content} openflow:${outerind}:${var}