Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / libraries / controller / CsCommon.robot
index 0f3da610bda877828057cac58f1237ac062b61ab..7baed66c48a914626c636c0bc25a240fe0af5ba8 100644 (file)
@@ -66,14 +66,16 @@ Monitor_Owner_And_Candidates_Stability
 Register_Singleton_Constant_On_Nodes
     [Arguments]    ${index_list}
     [Documentation]    Register a candidate application on given nodes.
-    : FOR    ${index}    IN    @{index_list}
-    \    Register_Singleton_And_Update_Expected_Candidates    ${index}    ${CS_CONSTANT_PREFIX}${index}
+    FOR    ${index}    IN    @{index_list}
+        Register_Singleton_And_Update_Expected_Candidates    ${index}    ${CS_CONSTANT_PREFIX}${index}
+    END
 
 Unregister_Singleton_Constant_On_Nodes
     [Arguments]    ${index_list}
     [Documentation]    Unregister the application from given nodes.
-    : FOR    ${index}    IN    @{index_list}
-    \    Unregister_Singleton_And_Update_Expected_Candidates    ${index}
+    FOR    ${index}    IN    @{index_list}
+        Unregister_Singleton_And_Update_Expected_Candidates    ${index}
+    END
 
 Get_And_Save_Present_CsOwner_And_CsCandidates
     [Arguments]    ${node_to_ask}
@@ -92,14 +94,16 @@ Verify_Singleton_Constant_On_Node
 Verify_Singleton_Constant_On_Nodes
     [Arguments]    ${index_list}    ${cs_exp_constant}
     [Documentation]    Iterate over all cluster nodes and all should return expected constant.
-    : FOR    ${index}    IN    @{index_list}
-    \    Verify_Singleton_Constant_On_Node    ${index}    ${cs_exp_constant}
+    FOR    ${index}    IN    @{index_list}
+        Verify_Singleton_Constant_On_Node    ${index}    ${cs_exp_constant}
+    END
 
 Verify_Singleton_Constant_During_Isolation
     [Documentation]    Iterate over all non-isolated cluster nodes. They should return the correct constant.
-    : FOR    ${index}    IN    @{cs_all_indices}
-    \    BuiltIn.Run_Keyword_If    "${index}" == "${cs_isolated_index}"    BuiltIn.Log    Node not triggered, behavior not well described, see bugs 8207, 8214.
-    \    BuiltIn.Run_Keyword_Unless    "${index}" == "${cs_isolated_index}"    Verify_Singleton_Constant_On_Node    ${index}    ${CS_CONSTANT_PREFIX}${cs_owner}
+    FOR    ${index}    IN    @{cs_all_indices}
+        BuiltIn.Run_Keyword_If    "${index}" == "${cs_isolated_index}"    BuiltIn.Log    Node not triggered, behavior not well described, see bugs 8207, 8214.
+        BuiltIn.Run_Keyword_Unless    "${index}" == "${cs_isolated_index}"    Verify_Singleton_Constant_On_Node    ${index}    ${CS_CONSTANT_PREFIX}${cs_owner}
+    END
 
 Isolate_Owner_And_Verify_Isolated
     [Documentation]    Isolate the owner cluster node. Wait until the new owner is elected and store new values of owner and candidates.
@@ -107,8 +111,8 @@ Isolate_Owner_And_Verify_Isolated
     BuiltIn.Set_Suite_Variable    ${cs_isolated_index}    ${cs_owner}
     ${non_isolated_list} =    ClusterManagement.List_Indices_Minus_Member    ${cs_isolated_index}    member_index_list=${cs_all_indices}
     ${node_to_ask} =    Collections.Get_From_list    ${non_isolated_list}    0
-    BuiltIn.Wait_Until_Keyword_Succeeds    60s    10s    ShardStability.Shards_Stability_Get_Details    ${DEFAULT_SHARD_LIST}    member_index_list=${non_isolated_list}
-    BuiltIn.Wait_Until_Keyword_Succeeds    10s    2s    ClusterManagement.Check_New_Owner_Got_Elected_For_Device    ${CS_DEVICE_NAME}    ${CS_DEVICE_TYPE}    ${cs_isolated_index}
+    BuiltIn.Wait_Until_Keyword_Succeeds    70s    10s    ShardStability.Shards_Stability_Get_Details    ${DEFAULT_SHARD_LIST}    member_index_list=${non_isolated_list}
+    BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Check_New_Owner_Got_Elected_For_Device    ${CS_DEVICE_NAME}    ${CS_DEVICE_TYPE}    ${cs_isolated_index}
     ...    ${node_to_ask}    http_timeout=125
     Get_And_Save_Present_CsOwner_And_CsCandidates    ${node_to_ask}
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    Verify_Singleton_Constant_During_Isolation
@@ -116,23 +120,24 @@ Isolate_Owner_And_Verify_Isolated
 Rejoin_Node_And_Verify_Rejoined
     [Documentation]    Rejoin isolated node.
     ClusterManagement.Rejoin_Member_From_List_Or_All    ${cs_isolated_index}
-    BuiltIn.Wait_Until_Keyword_Succeeds    60s    10s    ShardStability.Shards_Stability_Get_Details    ${DEFAULT_SHARD_LIST}
-    BuiltIn.Wait_Until_Keyword_Succeeds    60s    3s    Verify_Singleton_Constant_On_Node    ${cs_isolated_index}    ${CS_CONSTANT_PREFIX}${cs_owner}
+    BuiltIn.Wait_Until_Keyword_Succeeds    70s    10s    ShardStability.Shards_Stability_Get_Details    ${DEFAULT_SHARD_LIST}
 
 Register_Flapping_Singleton_On_Nodes
     [Arguments]    ${index_list}
     [Documentation]    Register a candidate application on each node which starts the test.
-    : FOR    ${index}    IN    @{index_list}
-    \    MdsalLowlevel.Register_Flapping_Singleton    ${index}
+    FOR    ${index}    IN    @{index_list}
+        MdsalLowlevel.Register_Flapping_Singleton    ${index}
+    END
 
 Unregister_Flapping_Singleton_On_Nodes_And_Validate_Results
     [Arguments]    ${index_list}    ${rate_limit_to_pass}    ${test_duration}
     [Documentation]    Unregister the testing service and check recevied statistics.
     ${movements_count} =    BuiltIn.Set_Variable    ${0}
-    : FOR    ${index}    IN    @{index_list}
-    \    ${count} =    MdsalLowlevel.Unregister_Flapping_Singleton    ${index}
-    \    BuiltIn.Run_Keyword_If    ${count} < 0    BuiltIn.Fail    No failure should have occured during the ${test_duration} timeout.
-    \    ${movements_count} =    BuiltIn.Evaluate    ${movements_count}+${count}
+    FOR    ${index}    IN    @{index_list}
+        ${count} =    MdsalLowlevel.Unregister_Flapping_Singleton    ${index}
+        BuiltIn.Run_Keyword_If    ${count} < 0    BuiltIn.Fail    No failure should have occured during the ${test_duration} timeout.
+        ${movements_count} =    BuiltIn.Evaluate    ${movements_count}+${count}
+    END
     ${seconds} =    DateTime.Convert_Time    ${test_duration}
     ${rate} =    BuiltIn.Evaluate    ${movements_count}/${seconds}
     BuiltIn.Run_Keyword_If    ${rate} < ${rate_limit_to_pass}    BuiltIn.Fail    Acceptance rate ${rate_limit_to_pass} not reached, actual rate is ${rate}.