Resource ../../../libraries/Utils.robot
Resource ../../../libraries/OvsManager.robot
Resource ../../../variables/Variables.robot
+Resource ../../../variables/openflowplugin/Variables.robot
*** Variables ***
${SWITCHES} 3
Check Switches Generate Slave Connection
[Documentation] Check switches are connected to new Slave.
${original_master}= BuiltIn.Set Variable ${ODL_SYSTEM_${original_owner}_IP}
- : FOR ${switch} IN RANGE 1 ${switches+1}
- \ BuiltIn.Wait Until Keyword Succeeds 50s 1s OvsManager.Should Be Slave s1 ${original_master}
- \ ... update_data=${True}
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ BuiltIn.Wait Until Keyword Succeeds 50s 1s OvsManager.Should Be Slave s${switch} ${original_master}
+ ... update_data=${True}
+ END
Disconnect Mininet From Successor
[Documentation] Disconnect mininet from the Successor.
Check Switch Is Not Connected
[Documentation] Check switch s1 is not connected to any controller.
- : FOR ${index} IN @{cluster_index_list}
- \ BuiltIn.Wait Until Keyword Succeeds 10s 1s OvsManager.Should Be Disconnected s1 ${ODL_SYSTEM_${index}_IP}
- \ ... update_data=${True}
+ FOR ${index} IN @{cluster_index_list}
+ BuiltIn.Wait Until Keyword Succeeds 10s 1s OvsManager.Should Be Disconnected s1 ${ODL_SYSTEM_${index}_IP}
+ ... update_data=${True}
+ END
Reconnect Mininet To Cluster
[Documentation] Reconnect mininet to cluster by removing Iptables drop rules that were used to disconnect
Check Switch Generates Slave Connection Before Owner Stop
[Documentation] Check switch s1 is connected to Slave.
${original_slave}= BuiltIn.Set Variable ${ODL_SYSTEM_${original_successor}_IP}
- : FOR ${switch} IN RANGE 1 ${switches+1}
- \ BuiltIn.Wait Until Keyword Succeeds 50s 1s OvsManager.Should Be Slave s1 ${original_slave}
- \ ... update_data=${True}
+ BuiltIn.Wait Until Keyword Succeeds 50s 1s OvsManager.Should Be Slave s1 ${original_slave} update_data=${True}
Check Shards Status Before Owner Stop
[Documentation] Check Status for all shards in OpenFlow application.
${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}
# Stale flows/groups feature enabled in Boron onwards.
- ${less_flows}= CompareStream.Set Variable If At Least Boron ${less_flows} ${all_flows}
BuiltIn.Set Suite Variable ${switches}
BuiltIn.Set Suite Variable ${iter}
BuiltIn.Set Suite Variable ${all_groups}
[Documentation] Delete all sessions.
${command} = BuiltIn.Set Variable sudo iptables -v -F
BuiltIn.Run Keyword And Ignore Error ClusterManagement.Run_Bash_Command_On_List_Or_All ${command}
- BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${CONFIG_NODES_API}
+ BuiltIn.Run Keyword And Ignore Error RequestsLibrary.Delete Request session ${RFC8040_NODES_API}
RequestsLibrary.Delete All Sessions
Add Groups And Flows On Member
[Arguments] ${iter}=1 ${member_index}=1
[Documentation] Add ${ITER} groups type 1 & 2 and flows in every switch.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
- : 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}
- \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter}
- \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-flow mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter}
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ &{mapping} BuiltIn.Create_Dictionary NODE=openflow:${switch}
+ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-1 mapping=${mapping} session=${session} iterations=${iter}
+ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping=${mapping} session=${session} iterations=${iter}
+ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-flow mapping=${mapping} session=${session} iterations=${iter}
+ END
Add Single Group And Flow On Member
[Arguments] ${member_index}=1
[Arguments] ${member_index}=1
[Documentation] Remove 1 group 1&2 and 1 flow in every switch.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
- : 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
+ FOR ${switch} IN RANGE 1 ${switches+1}
+ RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:table=0/flow=1
+ RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1
+ RequestsLibrary.Delete Request ${session} ${RFC8040_NODES_API}/node=openflow%3A${switch}/flow-node-inventory:group=1000
+ END
Check Flow Stats Are Not Frozen
[Arguments] ${member_index}=1 ${period_in_seconds}=5
[Arguments] ${member_index}
[Documentation] Extract duration for flow 1 in switch 1.
${session} = Resolve_Http_Session_For_Member member_index=${member_index}
- ${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_NODES_API}/node/openflow:1/table/0/flow/1 headers=${headers}
+ ${resp} RequestsLibrary.Get Request ${session} ${RFC8040_NODES_API}/node=openflow%3A1/flow-node-inventory:table=0/flow=1?content=nonconfig headers=${headers}
Log ${resp.content}
${json_resp} = RequestsLibrary.To_Json ${resp.content}
${flow_list} = Collections.Get_From_Dictionary ${json_resp} flow-node-inventory:flow
- ${flow_stats} = Collections.Get_From_Dictionary @{flow_list}[0] opendaylight-flow-statistics:flow-statistics
- ${duration} = Collections.Get_From_Dictionary &{flow_stats}[duration] second
+ ${flow_stats} = Collections.Get_From_Dictionary ${flow_list}[0] opendaylight-flow-statistics:flow-statistics
+ ${duration} = Collections.Get_From_Dictionary ${flow_stats}[duration] second
Return From Keyword ${duration}