2 Documentation Suite checks if StatMngr is able to collect flows correctly
3 Suite Setup Create Http Session
4 Suite Teardown Delete Http Session
5 Library OperatingSystem
9 Variables ../../../variables/Variables.py
10 Library RequestsLibrary
11 Library ../../../libraries/Common.py
12 Library ../../../libraries/ScaleClient.py
13 Resource ../../../libraries/WaitForFailure.robot
21 @{cntls} ${CONTROLLER}
23 ${start_cmd} sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
33 [Documentation] Configuration of ${flnr} flows into config datastore
34 ${flows} ${notes}= Generate New Flow Details flows=${flnr} switches=${swnr} swspread=${swspread} tabspread=${tabspread}
36 ${res}= Configure Flows Bulk flow_details=${flows} controllers=@{cntls} nrthreads=5 fpr=${fpr}
38 Set Suite Variable ${flows}
41 [Documentation] Waits till ${flnr} flows are initially collected
42 Inventory Change Reached ${swnr} ${flnr}
44 Stable State Monitoring
45 [Documentation] Inventory check if all ${flnr} flows are present for specified time frame
46 Monitor Stable State ${swnr} ${flnr}
49 [Documentation] Disconnect/Stop mininet
52 Check No Flows In Operational After Disconnect
53 [Documentation] With mininet stopped no switches in operational datastore sould be found
54 Inventory Change Reached 0 0
57 [Documentation] Reconnection of the mininet
60 Check Flows Are Operational Again
61 [Documentation] All ${flnr} slows should be present in the operational datastore after mininet reconnection
62 Inventory Change Reached ${swnr} ${flnr}
65 [Documentation] Flows deconfiguration
66 ${resp}= Delete session ${CONFIG_NODES_API}
67 Should Be Equal As Numbers ${resp.status_code} 200
69 Check No Flows In Operational Last
70 [Documentation] Operational datastore to be without any flows
71 Inventory Change Reached ${swnr} 0
78 [Documentation] Starts mininet with requested number of switches (${swnr})
79 Log Starting mininet with ${swnr} switches
80 Open Connection ${MININET} prompt=${linux_prompt} timeout=600
81 Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
82 Execute Command sudo ovs-vsctl set-manager ptcp:6644
83 Execute Command sudo mn -c
86 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
89 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
92 [Documentation] Stops mininet
96 Read Until ${linux_prompt}
102 Are Switches Connected Topo
103 [Documentation] Checks wheather switches are connected to controller
104 ${resp}= Get session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
106 ${count}= Get Element Count ${resp.content} xpath=node
107 Should Be Equal As Numbers ${count} ${swnr}
109 Check Flows Inventory
110 [Arguments] ${rswitches} ${rflows}
111 [Documentation] Checks in inventory has required state
112 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${CONTROLLER}
113 Should Be Equal As Numbers ${rswitches} ${sw}
114 Should Be Equal As Numbers ${rflows} ${foundf}
116 Inventory Change Reached
117 [Arguments] ${rswitches} ${rflows}
118 [Documentation] This keywordwaits till inventory reaches required state
119 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
122 [Arguments] ${rswitches} ${rflows}
123 [Documentation] This keywordwaits till inventory reaches required state
124 Verify Keyword Does Not Fail Within Timeout ${imonitor} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}