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} ${ODL_SYSTEM_IP}
23 ${start_cmd} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
24 ${getf_cmd} sh ./get-total-found.sh
25 ${getr_cmd} sh ./get-total-reported.sh
29 ${ratefile} stats_rate.csv
30 ${timefile} stats_time.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 Request 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 ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=600
97 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
98 Execute Command sudo ovs-vsctl set-manager ptcp:6644
99 Execute Command sudo mn -c
102 Comment Below line disables switch echos
103 Write 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
105 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
107 Create Http Session And Upload Files
108 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
109 Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=600
110 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
111 Put File ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/* ./
115 [Documentation] Stops mininet
119 Read Until ${DEFAULT_LINUX_PROMPT}
122 Delete Http Session And Store Plot Data
124 ${initrate}= Evaluate (${flnr}/${inittime})
125 ${restartrate}= Evaluate (${flnr}/${restarttime})
126 Append To File ${ratefile} Initial,AfterMininetRestart\n
127 Append To File ${ratefile} ${initrate},${restartrate}\n
128 Append To File ${timefile} Initial,AfterMininetRestart\n
129 Append To File ${timefile} ${inittime},${restarttime}\n
131 Are Switches Connected Topo
132 [Documentation] Checks wheather switches are connected to controller
133 ${resp}= Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
135 ${count}= Get Element Count ${resp.content} xpath=node
136 Should Be Equal As Numbers ${count} ${swnr}
138 Check Flows Inventory
139 [Arguments] ${rswitches} ${rflows}
140 [Documentation] Checks in inventory has required state
141 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${ODL_SYSTEM_IP}
142 Should Be Equal As Numbers ${rswitches} ${sw}
143 Should Be Equal As Numbers ${rflows} ${foundf}
146 [Arguments] ${rswitches} ${rflows} ${note}
147 [Documentation] This keyword is dedicated to save measured time for plotting
148 ${starttime}= Get Time epoch
149 Log Starting stats collection at time ${starttime}
150 Inventory Change Reached ${rswitches} ${rflows}
151 [Teardown] Save Setup Time ${note} ${starttime}
154 [Arguments] ${note} ${starttime}
155 [Documentation] Count the difference and stores it
156 ${endtime}= Get Time epoch
157 Log Stats collection finished at time ${endtime}
158 ${res}= Evaluate int(${endtime})-int(${starttime})
159 ${inittime}= Set Variable If "${note}"=="inittime" ${res} ${inittime}
160 ${restarttime}= Set Variable If "${note}"=="restarttime" ${res} ${restarttime}
161 ${setuptime}= Set Variable If "${note}"=="setuptime" ${res} ${setuptime}
162 Set Suite Variable ${inittime}
163 Set Suite Variable ${restarttime}
164 Set Suite Variable ${setuptime}
166 Inventory Change Reached
167 [Arguments] ${rswitches} ${rflows}
168 [Documentation] This keywordwaits till inventory reaches required state
169 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
172 [Arguments] ${rswitches} ${rflows}
173 [Documentation] This keywordwaits till inventory reaches required state
174 Verify Keyword Does Not Fail Within Timeout ${imonitor} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
178 ${log}= Read Until mininet>
181 ${log}= Read Until mininet>