2 Documentation Suite checks if StatMngr is able to collect flows correctly
4 Library OperatingSystem
8 Variables ../../../variables/Variables.py
9 Library RequestsLibrary
10 Library ../../../libraries/Common.py
11 Library ../../../libraries/ScaleClient.py
12 Resource ../../../variables/openflowplugin/Variables.robot
14 Suite Setup Create Http Session
15 Suite Teardown Delete Http Session
23 @{cntls} ${ODL_SYSTEM_IP}
25 ... sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
33 [Documentation] Configuration of 16k flows into config datastore
34 ${flows} ${notes}= Generate New Flow Details
37 ... swspread=${swspread}
38 ... tabspread=${tabspread}
40 ${res}= Configure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
42 Set Suite Variable ${flows}
45 [Documentation] Operational datastore check if all flows are present there
46 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${flows} ${ODL_SYSTEM_IP}
49 [Documentation] Removal of 16k flows from config datastore
50 ${res}= Deconfigure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
53 Check No Flows In Operational
54 [Documentation] Operational datastore to be without any flows
55 ${noflows}= Create List
56 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${noflows} ${ODL_SYSTEM_IP}
59 [Documentation] Configuration of 16k flows into config datastore again
60 ${res}= Configure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
63 Are Flows Operational Again
64 [Documentation] Operational datastore check if all flows are present there
65 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${flows} ${ODL_SYSTEM_IP}
68 [Documentation] Disconnect/Stop mininet
71 Check No Flows In Operational After Disconnect
72 [Documentation] With mininet stopped no switches in operational datastore sould be found
73 Wait Until Keyword Succeeds 110s 5s Check No Switches Inventory
76 [Documentation] Reconnection of the mininet
79 Check Flows Are Operational Again
80 [Documentation] All 16k switches should be present in the operational datastore after mininet reconnection
81 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${flows} ${ODL_SYSTEM_IP}
84 [Documentation] Flows deconfiguration
85 ${res}= Deconfigure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
88 Check No Flows In Operational Last
89 [Documentation] Operational datastore to be without any flows
90 ${noflows}= Create List
91 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${noflows} ${ODL_SYSTEM_IP}
99 [Documentation] Starts mininet with requested number of switches (${swnr})
100 Log Starting mininet with ${swnr} switches
101 Open Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT} timeout=600
102 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
103 Execute Command sudo ovs-vsctl set-manager ptcp:6644
104 Execute Command sudo mn -c
107 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
110 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
113 [Documentation] Stops mininet
117 Read Until ${TOOLS_SYSTEM_PROMPT}
123 Are Switches Connected Topo
124 [Documentation] Checks wheather switches are connected to controller
125 ${resp}= GET On Session session url=${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
127 ${count}= Get Element Count ${resp.content} xpath=node
128 Should Be Equal As Numbers ${count} ${swnr}
130 Check Flows Inventory
131 [Arguments] ${fldets} ${cntl}
132 ${res}= Flow Stats Collected flow_details=${fldets} controller=${cntl}
133 Should Be True ${res}
135 Check No Switches Inventory
136 ${resp}= GET On Session session ${RFC8040_OPERATIONAL_NODES_API}
138 Should Be Equal As Strings '${resp.content}' '{"nodes":{}}'