Add module to the augmented node in the URL path
[integration/test.git] / csit / suites / openflowplugin / Clustered_Reconciliation / 010_Group_Flows.robot
index 1982599d42fb22c7ca171075b1c72f7d73ee73e3..9458cd99bf9236e049bfab18f18055af6d753add 100644 (file)
@@ -13,6 +13,7 @@ Resource          ../../../libraries/MininetKeywords.robot
 Resource          ../../../libraries/Utils.robot
 Resource          ../../../libraries/OvsManager.robot
 Resource          ../../../variables/Variables.robot
+Resource          ../../../variables/openflowplugin/Variables.robot
 
 *** Variables ***
 ${SWITCHES}       3
@@ -133,9 +134,10 @@ Check Flows After Owner Reconnect In Switch
 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.
@@ -200,9 +202,10 @@ Check No Switches After Disconnect
 
 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
@@ -239,9 +242,7 @@ Check Entity Owner Status And Find Owner and Successor Before Owner Stop
 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.
@@ -360,11 +361,9 @@ Initialization Phase
     ${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}
@@ -377,17 +376,19 @@ Final Phase
     [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
@@ -398,10 +399,11 @@ Remove Single Group And Flow On Member
     [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
@@ -417,10 +419,10 @@ Extract Flow Duration
     [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}