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