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} /rests/data/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 On Session
30 ... url=${REST_CONTEXT}/node=openflow%3A1?content=nonconfig
31 ... expected_status=200
33 Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content}
35 Get nodeconnector for a node
36 [Documentation] Get the inventory for a node
37 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
38 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
39 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
40 Wait Until Keyword Succeeds 30s 2s Check Every Nodes Nodeconnector ${numnodes}
43 [Documentation] Get the stats for a node
44 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
45 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
46 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
47 Wait Until Keyword Succeeds 120s 2s Check Every Nodes Stats ${numnodes}
52 [Arguments] ${numnodes}
53 ${resp} RequestsLibrary.GET On Session
55 ... url=${REST_CONTEXT}?content=nonconfig
56 ... expected_status=200
57 FOR ${IND} IN RANGE 1 ${numnodes+1}
58 Should Contain ${resp.content} openflow:${IND}
61 Check Every Nodes Stats
62 [Arguments] ${numnodes}
63 FOR ${IND} IN RANGE 1 ${numnodes+1}
64 ${resp} RequestsLibrary.GET On Session
66 ... url=${REST_CONTEXT}/node=openflow%3A${IND}?content=nonconfig
67 ... expected_status=200
69 Should Contain ${resp.content} flow-capable-node-connector-statistics
70 Should Contain ${resp.content} flow-table-statistics
73 Check Every Nodes Nodeconnector
74 [Arguments] ${numnodes}
75 FOR ${IND} IN RANGE 2 ${numnodes+1}
76 ${resp} RequestsLibrary.GET On Session
78 ... url=${REST_CONTEXT}/node=openflow%3A${IND}?content=nonconfig
79 ... expected_status=200
81 Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content}
85 [Arguments] ${arg} ${outerind} ${content}
86 FOR ${var} IN RANGE 1 ${arg+1}
87 Should Contain ${content} openflow:${outerind}:${var}