Suite Setup Initialization Phase
Suite Teardown Final Phase
Library RequestsLibrary
-Resource ../../../libraries/SetupUtils.robot
+Resource ../../../libraries/ClusterManagement.robot
Resource ../../../libraries/TemplatedRequests.robot
Resource ../../../libraries/MininetKeywords.robot
Resource ../../../libraries/FlowLib.robot
Resource ../../../variables/Variables.robot
*** Variables ***
-${SWITCHES} ${10}
-${ITER} ${100}
+${SWITCHES} 10
+${ITER} 100
${VAR_DIR} ${CURDIR}/../../../variables/openflowplugin
*** Test Cases ***
-Enable Stale Flow Entry
- [Documentation] Check Flows after mininet starts.
- # Stale flows/groups feature is only available in Boron onwards.
- CompareStream.Run Keyword If At Least Boron TemplatedRequests.Put As Json Templated folder=${VAR_DIR}/frm-config mapping={"STALE":"true"} session=session
-
Add Group 1 In Every Switch
[Documentation] Add ${ITER} groups of type 1 in every switch.
- : FOR ${switch} IN RANGE 1 ${SWITCHES+1}
- \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-1 mapping={"SWITCH":"${switch}"} session=session iterations=${ITER}
+ : FOR ${switch} IN RANGE 1 ${switches+1}
+ \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-1 mapping={"SWITCH":"${switch}"} session=session iterations=${iter}
Add Group 2 In Every Switch
[Documentation] Add ${ITER} groups of type 2 in every switch.
- : FOR ${switch} IN RANGE 1 ${SWITCHES+1}
- \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping={"SWITCH":"${switch}"} session=session iterations=${ITER}
+ : FOR ${switch} IN RANGE 1 ${switches+1}
+ \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping={"SWITCH":"${switch}"} session=session iterations=${iter}
Add Flow to Group 2 In Every Switch
[Documentation] Add ${ITER} flows to group type 2 in every switch.
- : FOR ${switch} IN RANGE 1 ${SWITCHES+1}
+ : FOR ${switch} IN RANGE 1 ${switches+1}
\ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-flow mapping={"SWITCH":"${switch}"} session=session iterations=${ITER}
Start Mininet Linear
[Documentation] Check no switches in topology.
BuiltIn.Wait Until Keyword Succeeds 30s 1s FlowLib.Check No Switches In Topology ${SWITCHES}
-Remove Flows And Groups While Mininet Is Disconnected
- [Documentation] Remove some groups and flows while network is down.
- : FOR ${switch} IN RANGE 1 ${SWITCHES+1}
- \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
- \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
- \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
-
Reconnect Mininet
[Documentation] Connect Mininet.
Disconnect Controller Mininet restore
[Documentation] Check Linear Topology.
BuiltIn.Wait Until Keyword Succeeds 30s 1s FlowLib.Check Linear Topology ${SWITCHES}
+Remove Flows And Groups After Mininet Reconnects
+ [Documentation] Remove some groups and flows while network is down.
+ : FOR ${switch} IN RANGE 1 ${switches+1}
+ \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1
+ \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1
+ \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000
+
Check Flows In Operational DS After Mininet Reconnects
[Documentation] Check Flows after mininet starts.
BuiltIn.Wait Until Keyword Succeeds 30s 1s FlowLib.Check Number Of Flows ${less_flows}
Restart Controller
[Documentation] Stop and Start controller.
- ClusterManagement.Stop_Members_From_List_Or_All
+ # Try to stop contoller, if stop does not work or takes too long, kill controller.
+ ${status} ${result}= BuiltIn.Run Keyword And Ignore Error ClusterManagement.Stop_Members_From_List_Or_All
+ BuiltIn.Run Keyword If '${status}' != 'PASS' ClusterManagement.Kill_Members_From_List_Or_All
ClusterManagement.Start_Members_From_List_Or_All wait_for_sync=False
Check Linear Topology After Controller Restarts
[Documentation] Check Linear Topology.
- BuiltIn.Wait Until Keyword Succeeds 120s 2s FlowLib.Check Linear Topology ${SWITCHES}
+ BuiltIn.Wait Until Keyword Succeeds 300s 2s FlowLib.Check Linear Topology ${SWITCHES}
Check Flows In Operational DS After Controller Restarts
[Documentation] Check Flows after mininet starts.
*** Keywords ***
Initialization Phase
[Documentation] Create controller session and set variables.
- SetupUtils.Setup_Utils_For_Setup_And_Teardown
+ ClusterManagement.ClusterManagement_Setup
# Still need to open controller HTTP session with name session because of old FlowLib.robot library dependency.
RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
- ${all_groups}= BuiltIn.Evaluate ${SWITCHES} * ${ITER} * 2
- ${less_groups}= BuiltIn.Evaluate ${all_groups} - ${SWITCHES} * 2
+ ${switches} Convert To Integer ${SWITCHES}
+ ${iter} Convert To Integer ${ITER}
+ ${all_groups}= BuiltIn.Evaluate ${switches} * ${iter} * 2
+ ${less_groups}= BuiltIn.Evaluate ${all_groups} - ${switches} * 2
# Stale flows/groups feature enabled in Boron onwards.
- ${less_groups}= CompareStream.Set Variable If At Least Boron ${less_groups} ${all_groups}
- ${all_flows}= BuiltIn.Evaluate ${SWITCHES} * ${ITER+1}
- ${less_flows}= BuiltIn.Evaluate ${all_flows} - ${SWITCHES}
+ ${less_groups}= CompareStream.Set Variable If At Most Beryllium ${all_groups} ${less_groups}
+ ${all_flows}= BuiltIn.Evaluate ${switches} * ${iter+1}
+ ${less_flows}= BuiltIn.Evaluate ${all_flows} - ${switches}
# Stale flows/groups feature enabled in Boron onwards.
- ${less_flows}= CompareStream.Set Variable If At Least Boron ${less_flows} ${all_flows}
+ ${less_flows}= CompareStream.Set Variable If At Most Beryllium ${all_flows} ${less_flows}
+ BuiltIn.Set Suite Variable ${switches}
+ BuiltIn.Set Suite Variable ${iter}
BuiltIn.Set Suite Variable ${all_groups}
BuiltIn.Set Suite Variable ${less_groups}
BuiltIn.Set Suite Variable ${all_flows}
[Documentation] Delete all sessions.
${command} = BuiltIn.Set Variable sudo iptables -v -F
Utils.Run Command On Controller cmd=${command}
- CompareStream.Run Keyword If At Least Boron TemplatedRequests.Put As Json Templated folder=${VAR_DIR}/frm-config mapping={"STALE":"false"} session=session
BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
RequestsLibrary.Delete All Sessions