2 Documentation Suite checks if StatMngr is able to collect flows correctly
3 Suite Setup Create Http Session
4 Suite Teardown Delete Http Session
5 Library OperatingSystem
9 Variables ../../../variables/Variables.py
10 Library RequestsLibrary
11 Library ../../../libraries/Common.py
12 Library ../../../libraries/ScaleClient.py
13 Resource ../../../variables/openflowplugin/Variables.robot
20 @{cntls} ${ODL_SYSTEM_IP}
21 ${start_cmd} sudo mn --controller=remote,ip=${ODL_SYSTEM_IP} --topo linear,${swnr} --switch ovsk,protocols=OpenFlow13
28 [Documentation] Configuration of 16k flows into config datastore
29 ${flows} ${notes}= Generate New Flow Details flows=${flnr} switches=${swnr} swspread=${swspread} tabspread=${tabspread}
31 ${res}= Configure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
33 Set Suite Variable ${flows}
36 [Documentation] Operational datastore check if all flows are present there
37 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${flows} ${ODL_SYSTEM_IP}
40 [Documentation] Removal of 16k flows from config datastore
41 ${res}= Deconfigure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
44 Check No Flows In Operational
45 [Documentation] Operational datastore to be without any flows
46 ${noflows}= Create List
47 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${noflows} ${ODL_SYSTEM_IP}
50 [Documentation] Configuration of 16k flows into config datastore again
51 ${res}= Configure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
54 Are Flows Operational Again
55 [Documentation] Operational datastore check if all flows are present there
56 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${flows} ${ODL_SYSTEM_IP}
59 [Documentation] Disconnect/Stop mininet
62 Check No Flows In Operational After Disconnect
63 [Documentation] With mininet stopped no switches in operational datastore sould be found
64 Wait Until Keyword Succeeds 110s 5s Check No Switches Inventory
67 [Documentation] Reconnection of the mininet
70 Check Flows Are Operational Again
71 [Documentation] All 16k switches should be present in the operational datastore after mininet reconnection
72 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${flows} ${ODL_SYSTEM_IP}
75 [Documentation] Flows deconfiguration
76 ${res}= Deconfigure Flows flow_details=${flows} controllers=@{cntls} nrthreads=5
79 Check No Flows In Operational Last
80 [Documentation] Operational datastore to be without any flows
81 ${noflows}= Create List
82 Wait Until Keyword Succeeds 110s 5s Check Flows Inventory ${noflows} ${ODL_SYSTEM_IP}
89 [Documentation] Starts mininet with requested number of switches (${swnr})
90 Log Starting mininet with ${swnr} switches
91 Open Connection ${TOOLS_SYSTEM_IP} prompt=${TOOLS_SYSTEM_PROMPT} timeout=600
92 Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any
93 Execute Command sudo ovs-vsctl set-manager ptcp:6644
94 Execute Command sudo mn -c
97 Wait Until Keyword Succeeds 10s 1s Are Switches Connected Topo
100 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS_XML}
103 [Documentation] Stops mininet
107 Read Until ${TOOLS_SYSTEM_PROMPT}
113 Are Switches Connected Topo
114 [Documentation] Checks wheather switches are connected to controller
115 ${resp}= Get Request session ${RFC8040_OPERATIONAL_TOPO_FLOW1_API} headers=${ACCEPT_XML}
117 ${count}= Get Element Count ${resp.content} xpath=node
118 Should Be Equal As Numbers ${count} ${swnr}
120 Check Flows Inventory
121 [Arguments] ${fldets} ${cntl}
122 ${res}= Flow Stats Collected flow_details=${fldets} controller=${cntl}
123 Should Be True ${res}
125 Check No Switches Inventory
126 ${resp}= Get Request session ${RFC8040_OPERATIONAL_NODES_API}
128 Should Be Equal As Strings '${resp.content}' '{"nodes":{}}'