Lower Chasing_The_Leader rate threshold
[integration/test.git] / csit / suites / controller / cluster_singleton / chasing_the_leader.robot
index 7feeef02bb51f5e4ff9337e146c6262f601c0efc..ad7620b4beb00defe7ac9bc6c4b115aff6c5cf78 100644 (file)
@@ -9,28 +9,25 @@ Documentation     Cluster Singleton testing: Chasing the Leader
 ...
 ...               This test aims to establish the service operates correctly when faced with
 ...               rapid application transitions without having a stabilized application.
-Suite Setup       SetupUtils.Setup_Utils_For_Setup_And_Teardown
+Suite Setup       Setup_Keyword
 Suite Teardown    SSHLibrary.Close_All_Connections
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 Default Tags      critical
-Library           Collections
-Library           DateTime
 Library           SSHLibrary
-Resource          ${CURDIR}/../../../libraries/MdsalLowlevel.robot
+Resource          ${CURDIR}/../../../libraries/controller/CsCommon.robot
+Resource          ${CURDIR}/../../../libraries/CompareStream.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 
 *** Variables ***
 ${TEST_DURATION}    1m
-${ACCEPTED_PER_SEC_RATE}    100
+${ACCEPTED_PER_SEC_RATE}    10
+# TODO: Use a better wait to start testing when ODL does not use CPU for initializing features. Then inrease rate to 100.
 
 *** Test Cases ***
 Register_Candidates
     [Documentation]    Register a candidate application on each node which starts the test.
-    ${index_list} =    ClusterManagement.List_All_Indices
-    : FOR    ${index}    IN    @{index_list}
-    \    MdsalLowlevel.Register_Flapping_Singleton    ${index}
+    CsCommon.Register_Flapping_Singleton_On_Nodes    ${cs_all_indices}
 
 Do_Nothing
     [Documentation]    Do nothing for the time of the test duration, because there is no api to monitor the statistics
@@ -40,12 +37,9 @@ Do_Nothing
 
 Unregister_Candidates_And_Validate_Criteria
     [Documentation]    Unregister the testing service and check recevied statistics.
-    ${index_list} =    ClusterManagement.List_All_Indices
-    ${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}
-    ${seconds} =    DateTime.Convert_Time    ${TEST_DURATION}
-    ${rate} =    BuiltIn.Evaluate    ${movements_count}/${seconds}
-    BuiltIn.Run_Keyword_If    ${rate} < ${ACCEPTED_PER_SEC_RATE}    BuiltIn.Fail    Acceptance rate ${ACCEPTED_PER_SEC_RATE} not reached, actual rate is ${rate}.
+    CsCommon.Unregister_Flapping_Singleton_On_Nodes_And_Validate_Results    ${cs_all_indices}    ${ACCEPTED_PER_SEC_RATE}    ${TEST_DURATION}
+
+*** Keywords ***
+Setup_Keyword
+    SetupUtils.Setup_Utils_For_Setup_And_Teardown    http_timeout=125
+    CsCommon.Cluster_Singleton_Init