2 Documentation Suite checks if StatMngr is able to collect flows correctly
3 Suite Setup Create Http Session
4 Suite Teardown Delete Http Session And Store Plot Data
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
22 @{cntls} ${CONTROLLER}
24 ${start_cmd} sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
28 ${outfile} flows_setup_time.csv
29 ${setupfile} flows_install_rate.csv
39 [Documentation] Configuration of ${flnr} flows into config datastore
40 ${flows} ${notes}= Generate New Flow Details flows=${flnr} switches=${swnr} swspread=${swspread} tabspread=${tabspread}
42 ${starttime}= Get Time epoch
43 ${res}= Configure Flows Bulk flow_details=${flows} controllers=@{cntls} nrthreads=${nrthreads} fpr=${fpr}
45 Set Suite Variable ${flows}
46 ${http204ok}= Create List ${204}
47 ${validation}= Validate Responses ${res} ${http204ok}
48 Should Be True ${validation}
49 [Teardown] Save Setup Time setuptime
52 [Documentation] Waits till ${flnr} flows are initially collected
53 Measure Setup Time ${swnr} ${flnr} inittime
55 Stable State Monitoring
56 [Documentation] Inventory check if all ${flnr} flows are present for specified time frame
57 Monitor Stable State ${swnr} ${flnr}
60 [Documentation] Disconnect/Stop mininet
63 Check No Flows In Operational After Disconnect
64 [Documentation] With mininet stopped no switches in operational datastore sould be found
65 Inventory Change Reached 0 0
68 [Documentation] Reconnection of the mininet
71 Check Flows Are Operational Again
72 [Documentation] All ${flnr} slows should be present in the operational datastore after mininet reconnection
73 Measure Setup Time ${swnr} ${flnr} restarttime
76 [Documentation] Flows deconfiguration
77 ${resp}= Delete session ${CONFIG_NODES_API}
78 Should Be Equal As Numbers ${resp.status_code} 200
80 Check No Flows In Operational Last
81 [Documentation] Operational datastore to be without any flows
82 Inventory Change Reached ${swnr} 0
89 [Documentation] Starts mininet with requested number of switches (${swnr})
90 Log Starting mininet with ${swnr} switches
91 Open Connection ${MININET} prompt=${linux_prompt} timeout=600
92 Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
93 Execute Command sudo ovs-vsctl set-manager ptcp:6644
94 Execute Command sudo mn -c
97 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
100 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
103 [Documentation] Stops mininet
107 Read Until ${linux_prompt}
110 Delete Http Session And Store Plot Data
112 Append To File ${outfile} InitCollectionTime,AfterMininetRestartCollectionTime\n
113 Append To File ${outfile} ${inittime},${restarttime}\n
114 ${rate}= Evaluate (${flnr}/${setuptime})
115 Append To File ${setupfile} FlowsSetupRate,FlowsSetupTime\n
116 Append To File ${setupfile} ${rate},${setuptime}\n
118 Are Switches Connected Topo
119 [Documentation] Checks wheather switches are connected to controller
120 ${resp}= Get session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
122 ${count}= Get Element Count ${resp.content} xpath=node
123 Should Be Equal As Numbers ${count} ${swnr}
125 Check Flows Inventory
126 [Arguments] ${rswitches} ${rflows}
127 [Documentation] Checks in inventory has required state
128 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${CONTROLLER}
129 Should Be Equal As Numbers ${rswitches} ${sw}
130 Should Be Equal As Numbers ${rflows} ${foundf}
133 [Arguments] ${rswitches} ${rflows} ${note}
134 [Documentation] This keyword is dedicated to save measured time for plotting
135 ${starttime}= Get Time epoch
136 Log Starting stats collection at time ${starttime}
137 Set Suite Variable ${starttime}
138 Inventory Change Reached ${rswitches} ${rflows}
139 [Teardown] Save Setup Time ${note}
143 [Documentation] Count the difference and stores it
144 ${endtime}= Get Time epoch
145 Log Stats collection finished at time ${endtime}
146 ${res}= Evaluate int(${endtime})-int(${starttime})
147 ${inittime}= Set Variable If "${note}"=="inittime" ${res} ${inittime}
148 ${restarttime}= Set Variable If "${note}"=="restarttime" ${res} ${restarttime}
149 ${setuptime}= Set Variable If "${note}"=="setuptime" ${res} ${setuptime}
150 Set Suite Variable ${inittime}
151 Set Suite Variable ${restarttime}
152 Set Suite Variable ${setuptime}
154 Inventory Change Reached
155 [Arguments] ${rswitches} ${rflows}
156 [Documentation] This keywordwaits till inventory reaches required state
157 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
160 [Arguments] ${rswitches} ${rflows}
161 [Documentation] This keywordwaits till inventory reaches required state
162 Verify Keyword Does Not Fail Within Timeout ${imonitor} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}