2 Documentation Test suite for Statistics Manager
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
6 Library RequestsLibrary
7 Library ../../../libraries/Common.py
8 Library ../../../libraries/Topologynew.py
9 Variables ../../../variables/Variables.py
10 Resource ../../../libraries/Utils.robot
13 ${nodeprefix} openflow:
15 ${REST_CONTEXT} /controller/nb/v2/statistics
19 [Documentation] Show port stats and validate result
21 ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT}) 1
22 @{node_list} Create Nodes List ${topo_nodes}
23 Wait Until Keyword Succeeds 70s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/port ${node_list}
26 [Documentation] Show flow stats and validate result
28 ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
29 @{node_list} Create Nodes List ${topo_nodes}
30 Wait Until Keyword Succeeds 70s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/flow ${node_list}
33 [Documentation] Show flow stats and validate result
35 ${topo_nodes} Get Nodes From Tree Topo (${TOPO_TREE_DEPTH},${TOPO_TREE_FANOUT})
36 @{node_list} Create Nodes List ${topo_nodes}
37 Wait Until Keyword Succeeds 70s 2s Check For Elements At URI ${REST_CONTEXT}/${CONTAINER}/table ${node_list}
40 Check For Correct Number Of Nodes At URI
41 [Arguments] ${uri} ${topo_nodes}
42 ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}/${uri}
44 Should Be Equal As Strings ${resp.status_code} 200
45 Should Contain X Times ${resp.content} "00:00:00:00:00:00:00:01" ${TOPO_TREE_FANOUT+2}
46 : FOR ${ITEM} IN @{topo_nodes}
47 \ ${IND} Get From Dictionary ${ITEM} id
48 \ Should Contain X Times ${resp.content} "${IND}" ${TOPO_TREE_FANOUT+3}
50 Check For All Nodes At URI
51 [Arguments] ${uri} ${topo_nodes}
52 ${resp} RequestsLibrary.Get session ${REST_CONTEXT}/${CONTAINER}/${uri}
54 Should Be Equal As Strings ${resp.status_code} 200
55 : FOR ${ITEM} IN @{topo_nodes}
56 \ ${IND} Get From Dictionary ${ITEM} id
57 \ Should Contain ${resp.content} "${IND}"
60 [Arguments] ${topo_dict}
62 @{node_list}= Create List
63 : FOR ${ITEM} IN @{topo_dict}
64 \ ${IND} Get From Dictionary ${ITEM} id
65 \ Append To List ${node_list} ${IND}