Reorder suite test cases 06/57406/2
authorPeter Gubka <pgubka@cisco.com>
Fri, 19 May 2017 09:44:39 +0000 (11:44 +0200)
committerVratko Polák <vrpolak@cisco.com>
Fri, 19 May 2017 12:30:46 +0000 (12:30 +0000)
For add shard replica a retry is added

Change-Id: I09fdbeddc33cabc25e14673f4082eed96bda62a6
Signed-off-by: Peter Gubka <pgubka@cisco.com>
csit/suites/controller/dom_data_broker/ddb-sanity-module-based.robot
csit/suites/controller/dom_data_broker/ddb-sanity-prefix-based.robot

index 8067da5846371bca808e1f57218c262ac84fab08..b1c37b89792dc8ad3bcf65ac59647a55e0205173 100644 (file)
@@ -63,6 +63,34 @@ Write_Transactions_One_Node_Follower
     : FOR    ${resp}    IN    @{resp_list}
     \    TemplatedRequests.Check_Status_Code    ${resp}
 
+Write_Transactions_All_Nodes
+    [Documentation]    Write transactions.
+    ${all_indices} =    ClusterManagement.List_All_Indices
+    ${all_ip_list} =    ClusterManagement.Resolve_IP_Address_For_Members    ${all_indices}
+    MdsalLowlevelPy.Start_Write_Transactions_On_Nodes    ${all_ip_list}    ${all_indices}    ${MODULE_SHARD_PREFIX}    ${DURATION}    ${TRANSACTION_RATE_1K}    chained_flag=${CHAINED_TX}
+    ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
+    : FOR    ${resp}    IN    @{resp_list}
+    \    TemplatedRequests.Check_Status_Code    ${resp}
+
+Subscribe_Listener_To_Leader
+    [Documentation]    Subscribe listener to leader.
+    ${all_indices} =    ClusterManagement.List_All_Indices
+    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
+    MdsalLowlevel.Subscribe_Dtcl    ${leader}
+    BuiltIn.Sleep    5s
+    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Dtcl    ${leader}
+    BuiltIn.Should_Be_True    ${copy_matches}
+
+Subscribe_Listener_To_Follower
+    [Documentation]    Subscribe listener to follower.
+    ${all_indices} =    ClusterManagement.List_All_Indices
+    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
+    ${follower_idx} =    Collections.Get_From_List    ${follower_list}    ${0}
+    MdsalLowlevel.Subscribe_Dtcl    ${follower_idx}
+    BuiltIn.Sleep    5s
+    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Dtcl    ${follower_idx}
+    BuiltIn.Should_Be_True    ${copy_matches}
+
 Make_Leader_Local
     [Documentation]    Make the loeader local and verify.
     ${shard_name} =    BuiltIn.Set_Variable    ${SHARD_NAME}
@@ -86,7 +114,7 @@ Remove_Leader_Shard_Replica_And_Add_It_Back
     ${actual_leader}    ${actual_follower_list} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}
     ...    verify_restconf=False    shard_type=${shard_type}    member_index_list=${follower_list}
     BuiltIn.Should_Not_Be_Equal_As_Numbers    ${old_leader}    ${actual_leader}
-    ClusterAdmin.Add_Shard_Replica    ${old_leader}    ${shard_name}    ${shard_type}
+    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterAdmin.Add_Shard_Replica    ${old_leader}    ${shard_name}    ${shard_type}
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}    shard_type=${shard_type}    member_index_list=${all_indices}
     ...    verify_restconf=False
 
@@ -101,34 +129,6 @@ Remove_Follower_Shard_Replica_And_Add_It_Back
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    DdbCommons.Verify_Shard_Replica_Removed    ${follower1}    ${shard_name}    ${shard_type}
     ${new_indices_list} =    ClusterManagement.List_Indices_Minus_Member    ${follower1}
     ClusterManagement.Verify_Shard_Leader_Elected    ${shard_name}    ${shard_type}    ${False}    ${leader}    member_index_list=${new_indices_list}
-    ClusterAdmin.Add_Shard_Replica    ${follower1}    ${shard_name}    ${shard_type}
+    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterAdmin.Add_Shard_Replica    ${follower1}    ${shard_name}    ${shard_type}
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}    shard_type=${shard_type}    member_index_list=${all_indices}
     ...    verify_restconf=False
-
-Write_Transactions_All_Nodes
-    [Documentation]    Write transactions.
-    ${all_indices} =    ClusterManagement.List_All_Indices
-    ${all_ip_list} =    ClusterManagement.Resolve_IP_Address_For_Members    ${all_indices}
-    MdsalLowlevelPy.Start_Write_Transactions_On_Nodes    ${all_ip_list}    ${all_indices}    ${MODULE_SHARD_PREFIX}    ${DURATION}    ${TRANSACTION_RATE_1K}    chained_flag=${CHAINED_TX}
-    ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
-    : FOR    ${resp}    IN    @{resp_list}
-    \    TemplatedRequests.Check_Status_Code    ${resp}
-
-Subscribe_Listener_To_Leader
-    [Documentation]    Subscribe listener to leader.
-    ${all_indices} =    ClusterManagement.List_All_Indices
-    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
-    MdsalLowlevel.Subscribe_Dtcl    ${leader}
-    BuiltIn.Sleep    5s
-    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Dtcl    ${leader}
-    BuiltIn.Should_Be_True    ${copy_matches}
-
-Subscribe_Listener_To_Follower
-    [Documentation]    Subscribe listener to follower.
-    ${all_indices} =    ClusterManagement.List_All_Indices
-    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
-    ${follower_idx} =    Collections.Get_From_List    ${follower_list}    ${0}
-    MdsalLowlevel.Subscribe_Dtcl    ${follower_idx}
-    BuiltIn.Sleep    5s
-    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Dtcl    ${follower_idx}
-    BuiltIn.Should_Be_True    ${copy_matches}
index 97ad8a72aa4d67cbc469567d275e44886bcb0cf2..3270948a5fc8ce0d7f6bcc652fd74d1ec40d29df 100644 (file)
@@ -65,6 +65,34 @@ Produce_Transactions_One_Node_Follower
     : FOR    ${resp}    IN    @{resp_list}
     \    TemplatedRequests.Check_Status_Code    ${resp}
 
+Produce_Transactions
+    [Documentation]    Produce transactions.
+    ${all_indices} =    ClusterManagement.List_All_Indices
+    ${all_ip_list} =    ClusterManagement.Resolve_IP_Address_For_Members    ${all_indices}
+    MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes    ${all_ip_list}    ${all_indices}    ${ID_PREFIX}    ${DURATION}    ${TRANSACTION_RATE_1K}
+    ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
+    : FOR    ${resp}    IN    @{resp_list}
+    \    TemplatedRequests.Check_Status_Code    ${resp}
+
+Subscribe_Listener_To_Leader
+    [Documentation]    Subscribe listener to leader.
+    ${all_indices} =    ClusterManagement.List_All_Indices
+    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
+    MdsalLowlevel.Subscribe_Ddtl    ${leader}
+    BuiltIn.Sleep    5s
+    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Ddtl    ${leader}
+    BuiltIn.Should_Be_True    ${copy_matches}
+
+Subscribe_Listener_To_Follower
+    [Documentation]    Subscribe listener to follower.
+    ${all_indices} =    ClusterManagement.List_All_Indices
+    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
+    ${follower_idx} =    Collections.Get_From_List    ${follower_list}    ${0}
+    MdsalLowlevel.Subscribe_Ddtl    ${follower_idx}
+    BuiltIn.Sleep    5s
+    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Ddtl    ${follower_idx}
+    BuiltIn.Should_Be_True    ${copy_matches}
+
 Become_Prefix_Leader
     [Documentation]    Make the loeader local and verify.
     ${shard_name} =    BuiltIn.Set_Variable    ${PREF_BASED_SHARD}
@@ -88,7 +116,7 @@ Remove_Leader_Prefix_Shard_Replica_And_Add_It_Back
     ${actual_leader}    ${actual_follower_list} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!
     ...    verify_restconf=False    shard_type=${shard_type}    member_index_list=${follower_list}
     BuiltIn.Should_Not_Be_Equal_As_Numbers    ${old_leader}    ${actual_leader}
-    ClusterAdmin.Add_Prefix_Shard_Replica    ${old_leader}    ${shard_name}    ${shard_type}
+    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterAdmin.Add_Prefix_Shard_Replica    ${old_leader}    ${shard_name}    ${shard_type}
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!    shard_type=${shard_type}    member_index_list=${all_indices}
     ...    verify_restconf=False
 
@@ -103,34 +131,6 @@ Remove_Follower_Prefix_Shard_Replica_And_Add_It_Back
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    DdbCommons.Verify_Shard_Replica_Removed    ${follower1}    ${shard_name}!!    ${shard_type}
     ${new_indices_list} =    ClusterManagement.List_Indices_Minus_Member    ${follower1}
     ClusterManagement.Verify_Shard_Leader_Elected    ${shard_name}!!    ${shard_type}    ${False}    ${leader}    member_index_list=${new_indices_list}
-    ClusterAdmin.Add_Prefix_Shard_Replica    ${follower1}    ${shard_name}    ${shard_type}
+    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterAdmin.Add_Prefix_Shard_Replica    ${follower1}    ${shard_name}    ${shard_type}
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!    shard_type=${shard_type}    member_index_list=${all_indices}
     ...    verify_restconf=False
-
-Produce_Transactions
-    [Documentation]    Produce transactions.
-    ${all_indices} =    ClusterManagement.List_All_Indices
-    ${all_ip_list} =    ClusterManagement.Resolve_IP_Address_For_Members    ${all_indices}
-    MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes    ${all_ip_list}    ${all_indices}    ${ID_PREFIX}    ${DURATION}    ${TRANSACTION_RATE_1K}
-    ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
-    : FOR    ${resp}    IN    @{resp_list}
-    \    TemplatedRequests.Check_Status_Code    ${resp}
-
-Subscribe_Listener_To_Leader
-    [Documentation]    Subscribe listener to leader.
-    ${all_indices} =    ClusterManagement.List_All_Indices
-    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
-    MdsalLowlevel.Subscribe_Ddtl    ${leader}
-    BuiltIn.Sleep    5s
-    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Ddtl    ${leader}
-    BuiltIn.Should_Be_True    ${copy_matches}
-
-Subscribe_Listener_To_Follower
-    [Documentation]    Subscribe listener to follower.
-    ${all_indices} =    ClusterManagement.List_All_Indices
-    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${SHARD_NAME}    shard_type=${SHARD_TYPE}    member_index_list=${all_indices}    verify_restconf=False
-    ${follower_idx} =    Collections.Get_From_List    ${follower_list}    ${0}
-    MdsalLowlevel.Subscribe_Ddtl    ${follower_idx}
-    BuiltIn.Sleep    5s
-    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Ddtl    ${follower_idx}
-    BuiltIn.Should_Be_True    ${copy_matches}