2 Documentation Suite checks if StatMngr is able to collect flows correctly
4 Library OperatingSystem
8 Variables ../../../variables/Variables.py
9 Library RequestsLibrary
10 Library ../../../libraries/Common.py
11 Library ../../../libraries/ScaleClient.py
12 Resource ../../../libraries/WaitForFailure.robot
13 Resource ../../../variables/openflowplugin/Variables.robot
15 Suite Setup Create Http Session And Upload Files
16 Suite Teardown Delete Http Session And Store Plot Data
26 @{cntls} ${ODL_SYSTEM_IP}
28 ... sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
29 ${getf_cmd} sh ./get-total-found.sh
30 ${getr_cmd} sh ./get-total-reported.sh
34 ${ratefile} stats_rate.csv
35 ${timefile} stats_time.csv
46 [Documentation] Configuration of ${flnr} flows into config datastore
47 ${flows} ${notes}= Generate New Flow Details
50 ... swspread=${swspread}
51 ... tabspread=${tabspread}
53 ${starttime}= Get Time epoch
54 ${res}= Configure Flows Bulk
55 ... flow_details=${flows}
56 ... controllers=@{cntls}
57 ... nrthreads=${nrthreads}
60 Set Suite Variable ${flows}
61 ${http201ok}= Create List ${201}
62 ${validation}= Validate Responses ${res} ${http201ok}
63 Should Be True ${validation}
64 [Teardown] Save Setup Time setuptime ${starttime}
67 [Documentation] Waits till ${flnr} flows are initially collected
68 Measure Setup Time ${swnr} ${flnr} inittime
69 [Teardown] Log Switch Details
71 Stable State Monitoring
72 [Documentation] Inventory check if all ${flnr} flows are present for specified time frame
73 Monitor Stable State ${swnr} ${flnr}
74 [Teardown] Log Switch Details
77 [Documentation] Disconnect/Stop mininet
80 Check No Flows In Operational After Disconnect
81 [Documentation] With mininet stopped no switches in operational datastore sould be found
82 Inventory Change Reached 0 0
85 [Documentation] Reconnection of the mininet
88 Check Flows Are Operational Again
89 [Documentation] All ${flnr} slows should be present in the operational datastore after mininet reconnection
90 Measure Setup Time ${swnr} ${flnr} restarttime
91 [Teardown] Log Switch Details
94 [Documentation] Flows deconfiguration
95 ${resp}= DELETE On Session session url=${RFC8040_NODES_API} expected_status=204
97 Check No Flows In Operational Last
98 [Documentation] Operational datastore to be without any flows
99 Inventory Change Reached ${swnr} 0
100 [Teardown] Log Switch Details
108 [Documentation] Starts mininet with requested number of switches (${swnr})
109 Log Starting mininet with ${swnr} switches
110 Open Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT} timeout=600
111 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
112 Execute Command sudo ovs-vsctl set-manager ptcp:6644
113 Execute Command sudo mn -c
116 Comment Below line disables switch echos
118 ... sh x=`sudo ovs-vsctl --columns=_uuid list Controller | awk '{print $NF}'`; for i in $x; do sudo ovs-vsctl set Controller $i inactivity_probe=0; done
120 Wait Until Keyword Succeeds 20s 1s Are Switches Connected Topo
122 Create Http Session And Upload Files
123 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
124 Open Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT} timeout=600
125 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
126 Put File ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/* ./
130 [Documentation] Stops mininet
134 Read Until ${TOOLS_SYSTEM_PROMPT}
137 Delete Http Session And Store Plot Data
139 ${initrate}= Evaluate (${flnr}/${inittime})
140 ${restartrate}= Evaluate (${flnr}/${restarttime})
141 Append To File ${ratefile} Initial,AfterMininetRestart\n
142 Append To File ${ratefile} ${initrate},${restartrate}\n
143 Append To File ${timefile} Initial,AfterMininetRestart\n
144 Append To File ${timefile} ${inittime},${restarttime}\n
146 Are Switches Connected Topo
147 [Documentation] Checks wheather switches are connected to controller
148 ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
150 ${count}= Get Element Count ${resp.content} xpath=node
151 Should Be Equal As Numbers ${count} ${swnr}
153 Check Flows Inventory
154 [Documentation] Checks in inventory has required state
155 [Arguments] ${rswitches} ${rflows}
156 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${ODL_SYSTEM_IP}
157 Should Be Equal As Numbers ${rswitches} ${sw}
158 Should Be Equal As Numbers ${rflows} ${foundf}
161 [Documentation] This keyword is dedicated to save measured time for plotting
162 [Arguments] ${rswitches} ${rflows} ${note}
163 ${starttime}= Get Time epoch
164 Log Starting stats collection at time ${starttime}
165 Inventory Change Reached ${rswitches} ${rflows}
166 [Teardown] Save Setup Time ${note} ${starttime}
169 [Documentation] Count the difference and stores it
170 [Arguments] ${note} ${starttime}
171 ${endtime}= Get Time epoch
172 Log Stats collection finished at time ${endtime}
173 ${res}= Evaluate int(${endtime})-int(${starttime})
174 ${inittime}= Set Variable If "${note}"=="inittime" ${res} ${inittime}
175 ${restarttime}= Set Variable If "${note}"=="restarttime" ${res} ${restarttime}
176 ${setuptime}= Set Variable If "${note}"=="setuptime" ${res} ${setuptime}
177 Set Suite Variable ${inittime}
178 Set Suite Variable ${restarttime}
179 Set Suite Variable ${setuptime}
181 Inventory Change Reached
182 [Documentation] This keywordwaits till inventory reaches required state
183 [Arguments] ${rswitches} ${rflows}
184 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
187 [Documentation] This keywordwaits till inventory reaches required state
188 [Arguments] ${rswitches} ${rflows}
189 Verify Keyword Does Not Fail Within Timeout
192 ... Check Flows Inventory
198 ${log}= Read Until mininet>
201 ${log}= Read Until mininet>