2 Documentation Suite to measure flow setup rate using operation add-flows-ds
4 Library OperatingSystem
7 Variables ../../../variables/Variables.py
8 Library RequestsLibrary
9 Library ../../../libraries/Common.py
10 Library ../../../libraries/ScaleClient.py
12 Suite Setup Create Http Session And Upload Files
13 Suite Teardown Delete Http Session And Store Plot Data
23 @{cntls} ${ODL_SYSTEM_IP}
25 ... sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
26 ${getf_cmd} sh ./get-total-found.sh
27 ${getr_cmd} sh ./get-total-reported.sh
30 ${outfile} flows_setup_time.csv
39 [Documentation] Setup of ${flnr} flows using add-flows-ds operation
40 ${flows} ${notes}= Generate New Flow Details
43 ... swspread=${swspread}
44 ... tabspread=${tabspread}
46 ${starttime}= Get Time epoch
47 ${res}= Operations Add Flows Ds
48 ... flow_details=${flows}
49 ... controllers=@{cntls}
50 ... nrthreads=${nrthreads}
53 Set Suite Variable ${flows}
54 ${http200ok}= Create List ${200}
55 ${validation}= Validate Responses ${res} ${http200ok}
56 Should Be True ${validation}
57 [Teardown] Save Setup Time ${starttime}
60 [Documentation] Waits till ${flnr} flows are initially collected
61 Inventory Change Reached ${swnr} ${flnr}
62 [Teardown] Log Switch Details
65 [Documentation] Flows deconfiguration
66 ${res}= Operations Remove Flows Ds
67 ... flow_details=${flows}
68 ... controllers=@{cntls}
69 ... nrthreads=${nrthreads}
72 ${http200ok}= Create List ${200}
73 ${validation}= Validate Responses ${res} ${http200ok}
74 Should Be True ${validation}
76 Check No Flows In Operational After Remove
77 [Documentation] No flows should be found after their removeal
78 Inventory Change Reached ${swnr} 0
79 [Teardown] Log Switch Details
87 [Documentation] Starts mininet with requested number of switches (${swnr})
88 Log Starting mininet with ${swnr} switches
89 Open Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT} timeout=600
90 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
91 Execute Command sudo ovs-vsctl set-manager ptcp:6644
92 Execute Command sudo mn -c
95 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
97 Create Http Session And Upload Files
98 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
99 Open Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT} timeout=600
100 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
101 Put File ${CURDIR}/../../../../tools/odl-mdsal-clustering-tests/clustering-performance-test/ovs-scripts/* ./
105 [Documentation] Stops mininet
109 Read Until ${TOOLS_SYSTEM_PROMPT}
112 Delete Http Session And Store Plot Data
114 ${rate}= Evaluate (${flnr}/${setuptime})
115 Append To File ${outfile} FlowsSetupRate,FlowsSetupTime\n
116 Append To File ${outfile} ${rate},${setuptime}\n
118 Are Switches Connected Topo
119 [Documentation] Checks wheather switches are connected to controller
120 ${resp}= Get Request session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
122 ${count}= Get Element Count ${resp.content} xpath=node
123 Should Be Equal As Numbers ${count} ${swnr}
125 Check Flows Inventory
126 [Documentation] Checks in inventory has required state
127 [Arguments] ${rswitches} ${rflows}
128 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${ODL_SYSTEM_IP}
129 Should Be Equal As Numbers ${rswitches} ${sw}
130 Should Be Equal As Numbers ${rflows} ${foundf}
133 [Documentation] Count the difference and stores it
134 [Arguments] ${starttime}
135 ${endtime}= Get Time epoch
136 Log Stats collection finished at time ${endtime}
137 ${setuptime}= Evaluate int(${endtime})-int(${starttime})
138 Set Suite Variable ${setuptime}
140 Inventory Change Reached
141 [Documentation] This keywordwaits till inventory reaches required state
142 [Arguments] ${rswitches} ${rflows}
143 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}
147 ${log}= Read Until mininet>
150 ${log}= Read Until mininet>