2 Documentation Suite to measure flow setup rate using operation add-flows-ds
3 Suite Setup Create Http Session
4 Suite Teardown Delete Http Session And Store Plot Data
5 Library OperatingSystem
8 Variables ../../../variables/Variables.py
9 Library RequestsLibrary
10 Library ../../../libraries/Common.py
11 Library ../../../libraries/ScaleClient.py
20 @{cntls} ${CONTROLLER}
22 ${start_cmd} sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
25 ${outfile} flows_setup_time.csv
33 [Documentation] Setup of ${flnr} flows using add-flows-ds operation
34 ${flows} ${notes}= Generate New Flow Details flows=${flnr} switches=${swnr} swspread=${swspread} tabspread=${tabspread}
36 ${starttime}= Get Time epoch
37 ${res}= Operations Add Flows Ds flow_details=${flows} controllers=@{cntls} nrthreads=${nrthreads} fpr=${fpr}
39 Set Suite Variable ${flows}
40 ${http200ok}= Create List ${200}
41 ${validation}= Validate Responses ${res} ${http200ok}
42 Should Be True ${validation}
43 [Teardown] SaveSetupTime
46 [Documentation] Waits till ${flnr} flows are initially collected
47 Inventory Change Reached ${swnr} ${flnr}
50 [Documentation] Flows deconfiguration
51 ${res}= Operations Remove Flows Ds flow_details=${flows} controllers=@{cntls} nrthreads=${nrthreads} fpr=${fpr}
53 ${http200ok}= Create List ${200}
54 ${validation}= Validate Responses ${res} ${http200ok}
55 Should Be True ${validation}
57 Check No Flows In Operational After Remove
58 [Documentation] No flows should be found after their removeal
59 Inventory Change Reached ${swnr} 0
66 [Documentation] Starts mininet with requested number of switches (${swnr})
67 Log Starting mininet with ${swnr} switches
68 Open Connection ${MININET} prompt=${linux_prompt} timeout=600
69 Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
70 Execute Command sudo ovs-vsctl set-manager ptcp:6644
71 Execute Command sudo mn -c
74 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
77 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
80 [Documentation] Stops mininet
84 Read Until ${linux_prompt}
87 Delete Http Session And Store Plot Data
89 ${rate}= Evaluate (${flnr}/${setuptime})
90 Append To File ${outfile} FlowsSetupRate,FlowsSetupTime\n
91 Append To File ${outfile} ${rate},${setuptime}\n
93 Are Switches Connected Topo
94 [Documentation] Checks wheather switches are connected to controller
95 ${resp}= Get session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
97 ${count}= Get Element Count ${resp.content} xpath=node
98 Should Be Equal As Numbers ${count} ${swnr}
100 Check Flows Inventory
101 [Arguments] ${rswitches} ${rflows}
102 [Documentation] Checks in inventory has required state
103 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${CONTROLLER}
104 Should Be Equal As Numbers ${rswitches} ${sw}
105 Should Be Equal As Numbers ${rflows} ${foundf}
108 [Documentation] Count the difference and stores it
109 ${endtime}= Get Time epoch
110 Log Stats collection finished at time ${endtime}
111 ${setuptime}= Evaluate int(${endtime})-int(${starttime})
112 Set Suite Variable ${setuptime}
114 Inventory Change Reached
115 [Arguments] ${rswitches} ${rflows}
116 [Documentation] This keywordwaits till inventory reaches required state
117 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}