2 Documentation Suite checks if StatMngr is able to collect flows correctly
3 Suite Setup Create Http Session
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} ${CONTROLLER}
24 ${start_cmd} sudo mn --controller=remote,ip=${CONTROLLER} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
27 ${outfile} flows_setup_time.csv
35 [Documentation] Setup of ${flnr} flows using rpc calls
36 [Teardown] SaveSetupTime
37 ${flows} ${notes}= Generate New Flow Details flows=${flnr} switches=${swnr} swspread=${swspread} tabspread=${tabspread}
39 ${starttime}= Get Time epoch
40 ${res}= Operations Add Flows Rpc flow_details=${flows} controllers=@{cntls} nrthreads=${nrthreads} fpr=${fpr}
42 Set Suite Variable ${flows}
46 [Documentation] Waits till ${flnr} flows are initially collected
47 Inventory Change Reached ${swnr} ${flnr}
50 [Documentation] Flows deconfiguration
51 ${res}= Operations Remove Flows Rpc flow_details=${flows} controllers=@{cntls} nrthreads=${nrthreads} fpr=${fpr}
54 Check No Flows In Operational After Remove
55 [Documentation] No flows should be found after their removeal
56 Inventory Change Reached ${swnr} 0
63 [Documentation] Starts mininet with requested number of switches (${swnr})
64 Log Starting mininet with ${swnr} switches
65 Open Connection ${MININET} prompt=${linux_prompt} timeout=600
66 Login With Public Key ${MININET_USER} ${USER_HOME}/.ssh/id_rsa any
67 Execute Command sudo ovs-vsctl set-manager ptcp:6644
68 Execute Command sudo mn -c
71 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
74 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
77 [Documentation] Stops mininet
81 Read Until ${linux_prompt}
84 Delete Http Session And Store Plot Data
86 Append To File ${outfile} FlowsSetupTime\n
87 Append To File ${outfile} ${setuptime}\n
89 Are Switches Connected Topo
90 [Documentation] Checks wheather switches are connected to controller
91 ${resp}= Get session ${OPERATIONAL_TOPO_API}/topology/flow:1 headers=${ACCEPT_XML}
93 ${count}= Get Element Count ${resp.content} xpath=node
94 Should Be Equal As Numbers ${count} ${swnr}
97 [Arguments] ${rswitches} ${rflows}
98 [Documentation] Checks in inventory has required state
99 ${sw} ${repf} ${foundf}= Flow Stats Collected controller=${CONTROLLER}
100 Should Be Equal As Numbers ${rswitches} ${sw}
101 Should Be Equal As Numbers ${rflows} ${foundf}
104 [Documentation] Count the difference and stores it
105 ${endtime}= Get Time epoch
106 Log Stats collection finished at time ${endtime}
107 ${setuptime}= Evaluate int(${endtime})-int(${starttime})
108 Set Suite Variable ${setuptime}
110 Inventory Change Reached
111 [Arguments] ${rswitches} ${rflows}
112 [Documentation] This keywordwaits till inventory reaches required state
113 Wait Until Keyword Succeeds ${ichange} ${iperiod} Check Flows Inventory ${rswitches} ${rflows}