Cluster Library consolidation 2 71/41871/3
authorLuis Gomez <ecelgp@gmail.com>
Fri, 15 Jul 2016 03:31:46 +0000 (20:31 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 15 Jul 2016 20:46:04 +0000 (20:46 +0000)
Modify OF Bulkomatic cluster test to use new library.

Change-Id: Id278e5350d52f34f529e4aacbe30dfa678d9ab7d
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
csit/libraries/BulkomaticKeywords.robot
csit/suites/openflowplugin/Clustering_Bulkomatic/010__Cluster_HA_Data_Recovery_BulkFlow_Single_Switch.robot
csit/suites/openflowplugin/Clustering_Bulkomatic/020__Cluster_HA_Data_Recovery_BulkFlow_2Node_Cluster.robot
csit/suites/openflowplugin/Clustering_Bulkomatic/030__Cluster_Reconcilliation_Multi_DPN.robot

index a2fae8455a0225cdb4da79bb06e9776a98b1f560..fa708960b86465863838cff8014e45653b2845ce 100644 (file)
@@ -14,10 +14,9 @@ ${jolokia_flow_count_status}    /jolokia/read/org.opendaylight.openflowplugin.ap
 
 *** Keywords ***
 Operation Status Check
-    [Arguments]    ${controller_index}    ${op_status_uri}
+    [Arguments]    ${op_status_uri}    ${controller_index}
     [Documentation]    Checks to see if read or write operation is successfull in controller node.
-    ${data}=    Utils.Get Data From URI    controller${controller_index}    ${op_status_uri}
-    Log    ${data}
+    ${data}=    ClusterManagement.Get From Member    ${op_status_uri}    ${controller_index}
     ${json}=    To Json    ${data}
     ${value}=    Get From Dictionary    ${json}    value
     ${value}=    Convert to String    ${value}
@@ -26,66 +25,65 @@ Operation Status Check
 
 Wait Until Write Finishes
     [Arguments]    ${controller_index}    ${timeout}
-    [Documentation]    Wait Until Write operation status is OK in ${controller_index}.
-    Wait Until Keyword Succeeds    ${timeout}    1s    BulkomaticKeywords.Operation Status Check    ${controller_index}    ${jolokia_write_op_status}
+    [Documentation]    Wait Until Write operation status is OK in member ${controller_index}.
+    Wait Until Keyword Succeeds    ${timeout}    1s    BulkomaticKeywords.Operation Status Check    ${jolokia_write_op_status}    ${controller_index}
 
 Wait Until Read Finishes
     [Arguments]    ${controller_index}    ${timeout}
-    [Documentation]    Wait Until Read operation status is OK in ${controller_index}.
-    Wait Until Keyword Succeeds    ${timeout}    1s    BulkomaticKeywords.Operation Status Check    ${controller_index}    ${jolokia_read_op_status}
+    [Documentation]    Wait Until Read operation status is OK in member ${controller_index}.
+    Wait Until Keyword Succeeds    ${timeout}    1s    BulkomaticKeywords.Operation Status Check    ${jolokia_read_op_status}    ${controller_index}
 
 Add Bulk Flow
-    [Arguments]    ${controller_index}    ${json_body_add}
-    [Documentation]    Add Bulk Flow in ${controller_index} according to ${json_body_add}.
-    ${resp}    Utils.Post Elements To URI    ${ADD_BULK_CONFIG_NODES_API}    ${json_body_add}    headers=${HEADERS_YANG_JSON}    session=controller${controller_index}
+    [Arguments]    ${json_body_add}    ${controller_index}
+    [Documentation]    Add Bulk Flow in member ${controller_index} according to \${json_body_add}.
+    ${resp}    ClusterManagement.Post As Json To Member    ${ADD_BULK_CONFIG_NODES_API}    ${json_body_add}    ${controller_index}
 
 Delete Bulk Flow
-    [Arguments]    ${controller_index}    ${json_body_del}
-    [Documentation]    Delete Bulk Flow in ${controller_index} according to ${json_body_del}.
-    ${resp}    Utils.Post Elements To URI    ${ADD_BULK_CONFIG_NODES_API}    ${json_body_del}    headers=${HEADERS_YANG_JSON}    session=controller${controller_index}
+    [Arguments]    ${json_body_del}    ${controller_index}
+    [Documentation]    Delete Bulk Flow in member ${controller_index} according to \${json_body_del}.
+    ${resp}    ClusterManagement.Post As Json To Member    ${ADD_BULK_CONFIG_NODES_API}    ${json_body_del}    ${controller_index}
 
 Get Bulk Flow
-    [Arguments]    ${controller_index}    ${json_body_get}
-    [Documentation]    Get Bulk Flow in ${controller_index} according to ${json_body_get}.
-    ${resp}    Utils.Post Elements To URI    ${GET_BULK_CONFIG_NODES_API}    ${json_body_get}    headers=${HEADERS_YANG_JSON}    session=controller${controller_index}
+    [Arguments]    ${json_body_get}    ${controller_index}
+    [Documentation]    Get Bulk Flow in member ${controller_index} according to \${json_body_get}.
+    ${resp}    ClusterManagement.Post As Json To Member    ${GET_BULK_CONFIG_NODES_API}    ${json_body_get}    ${controller_index}
 
 Get Bulk Flow Count
     [Arguments]    ${controller_index}
-    [Documentation]    Get Flow count in ${controller_index}. New Flow Count is available after Get Bulk Flow operation.
-    ${data}=    Utils.Get Data From URI    controller${controller_index}    ${jolokia_flow_count_status}
-    Log    ${data}
+    [Documentation]    Get Flow count in member ${controller_index}. New Flow Count is available after Get Bulk Flow operation.
+    ${data}=    ClusterManagement.Get From Member    ${jolokia_flow_count_status}    ${controller_index}
     [Return]    ${data}
 
 Verify Flow Count
-    [Arguments]    ${controller_index}    ${flow_count}
-    [Documentation]    Verify Flow Count in ${controller_index} matches ${flow_count}.
+    [Arguments]    ${flow_count}    ${controller_index}
+    [Documentation]    Verify Flow Count in member ${controller_index} matches ${flow_count}.
     ${data}=    Get Bulk Flow Count    ${controller_index}
-    Log    ${data}
     ${json}=    To Json    ${data}
     ${value}=    Get From Dictionary    ${json}    value
     Should Be Equal As Strings    ${value}    ${flow_count}
 
 Add Bulk Flow In Node
-    [Arguments]    ${controller_index}    ${json_body_add}    ${timeout}
-    [Documentation]    Add Bulk Flow in ${controller_index} and wait until operation is completed.
-    Add Bulk Flow    ${controller_index}    ${json_body_add}
+    [Arguments]    ${json_body_add}    ${controller_index}    ${timeout}
+    [Documentation]    Add Bulk Flow in member ${controller_index} and wait until operation is completed.
+    Add Bulk Flow    ${json_body_add}    ${controller_index}
     Wait Until Write Finishes    ${controller_index}    ${timeout}
 
 Delete Bulk Flow In Node
-    [Arguments]    ${controller_index}    ${json_body_del}    ${timeout}
-    [Documentation]    Delete Bulk Flow in ${controller_index} and wait until operation is completed.
-    Delete Bulk Flow    ${controller_index}    ${json_body_del}
+    [Arguments]    ${json_body_del}    ${controller_index}    ${timeout}
+    [Documentation]    Delete Bulk Flow in member ${controller_index} and wait until operation is completed.
+    Delete Bulk Flow    ${json_body_del}    ${controller_index}
     Wait Until Write Finishes    ${controller_index}    ${timeout}
 
 Get Bulk Flow And Verify Count In Cluster
-    [Arguments]    ${controller_index_list}    ${json_body_get}    ${timeout}    ${flow_count}
+    [Arguments]    ${json_body_get}    ${timeout}    ${flow_count}    ${controller_index_list}=${EMPTY}
     [Documentation]    Get Bulk Flow and Verify Flow Count in ${controller_index_list} matches ${flow_count}.
-    : FOR    ${index}    IN    @{controller_index_list}
-    \    Get Bulk Flow    ${index}    ${json_body_get}
-    : FOR    ${index}    IN    @{controller_index_list}
+    ${index_list} =    ClusterManagement__Given_Or_Internal_Index_List    given_list=${controller_index_list}
+    : FOR    ${index}    IN    @{index_list}
+    \    Get Bulk Flow    ${json_body_get}    ${index}
+    : FOR    ${index}    IN    @{index_list}
     \    Wait Until Read Finishes    ${index}    ${timeout}
-    : FOR    ${index}    IN    @{controller_index_list}
-    \    Verify Flow Count    ${index}    ${flow_count}
+    : FOR    ${index}    IN    @{index_list}
+    \    Verify Flow Count    ${flow_count}    ${index}
 
 Set DPN And Flow Count In Json Add
     [Arguments]    ${json_config}    ${dpn_count}    ${flows_count}
index 64aaca5abab0e670b97705b61baef2a1b7c7cc8c..eafd4e0fb82f86c8917e32ae4bbfc876723c6ccb 100644 (file)
@@ -1,10 +1,10 @@
 *** Settings ***
 Documentation     Test suite for Cluster HA with Bulk Flows - Data consistency after cluster restart, leader restart and follower restart with one switch connected
-Suite Setup       Create Controller Sessions
+Suite Setup       ClusterManagement Setup
 Suite Teardown    Delete All Sessions
 Resource          ../../../libraries/BulkomaticKeywords.robot
 Resource          ../../../libraries/MininetKeywords.robot
-Resource          ../../../libraries/ClusterKeywords.robot
+Resource          ../../../libraries/ClusterManagement.robot
 Resource          ../../../libraries/ClusterOpenFlow.robot
 Resource          ../../../libraries/Utils.robot
 Variables         ../../../variables/Variables.py
@@ -21,18 +21,19 @@ ${orig_json_config_get}    sal_get_bulk_flow_config.json
 ${orig_json_config_del}    sal_del_bulk_flow_config.json
 
 *** Test Cases ***
-Create Original Cluster List
-    [Documentation]    Create original cluster list.
-    ${original_cluster_list}    ClusterKeywords.Create Controller Index List
-    Set Suite Variable    ${original_cluster_list}
-
-Check Shards Status Before Leader Restart
+Check Shards Status And Initialize Variables
     [Documentation]    Check Status for all shards in OpenFlow application.
-    ClusterOpenFlow.Check OpenFlow Shards Status    ${original_cluster_list}
+    ClusterOpenFlow.Check OpenFlow Shards Status
+    ${temp_json_config_add}    BulkomaticKeywords.Set DPN And Flow Count In Json Add    ${orig_json_config_add}    ${switch_count}    ${flow_count_per_switch}
+    ${temp_json_config_get}    BulkomaticKeywords.Set DPN And Flow Count In Json Get    ${orig_json_config_get}    ${switch_count}    ${flow_count_after_add}
+    ${temp_json_config_del}    BulkomaticKeywords.Set DPN And Flow Count In Json Del    ${orig_json_config_del}    ${switch_count}    ${flow_count_per_switch}
+    Set Suite Variable    ${temp_json_config_add}
+    Set Suite Variable    ${temp_json_config_get}
+    Set Suite Variable    ${temp_json_config_del}
 
 Get Inventory Follower Before Cluster Restart
     [Documentation]    Find a follower in the inventory config shard
-    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status    ${original_cluster_list}
+    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status
     ${Follower_Node_1}=    Get From List    ${Inventory_Followers}    0
     Set Suite Variable    ${Follower_Node_1}
 
@@ -43,15 +44,11 @@ Start Mininet Connect To Follower Node1
 
 Add Bulk Flow From Follower
     [Documentation]    1000 Flows added via Follower Node1 and verify it gets applied in all instances.
-    ${temp_json_config_add}    BulkomaticKeywords.Set DPN And Flow Count In Json Add    ${orig_json_config_add}    ${switch_count}    ${flow_count_per_switch}
-    Set Suite Variable    ${temp_json_config_add}
-    BulkomaticKeywords.Add Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_add}    ${operation_timeout}
+    BulkomaticKeywords.Add Bulk Flow In Node    ${temp_json_config_add}    ${Follower_Node_1}    ${operation_timeout}
 
 Get Bulk Flows and Verify In Cluster
     [Documentation]    Initiate get operation and check flow count across cluster nodes
-    ${temp_json_config_get}    BulkomaticKeywords.Set DPN And Flow Count In Json Get    ${orig_json_config_get}    ${switch_count}    ${flow_count_after_add}
-    Set Suite Variable    ${temp_json_config_get}
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
 
 Verify Flows In Switch Before Cluster Restart
     [Documentation]    Verify flows are installed in switch before cluster restart.
@@ -59,7 +56,7 @@ Verify Flows In Switch Before Cluster Restart
 
 Kill All Cluster Nodes
     [Documentation]    Kill All Nodes.
-    ClusterKeywords.Kill Multiple Controllers    @{original_cluster_list}
+    ClusterManagement.Kill Members From List Or All
 
 Stop Mininet Connected To Follower Node1 and Exit
     [Documentation]    Stop mininet and exit connection.
@@ -68,12 +65,11 @@ Stop Mininet Connected To Follower Node1 and Exit
 
 Restart All Cluster Nodes
     [Documentation]    Restart all cluster nodes.
-    ClusterKeywords.Start Multiple Controllers    ${restart_timeout}    @{original_cluster_list}
+    ClusterManagement.Start Members From List Or All
 
 Verify Data Recovery After Cluster Restart
     [Documentation]    1000 Flows preserved in all controller instances.
-    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}
-    ...    ${flow_count_after_add}
+    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
 
 Start Mininet Again Connect To Follower Node1
     [Documentation]    Start mininet with connection to follower node1.
@@ -91,17 +87,15 @@ Stop Mininet Connected To Follower Node1
 
 Delete All Flows From Follower Node1
     [Documentation]    1000 Flows deleted via Follower Node1 and verify it gets applied in all instances.
-    ${temp_json_config_del}    BulkomaticKeywords.Set DPN And Flow Count In Json Del    ${orig_json_config_del}    ${switch_count}    ${flow_count_per_switch}
-    Set Suite Variable    ${temp_json_config_del}
-    BulkomaticKeywords.Delete Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_del}    ${operation_timeout}
+    BulkomaticKeywords.Delete Bulk Flow In Node    ${temp_json_config_del}    ${Follower_Node_1}    ${operation_timeout}
 
 Verify No Flows In Cluster
     [Documentation]    Verify flow count is 0 across cluster nodes.
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
 
 Get Inventory Leader Before Leader Restart
     [Documentation]    Find leader in the inventory config shard
-    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status    ${original_cluster_list}
+    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status
     Set Suite Variable    ${Inventory_Leader}
 
 Start Mininet Connect To Leader
@@ -111,11 +105,11 @@ Start Mininet Connect To Leader
 
 Add Bulk Flow From Leader
     [Documentation]    1000 Flows added via Follower Node1 and verify it gets applied in all instances.
-    BulkomaticKeywords.Add Bulk Flow In Node    ${Inventory_Leader}    ${temp_json_config_add}    ${operation_timeout}
+    BulkomaticKeywords.Add Bulk Flow In Node    ${temp_json_config_add}    ${Inventory_Leader}    ${operation_timeout}
 
 Get Bulk Flows and Verify In Cluster Before Leader Restart
     [Documentation]    Initiate get operation and check flow count across cluster nodes
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
 
 Verify Flows In Switch Before Leader Restart
     [Documentation]    Verify flows are installed in switch before leader restart.
@@ -123,7 +117,7 @@ Verify Flows In Switch Before Leader Restart
 
 Kill Leader From Cluster Node
     [Documentation]    Kill Leader Node.
-    ClusterKeywords.Kill Multiple Controllers    ${Inventory_Leader}
+    ClusterManagement.Kill Single Member    ${Inventory_Leader}
 
 Stop Mininet Connected To Leader Node
     [Documentation]    Stop mininet and exit connection.
@@ -132,12 +126,16 @@ Stop Mininet Connected To Leader Node
 
 Restart Leader from Cluster Node
     [Documentation]    Start Leader Node Up.
-    ClusterKeywords.Start Multiple Controllers    ${restart_timeout}    ${Inventory_Leader}
+    ClusterManagement.Start Single Member    ${Inventory_Leader}
 
 Verify Data Recovery After Leader Restart
     [Documentation]    1000 Flows preserved in all controller instances.
-    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}
-    ...    ${flow_count_after_add}
+    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+
+Check No Network Operational Information After Leader Restart
+    [Documentation]    Check device is not in operational inventory or topology in all cluster instances.
+    ClusterOpenFlow.Check No OpenFlow Network Operational Information
+    [Teardown]    Report_Failure_Due_To_Bug    6058
 
 Start Mininet Again Connect To Leader
     [Documentation]    Start mininet with connection to Leader Node.
@@ -147,6 +145,7 @@ Start Mininet Again Connect To Leader
 Verify Flows In Switch After Leader Restart
     [Documentation]    Verify flows are installed in switch after leader restart.
     MininetKeywords.Verify Aggregate Flow From Mininet Session    ${mininet_conn_id}    ${switch_count}    ${flow_count_per_switch}    ${operation_timeout}
+    [Teardown]    Report_Failure_Due_To_Bug    6058
 
 Stop Mininet Connected To Leader Node After Leader Restart
     [Documentation]    Stop mininet and exit connection.
@@ -155,15 +154,15 @@ Stop Mininet Connected To Leader Node After Leader Restart
 
 Delete All Flows From Leader Node
     [Documentation]    1000 Flows deleted via Leader Node and verify it gets applied in all instances.
-    BulkomaticKeywords.Delete Bulk Flow In Node    ${Inventory_Leader}    ${temp_json_config_del}    ${operation_timeout}
+    BulkomaticKeywords.Delete Bulk Flow In Node    ${temp_json_config_del}    ${Inventory_Leader}    ${operation_timeout}
 
 Verify No Flows In Cluster After Leader Restart
     [Documentation]    Verify flow count is 0 across cluster nodes.
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
 
 Get Inventory Follower Before follower Restart
     [Documentation]    Find follower in the inventory config shard
-    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status    ${original_cluster_list}
+    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status
     ${Follower_Node_2}=    Get From List    ${Inventory_Followers}    1
     Set Suite Variable    ${Follower_Node_2}
 
@@ -174,11 +173,11 @@ Start Mininet Connect To Follower Node2
 
 Add Bulk Flow From Follower Node2
     [Documentation]    1000 Flows added via Follower Node2 and verify it gets applied in all instances.
-    BulkomaticKeywords.Add Bulk Flow In Node    ${Follower_Node_2}    ${temp_json_config_add}    ${operation_timeout}
+    BulkomaticKeywords.Add Bulk Flow In Node    ${temp_json_config_add}    ${Follower_Node_2}    ${operation_timeout}
 
 Get Bulk Flows and Verify In Cluster Before Follower Restart
-    [Documentation]    Initiate get operation and check flow count across cluster nodes
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+    [Documentation]    Initiate get operation and check flow count across cluster nodes.
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
 
 Verify Flows In Switch Before Follower Restart
     [Documentation]    Verify flows are installed in switch before follower restart.
@@ -186,7 +185,7 @@ Verify Flows In Switch Before Follower Restart
 
 Kill Follower Node2
     [Documentation]    Kill Follower Node2.
-    ClusterKeywords.Kill Multiple Controllers    ${Follower_Node_2}
+    ClusterManagement.Kill Single Member    ${Follower_Node_2}
 
 Stop Mininet Connected To Follower Node2 and Exit
     [Documentation]    Stop mininet and exit connection.
@@ -195,12 +194,16 @@ Stop Mininet Connected To Follower Node2 and Exit
 
 Restart Follower Node2
     [Documentation]    Start Follower Node2 Up.
-    ClusterKeywords.Start Multiple Controllers    ${restart_timeout}    ${Follower_Node_2}
+    ClusterManagement.Start Single Member    ${Follower_Node_2}
 
 Verify Data Recovery After Follower Node2 Restart
     [Documentation]    1000 Flows preserved in all controller instances.
-    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}
-    ...    ${flow_count_after_add}
+    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+
+Check No Network Operational Information After Follower Node2 Restart
+    [Documentation]    Check device is not in operational inventory or topology in all cluster instances.
+    ClusterOpenFlow.Check No OpenFlow Network Operational Information
+    [Teardown]    Report_Failure_Due_To_Bug    6058
 
 Start Mininet Again Connect To Follower Node2
     [Documentation]    Start mininet with connection to follower node1.
@@ -210,6 +213,7 @@ Start Mininet Again Connect To Follower Node2
 Verify Flows In Switch After Follower Node2 Restart
     [Documentation]    Verify flows are installed in switch after follower restart.
     MininetKeywords.Verify Aggregate Flow From Mininet Session    ${mininet_conn_id}    ${switch_count}    ${flow_count_per_switch}    ${operation_timeout}
+    [Teardown]    Report_Failure_Due_To_Bug    6058
 
 Stop Mininet Connected To Follower Node2
     [Documentation]    Stop mininet and exit connection.
@@ -218,7 +222,7 @@ Stop Mininet Connected To Follower Node2
 
 Delete All Flows From Follower Node 2
     [Documentation]    1000 Flows deleted via Leader Node and verify it gets applied in all instances.
-    BulkomaticKeywords.Delete Bulk Flow In Node    ${Follower_Node_2}    ${temp_json_config_del}    ${operation_timeout}
+    BulkomaticKeywords.Delete Bulk Flow In Node    ${temp_json_config_del}    ${Follower_Node_2}    ${operation_timeout}
 
 Verify No Flows In Cluster After Follower Node2 Restart
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
index 3ccd2e6ef83ed2e633e9b6b9b02206c4dad7c311..a166f4a89f1d6da3c22a1270386026de0151ab11 100644 (file)
@@ -1,10 +1,10 @@
 *** Settings ***
 Documentation     Test suite for 2Node Cluster HA with Bulk Flows - Cluster node convergance and Data consistency after leader and follower restart with one switch connected
-Suite Setup       Create Controller Sessions
+Suite Setup       ClusterManagement Setup
 Suite Teardown    Delete All Sessions
 Resource          ../../../libraries/BulkomaticKeywords.robot
 Resource          ../../../libraries/MininetKeywords.robot
-Resource          ../../../libraries/ClusterKeywords.robot
+Resource          ../../../libraries/ClusterManagement.robot
 Resource          ../../../libraries/ClusterOpenFlow.robot
 Resource          ../../../libraries/Utils.robot
 Variables         ../../../variables/Variables.py
@@ -21,18 +21,19 @@ ${orig_json_config_get}    sal_get_bulk_flow_config.json
 ${orig_json_config_del}    sal_del_bulk_flow_config.json
 
 *** Test Cases ***
-Create Original Cluster List
-    [Documentation]    Create original cluster list.
-    ${original_cluster_list}    ClusterKeywords.Create Controller Index List
-    Set Suite Variable    ${original_cluster_list}
-
-Check Shards Status Before Leader Restart
+Check Shards Status and Initialize Variables
     [Documentation]    Check Status for all shards in OpenFlow application.
-    ClusterOpenFlow.Check OpenFlow Shards Status    ${original_cluster_list}
+    ClusterOpenFlow.Check OpenFlow Shards Status
+    ${temp_json_config_add}    BulkomaticKeywords.Set DPN And Flow Count In Json Add    ${orig_json_config_add}    ${switch_count}    ${flow_count_per_switch}
+    ${temp_json_config_get}    BulkomaticKeywords.Set DPN And Flow Count In Json Get    ${orig_json_config_get}    ${switch_count}    ${flow_count_after_add}
+    ${temp_json_config_del}    BulkomaticKeywords.Set DPN And Flow Count In Json Del    ${orig_json_config_del}    ${switch_count}    ${flow_count_per_switch}
+    Set Suite Variable    ${temp_json_config_add}
+    Set Suite Variable    ${temp_json_config_get}
+    Set Suite Variable    ${temp_json_config_del}
 
 Get Inventory Follower Before Cluster Restart
     [Documentation]    Find a follower in the inventory config shard
-    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status    ${original_cluster_list}
+    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status
     ${Inventory_Leader_List}=    Create List    ${Inventory_Leader}
     ${Follower_Node_1}=    Get From List    ${Inventory_Followers}    0
     Set Suite Variable    ${Inventory_Followers}
@@ -42,7 +43,7 @@ Get Inventory Follower Before Cluster Restart
 
 Shutdown Leader From Cluster Node
     [Documentation]    Shutdown Leader Node and Start it Up.
-    ClusterKeywords.Kill Multiple Controllers    ${Inventory_Leader}
+    ClusterManagement.Kill Single Member    ${Inventory_Leader}
 
 Check Shards Status After Leader Shutdown
     [Documentation]    Wait for node convergence and check status for all shards in OpenFlow application.
@@ -55,15 +56,11 @@ Start Mininet Connect To Follower Node1
 
 Add Bulk Flow From Follower
     [Documentation]    1000 Flows added via Follower Node1 and verify it gets applied in all instances.
-    ${temp_json_config_add}    BulkomaticKeywords.Set DPN And Flow Count In Json Add    ${orig_json_config_add}    ${switch_count}    ${flow_count_per_switch}
-    Set Suite Variable    ${temp_json_config_add}
-    BulkomaticKeywords.Add Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_add}    ${operation_timeout}
+    BulkomaticKeywords.Add Bulk Flow In Node    ${temp_json_config_add}    ${Follower_Node_1}    ${operation_timeout}
 
 Get Bulk Flows and Verify In Cluster
     [Documentation]    Initiate get operation and check flow count across cluster nodes.
-    ${temp_json_config_get}    BulkomaticKeywords.Set DPN And Flow Count In Json Get    ${orig_json_config_get}    ${switch_count}    ${flow_count_after_add}
-    Set Suite Variable    ${temp_json_config_get}
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${Inventory_Followers}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}    ${Inventory_Followers}
 
 Verify Flows In Switch Before Cluster Restart
     [Documentation]    Verify flows are installed in switch before cluster restart.
@@ -71,12 +68,11 @@ Verify Flows In Switch Before Cluster Restart
 
 Restart Leader From Cluster Node
     [Documentation]    Restart Leader Node.
-    ClusterKeywords.Start Multiple Controllers    ${operation_timeout}    ${Inventory_Leader}
+    ClusterManagement.Start Single Member    ${Inventory_Leader}
 
 Verify Data Recovery After Leader Restart
     [Documentation]    1000 Flows preserved in all controller instances.
-    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}
-    ...    ${flow_count_after_add}
+    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
 
 Verify Flows In Switch After Leader Restart
     [Documentation]    Verify flows are installed in switch after cluster restart.
@@ -89,17 +85,15 @@ Stop Mininet Connected To Follower Node1
 
 Delete All Flows From Follower Node1
     [Documentation]    1000 Flows deleted via Follower Node1 and verify it gets applied in all instances.
-    ${temp_json_config_del}    BulkomaticKeywords.Set DPN And Flow Count In Json Del    ${orig_json_config_del}    ${switch_count}    ${flow_count_per_switch}
-    Set Suite Variable    ${temp_json_config_del}
-    BulkomaticKeywords.Delete Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_del}    ${operation_timeout}
+    BulkomaticKeywords.Delete Bulk Flow In Node    ${temp_json_config_del}    ${Follower_Node_1}    ${operation_timeout}
 
 Verify No Flows In Cluster
     [Documentation]    Verify flow count is 0 across cluster nodes.
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
 
 Get Inventory Follower Before Follower Restart
     [Documentation]    Find Leader and followers in the inventory config shard
-    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status    ${original_cluster_list}
+    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status
     ${Active_Nodes}=    Create List
     ${Follower_Node_1}=    Get From List    ${Inventory_Followers}    0
     ${Follower_Node_2}=    Get From List    ${Inventory_Followers}    1
@@ -110,7 +104,7 @@ Get Inventory Follower Before Follower Restart
 
 Shutdown Follower From Cluster Node
     [Documentation]    Shutdown Follower Node2 and Start it Up.
-    ClusterKeywords.Kill Multiple Controllers    ${Follower_Node_2}
+    ClusterManagement.Kill Single Member    ${Follower_Node_2}
 
 Check Shards Status After Follower Shutdown
     [Documentation]    Wait for node convergence and check status for all shards in OpenFlow application.
@@ -123,11 +117,11 @@ Start Mininet Connect To Follower Node
 
 Add Bulk Flow From Follower Node1
     [Documentation]    1000 Flows added via Follower Node1 and verify it gets applied in all instances.
-    BulkomaticKeywords.Add Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_add}    ${operation_timeout}
+    BulkomaticKeywords.Add Bulk Flow In Node    ${temp_json_config_add}    ${Follower_Node_1}    ${operation_timeout}
 
 Get Bulk Flows and Verify In Cluster Before Follower Restart
     [Documentation]    Initiate get operation and check flow count only across active cluster nodes
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${Active_Nodes}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}    ${Active_Nodes}
 
 Verify Flows In Switch Before Follower Restart
     [Documentation]    Verify flows are installed in switch before follower restart.
@@ -135,12 +129,11 @@ Verify Flows In Switch Before Follower Restart
 
 Restart Follower From Cluster Node
     [Documentation]    Restart Follower Node2.
-    ClusterKeywords.Start Multiple Controllers    ${operation_timeout}    ${Follower_Node_2}
+    ClusterManagement.Start Single Member    ${Follower_Node_2}
 
 Verify Data Recovery After Follower Restart
     [Documentation]    1000 Flows preserved in all controller instances.
-    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}
-    ...    ${flow_count_after_add}
+    Wait Until Keyword Succeeds    ${restart_timeout}    2s    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
 
 Verify Flows In Switch After Follower Restart
     [Documentation]    Verify flows are installed in switch after cluster restart.
@@ -153,8 +146,8 @@ Stop Mininet Connected To Follower Node
 
 Delete All Flows From Follower Node
     [Documentation]    1000 Flows deleted via Follower Node1 and verify it gets applied in all instances.
-    BulkomaticKeywords.Delete Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_del}    ${operation_timeout}
+    BulkomaticKeywords.Delete Bulk Flow In Node    ${temp_json_config_del}    ${Follower_Node_1}    ${operation_timeout}
 
 Verify No Flows In Cluster After Follower Restart
     [Documentation]    Verify flow count is 0 across cluster nodes.
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
index ed3134d2d1026326e65e7ea1559996bd2ae18df6..55c76d869199c175a203ef6445ea432cb9b4e57d 100644 (file)
@@ -1,10 +1,10 @@
 *** Settings ***
 Documentation     Test suite for Cluster with Bulk Flows - Reconcilliation in a multi DPN environment
-Suite Setup       Create Controller Sessions
+Suite Setup       ClusterManagement Setup
 Suite Teardown    Delete All Sessions
 Resource          ../../../libraries/BulkomaticKeywords.robot
 Resource          ../../../libraries/MininetKeywords.robot
-Resource          ../../../libraries/ClusterKeywords.robot
+Resource          ../../../libraries/ClusterManagement.robot
 Resource          ../../../libraries/ClusterOpenFlow.robot
 Resource          ../../../libraries/Utils.robot
 Variables         ../../../variables/Variables.py
@@ -20,18 +20,19 @@ ${orig_json_config_get}    sal_get_bulk_flow_config.json
 ${orig_json_config_del}    sal_del_bulk_flow_config.json
 
 *** Test Cases ***
-Create Original Cluster List
-    [Documentation]    Create original cluster list.
-    ${original_cluster_list}    ClusterKeywords.Create Controller Index List
-    Set Suite Variable    ${original_cluster_list}
-
-Check Shards Status Before Leader Restart
+Check Shards Status And Initialize Variables
     [Documentation]    Check Status for all shards in OpenFlow application.
-    ClusterOpenFlow.Check OpenFlow Shards Status    ${original_cluster_list}
+    ClusterOpenFlow.Check OpenFlow Shards Status
+    ${temp_json_config_add}    BulkomaticKeywords.Set DPN And Flow Count In Json Add    ${orig_json_config_add}    ${switch_count}    ${flow_count_per_switch}
+    ${temp_json_config_get}    BulkomaticKeywords.Set DPN And Flow Count In Json Get    ${orig_json_config_get}    ${switch_count}    ${flow_count_after_add}
+    ${temp_json_config_del}    BulkomaticKeywords.Set DPN And Flow Count In Json Del    ${orig_json_config_del}    ${switch_count}    ${flow_count_per_switch}
+    Set Suite Variable    ${temp_json_config_add}
+    Set Suite Variable    ${temp_json_config_get}
+    Set Suite Variable    ${temp_json_config_del}
 
 Get Inventory Follower Before Cluster Restart
     [Documentation]    Find a follower in the inventory config shard
-    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status    ${original_cluster_list}
+    ${inventory_leader}    ${inventory_followers}    ClusterOpenFlow.Get InventoryConfig Shard Status
     ${Follower_Node_1}=    Get From List    ${Inventory_Followers}    0
     ${Follower_Node_2}=    Get From List    ${Inventory_Followers}    1
     Set Suite Variable    ${Follower_Node_1}
@@ -45,14 +46,11 @@ Start Mininet Connect To Follower Node1
 
 Add Bulk Flow From Follower
     [Documentation]    3000 Flows (1K per DPN) in 3 DPN added via Follower Node1 and verify it gets applied in all instances.
-    ${temp_json_config_add}    BulkomaticKeywords.Set DPN And Flow Count In Json Add    ${orig_json_config_add}    ${switch_count}    ${flow_count_per_switch}
-    BulkomaticKeywords.Add Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_add}    ${operation_timeout}
+    BulkomaticKeywords.Add Bulk Flow In Node    ${temp_json_config_add}    ${Follower_Node_1}    ${operation_timeout}
 
 Get Bulk Flows and Verify In Cluster
     [Documentation]    Initiate get operation and check flow count across cluster nodes
-    ${temp_json_config_get}    BulkomaticKeywords.Set DPN And Flow Count In Json Get    ${orig_json_config_get}    ${switch_count}    ${flow_count_after_add}
-    Set Suite Variable    ${temp_json_config_get}
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_add}
 
 Verify Flows In Switch Before Cluster Restart
     [Documentation]    Verify flows are installed in switch before cluster restart.
@@ -107,9 +105,8 @@ Stop Mininet Connected To Inventory Leader
 
 Delete All Flows From Follower Node1
     [Documentation]    3000 Flows deleted via Follower Node1 and verify it gets applied in all instances.
-    ${temp_json_config_del}    BulkomaticKeywords.Set DPN And Flow Count In Json Del    ${orig_json_config_del}    ${switch_count}    ${flow_count_per_switch}
-    BulkomaticKeywords.Delete Bulk Flow In Node    ${Follower_Node_1}    ${temp_json_config_del}    ${operation_timeout}
+    BulkomaticKeywords.Delete Bulk Flow In Node    ${temp_json_config_del}    ${Follower_Node_1}    ${operation_timeout}
 
 Verify No Flows In Cluster
     [Documentation]    Verify flow count is 0 across cluster nodes.
-    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${original_cluster_list}    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}
+    BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster    ${temp_json_config_get}    ${operation_timeout}    ${flow_count_after_del}