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 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
104 Create Http Session And Upload Files
105 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
106 Open Connection ${TOOLS_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT} timeout=600
107 Login With Public Key ${TOOLS_SYSTEM_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 ${initrate}= Evaluate (${flnr}/${inittime})
122 ${restartrate}= Evaluate (${flnr}/${restarttime})
123 Append To File ${ratefile} Initial,AfterMininetRestart\n
124 Append To File ${ratefile} ${initrate},${restartrate}\n
125 Append To File ${timefile} Initial,AfterMininetRestart\n
126 Append To File ${timefile} ${inittime},${restarttime}\n
128 Are Switches Connected Topo
129 [Documentation] Checks wheather switches are connected to controller
130 ${resp}= Get Request 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=${ODL_SYSTEM_IP}
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 Inventory Change Reached ${rswitches} ${rflows}
148 [Teardown] Save Setup Time ${note} ${starttime}
151 [Arguments] ${note} ${starttime}
152 [Documentation] Count the difference and stores it
153 ${endtime}= Get Time epoch
154 Log Stats collection finished at time ${endtime}
155 ${res}= Evaluate int(${endtime})-int(${starttime})
156 ${inittime}= Set Variable If "${note}"=="inittime" ${res} ${inittime}
157 ${restarttime}= Set Variable If "${note}"=="restarttime" ${res} ${restarttime}
158 ${setuptime}= Set Variable If "${note}"=="setuptime" ${res} ${setuptime}
159 Set Suite Variable ${inittime}
160 Set Suite Variable ${restarttime}
161 Set Suite Variable ${setuptime}
163 Inventory Change Reached
164 [Arguments] ${rswitches} ${rflows}
165 [Documentation] This keywordwaits till inventory reaches required state
166 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
169 [Arguments] ${rswitches} ${rflows}
170 [Documentation] This keywordwaits till inventory reaches required state
171 Verify Keyword Does Not Fail Within Timeout ${imonitor} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
175 ${log}= Read Until mininet>
178 ${log}= Read Until mininet>