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