2 Documentation Test suite for RESTCONF inventory
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
4 Suite Teardown Delete All Sessions
6 Library RequestsLibrary
7 Library ../../../libraries/Common.py
8 Variables ../../../variables/Variables.py
11 ${REST_CONTEXT} /restconf/operational/opendaylight-inventory:nodes
15 [Documentation] Get the inventory
16 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
17 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
18 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
19 Wait Until Keyword Succeeds 30s 2s Check Every Nodes ${numnodes}
21 Get nodeconnector for the root node
22 [Documentation] Get the inventory for the root node
23 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
24 ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/node/openflow:1
26 Should Be Equal As Strings ${resp.status_code} 200
27 Wait Until Keyword Succeeds 30s 2s Check conn loop ${TOPO_TREE_FANOUT} 1 ${resp.content}
29 Get nodeconnector for a node
30 [Documentation] Get the inventory for a node
31 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
32 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
33 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
34 Wait Until Keyword Succeeds 30s 2s Check Every Nodes Nodeconnector ${numnodes}
37 [Documentation] Get the stats for a node
38 ${TOPO_TREE_DEPTH} Convert To Integer ${TOPO_TREE_DEPTH}
39 ${TOPO_TREE_FANOUT} Convert To Integer ${TOPO_TREE_FANOUT}
40 ${numnodes} Num Of Nodes ${TOPO_TREE_DEPTH} ${TOPO_TREE_FANOUT}
41 Wait Until Keyword Succeeds 120s 2s Check Every Nodes Stats ${numnodes}
45 [Arguments] ${numnodes}
46 ${resp} RequestsLibrary.Get session ${REST_CONTEXT}
47 Should Be Equal As Strings ${resp.status_code} 200
48 : FOR ${IND} IN RANGE 1 ${numnodes+1}
49 \ Should Contain ${resp.content} openflow:${IND}
51 Check Every Nodes Stats
52 [Arguments] ${numnodes}
53 : FOR ${IND} IN RANGE 1 ${numnodes+1}
54 \ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/node/openflow:${IND}
56 \ Should Be Equal As Strings ${resp.status_code} 200
57 \ Should Contain ${resp.content} flow-capable-node-connector-statistics
58 \ Should Contain ${resp.content} flow-table-statistics
60 Check Every Nodes Nodeconnector
61 [Arguments] ${numnodes}
62 : FOR ${IND} IN RANGE 2 ${numnodes+1}
63 \ ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/node/openflow:${IND}
65 \ Should Be Equal As Strings ${resp.status_code} 200
66 \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content}
69 [Arguments] ${arg} ${outerind} ${content}
70 : FOR ${var} IN RANGE 1 ${arg+1}
71 \ Should Contain ${content} openflow:${outerind}:${var}