2 Documentation Test suite for RESTCONF inventory
3 Suite Setup Create Session session http://${ODL_SYSTEM_IP}:${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 Request 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 Request 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}
52 Check Every Nodes Stats
53 [Arguments] ${numnodes}
54 FOR ${IND} IN RANGE 1 ${numnodes+1}
55 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
57 Should Be Equal As Strings ${resp.status_code} 200
58 Should Contain ${resp.content} flow-capable-node-connector-statistics
59 Should Contain ${resp.content} flow-table-statistics
62 Check Every Nodes Nodeconnector
63 [Arguments] ${numnodes}
64 FOR ${IND} IN RANGE 2 ${numnodes+1}
65 ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND}
67 Should Be Equal As Strings ${resp.status_code} 200
68 Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content}
72 [Arguments] ${arg} ${outerind} ${content}
73 FOR ${var} IN RANGE 1 ${arg+1}
74 Should Contain ${content} openflow:${outerind}:${var}