2 Documentation Suite checks if StatMngr is able to collect flows correctly
3 Suite Setup Create Http Session And Upload Files
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
25 ${getf_cmd} sh ./get-total-found.sh
26 ${getr_cmd} sh ./get-total-reported.sh
30 ${outfile} flows_setup_time.csv
31 ${setupfile} flows_install_rate.csv
41 [Documentation] Configuration of ${flnr} flows into config datastore
42 ${flows} ${notes}= Generate New Flow Details flows=${flnr} switches=${swnr} swspread=${swspread} tabspread=${tabspread}
44 ${starttime}= Get Time epoch
45 ${res}= Configure Flows Bulk flow_details=${flows} controllers=@{cntls} nrthreads=${nrthreads} fpr=${fpr}
47 Set Suite Variable ${flows}
48 ${http204ok}= Create List ${204}
49 ${validation}= Validate Responses ${res} ${http204ok}
50 Should Be True ${validation}
51 [Teardown] Save Setup Time setuptime
54 [Documentation] Waits till ${flnr} flows are initially collected
55 Measure Setup Time ${swnr} ${flnr} inittime
56 [Teardown] Log Switch Details
58 Stable State Monitoring
59 [Documentation] Inventory check if all ${flnr} flows are present for specified time frame
60 Monitor Stable State ${swnr} ${flnr}
61 [Teardown] Log Switch Details
64 [Documentation] Disconnect/Stop mininet
67 Check No Flows In Operational After Disconnect
68 [Documentation] With mininet stopped no switches in operational datastore sould be found
69 Inventory Change Reached 0 0
72 [Documentation] Reconnection of the mininet
75 Check Flows Are Operational Again
76 [Documentation] All ${flnr} slows should be present in the operational datastore after mininet reconnection
77 Measure Setup Time ${swnr} ${flnr} restarttime
78 [Teardown] Log Switch Details
81 [Documentation] Flows deconfiguration
82 ${resp}= Delete session ${CONFIG_NODES_API}
83 Should Be Equal As Numbers ${resp.status_code} 200
85 Check No Flows In Operational Last
86 [Documentation] Operational datastore to be without any flows
87 Inventory Change Reached ${swnr} 0
88 [Teardown] Log Switch Details
95 [Documentation] Starts mininet with requested number of switches (${swnr})
96 Log Starting mininet with ${swnr} switches
97 Open Connection ${MININET} prompt=${linux_prompt} timeout=600
98 Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
99 Execute Command sudo ovs-vsctl set-manager ptcp:6644
100 Execute Command sudo mn -c
103 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
105 Create Http Session And Upload Files
106 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
107 Open Connection ${MININET} prompt=${linux_prompt} timeout=600
108 Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
109 Put File ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/* ./
113 [Documentation] Stops mininet
117 Read Until ${linux_prompt}
120 Delete Http Session And Store Plot Data
122 Append To File ${outfile} InitCollectionTime,AfterMininetRestartCollectionTime\n
123 Append To File ${outfile} ${inittime},${restarttime}\n
124 ${rate}= Evaluate (${flnr}/${setuptime})
125 Append To File ${setupfile} FlowsSetupRate,FlowsSetupTime\n
126 Append To File ${setupfile} ${rate},${setuptime}\n
128 Are Switches Connected Topo
129 [Documentation] Checks wheather switches are connected to controller
130 ${resp}= Get session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
132 ${count}= Get Element Count ${resp.content} xpath=node
133 Should Be Equal As Numbers ${count} ${swnr}
135 Check Flows Inventory
136 [Arguments] ${rswitches} ${rflows}
137 [Documentation] Checks in inventory has required state
138 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${CONTROLLER}
139 Should Be Equal As Numbers ${rswitches} ${sw}
140 Should Be Equal As Numbers ${rflows} ${foundf}
143 [Arguments] ${rswitches} ${rflows} ${note}
144 [Documentation] This keyword is dedicated to save measured time for plotting
145 ${starttime}= Get Time epoch
146 Log Starting stats collection at time ${starttime}
147 Set Suite Variable ${starttime}
148 Inventory Change Reached ${rswitches} ${rflows}
149 [Teardown] Save Setup Time ${note}
153 [Documentation] Count the difference and stores it
154 ${endtime}= Get Time epoch
155 Log Stats collection finished at time ${endtime}
156 ${res}= Evaluate int(${endtime})-int(${starttime})
157 ${inittime}= Set Variable If "${note}"=="inittime" ${res} ${inittime}
158 ${restarttime}= Set Variable If "${note}"=="restarttime" ${res} ${restarttime}
159 ${setuptime}= Set Variable If "${note}"=="setuptime" ${res} ${setuptime}
160 Set Suite Variable ${inittime}
161 Set Suite Variable ${restarttime}
162 Set Suite Variable ${setuptime}
164 Inventory Change Reached
165 [Arguments] ${rswitches} ${rflows}
166 [Documentation] This keywordwaits till inventory reaches required state
167 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
170 [Arguments] ${rswitches} ${rflows}
171 [Documentation] This keywordwaits till inventory reaches required state
172 Verify Keyword Does Not Fail Within Timeout ${imonitor} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
176 ${log}= Read Until mininet>
179 ${log}= Read Until mininet>