Add karaf logging to controller-clustering.txt suites
[integration/test.git] / csit / suites / controller / Clustering_Datastore / buycar_failover.robot
index 421ba304ef170c8c3788e8162ce5283f812017d4..40751ddcdfb58b1d29c2595252439d0b822df784 100644 (file)
@@ -13,10 +13,12 @@ Documentation     This test focuses on testing buy-car RPC over 3 Leader reboots
 ...               All data is deleted at the end of the suite.
 ...               This suite expects car, people and car-people modules to have separate Shards.
 Suite Setup       Setup
+Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Default Tags      clustering    carpeople    critical
 Library           Collections
 Resource          ${CURDIR}/../../../libraries/CarPeople.robot
 Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
+Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
 Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 Variables         ${CURDIR}/../../../variables/Variables.py
 
@@ -41,65 +43,47 @@ Add_People_To_First_Follower_And_Verify
     : FOR    ${session}    IN    @{ClusterManagement__session_list}
     \    TemplatedRequests.Get_As_Json_Templated    folder=${VAR_DIR}/people    session=${session}    verify=True    iterations=${people_items}
 
-Buy_Cars_After_0_Reboots_And_Verify
-    [Documentation]    Buy some cars on the test member.
+Buy_Cars_On_Leader_And_Verify
+    [Documentation]    Buy some cars on the leader member.
     ${iter_start} =    BuiltIn.Evaluate    0 * ${CARPEOPLE_ITEMS} + 1
-    CarPeople.Buy_Several_Cars    session=${buying_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
+    CarPeople.Buy_Several_Cars    session=${car-people_leader_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
     ${total_iterations} =    BuiltIn.Evaluate    1 * ${CARPEOPLE_ITEMS}
     : FOR    ${session}    IN    @{ClusterManagement__session_list}
     \    TemplatedRequests.Get_As_Json_Templated    folder=${VAR_DIR}/car-people    session=${session}    verify=True    iterations=${total_iterations}
 
-Reboot_1
-    [Documentation]    Previous car-people Leader is rebooted (without persistence cleanup).
-    ${index_to_reboot} =    Collections.Remove_From_List    ${list_to_reboot}    0
-    ${index_list} =    BuiltIn.Create_List    ${index_to_reboot}
-    ClusterManagement.Kill_Members_From_List_Or_All    member_index_list=${index_list}    confirm=True
-    ClusterManagement.Start_Members_From_List_Or_All    member_index_list=${index_list}    wait_for_sync=True    timeout=${MEMBER_START_TIMEOUT}
-    BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_NAME_LIST}    shard_type=config
-
-Buy_Cars_After_1_Reboots_And_Verify
-    [Documentation]    Buy some cars on the test member.
+Buy_Cars_On_Follower_And_Verify
+    [Documentation]    Buy some cars on the first follower member.
     ${iter_start} =    BuiltIn.Evaluate    1 * ${CARPEOPLE_ITEMS} + 1
-    CarPeople.Buy_Several_Cars    session=${buying_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
+    CarPeople.Buy_Several_Cars    session=${car-people_first_follower_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
     ${total_iterations} =    BuiltIn.Evaluate    2 * ${CARPEOPLE_ITEMS}
     : FOR    ${session}    IN    @{ClusterManagement__session_list}
     \    TemplatedRequests.Get_As_Json_Templated    folder=${VAR_DIR}/car-people    session=${session}    verify=True    iterations=${total_iterations}
 
-Reboot_2
-    [Documentation]    Previous car-people Leader is rebooted (without persistence cleanup).
-    ${index_to_reboot} =    Collections.Remove_From_List    ${list_to_reboot}    0
-    ${index_list} =    BuiltIn.Create_List    ${index_to_reboot}
-    ClusterManagement.Kill_Members_From_List_Or_All    member_index_list=${index_list}    confirm=True
-    ClusterManagement.Start_Members_From_List_Or_All    member_index_list=${index_list}    wait_for_sync=True    timeout=${MEMBER_START_TIMEOUT}
+Reboot_People_Leader
+    [Documentation]    Previous people Leader is rebooted. We should never stop the people first follower, this is where people are registered.
+    ClusterManagement.Kill_Single_Member    ${people_leader_index}    confirm=True
+    ClusterManagement.Start_Single_Member    ${people_leader_index}    wait_for_sync=True    timeout=${MEMBER_START_TIMEOUT}
     BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_NAME_LIST}    shard_type=config
 
-Buy_Cars_After_2_Reboots_And_Verify
-    [Documentation]    Buy some cars on the test member.
+Buy_Cars_On_Leader_After_Reboot_And_Verify
+    [Documentation]    Buy some cars on the leader member.
     ${iter_start} =    BuiltIn.Evaluate    2 * ${CARPEOPLE_ITEMS} + 1
-    CarPeople.Buy_Several_Cars    session=${buying_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
+    CarPeople.Buy_Several_Cars    session=${car-people_leader_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
     ${total_iterations} =    BuiltIn.Evaluate    3 * ${CARPEOPLE_ITEMS}
     : FOR    ${session}    IN    @{ClusterManagement__session_list}
     \    TemplatedRequests.Get_As_Json_Templated    folder=${VAR_DIR}/car-people    session=${session}    verify=True    iterations=${total_iterations}
 
-Reboot_3
-    [Documentation]    Previous car-people Leader is rebooted (without persistence cleanup).
-    ${index_to_reboot} =    Collections.Remove_From_List    ${list_to_reboot}    0
-    ${index_list} =    BuiltIn.Create_List    ${index_to_reboot}
-    ClusterManagement.Kill_Members_From_List_Or_All    member_index_list=${index_list}    confirm=True
-    ClusterManagement.Start_Members_From_List_Or_All    member_index_list=${index_list}    wait_for_sync=True    timeout=${MEMBER_START_TIMEOUT}
-    BuiltIn.Wait_Until_Keyword_Succeeds    30s    2s    ClusterManagement.Verify_Leader_Exists_For_Each_Shard    shard_name_list=${SHARD_NAME_LIST}    shard_type=config
-
-Buy_Cars_After_3_Reboots_And_Verify
-    [Documentation]    Buy some cars on the test member.
+Buy_Cars_On_Follower_After_Reboot_And_Verify
+    [Documentation]    Buy some cars on the first follower member.
     ${iter_start} =    BuiltIn.Evaluate    3 * ${CARPEOPLE_ITEMS} + 1
-    CarPeople.Buy_Several_Cars    session=${buying_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
+    CarPeople.Buy_Several_Cars    session=${car-people_first_follower_session}    iterations=${CARPEOPLE_ITEMS}    iter_start=${iter_start}
     ${total_iterations} =    BuiltIn.Evaluate    4 * ${CARPEOPLE_ITEMS}
     : FOR    ${session}    IN    @{ClusterManagement__session_list}
     \    TemplatedRequests.Get_As_Json_Templated    folder=${VAR_DIR}/car-people    session=${session}    verify=True    iterations=${total_iterations}
 
 Delete_All_CarPeople
     [Documentation]    DELETE car-people container. No verification beyond http status.
-    TemplatedRequests.Delete_Templated    folder=${VAR_DIR}/car-people    session=${buying_session}
+    TemplatedRequests.Delete_Templated    folder=${VAR_DIR}/car-people    session=${car-people_leader_session}
 
 Delete_All_People
     [Documentation]    DELETE people container. No verification beyond http status.
@@ -112,11 +96,10 @@ Delete_All_Cars
 *** Keywords ***
 Setup
     [Documentation]    Initialize resources, memorize shard leaders, compute item distribution.
-    ClusterManagement.ClusterManagement_Setup
+    SetupUtils.Setup_Utils_For_Setup_And_Teardown
     Set_Variables_For_Shard    shard_name=car
     Set_Variables_For_Shard    shard_name=people
     Set_Variables_For_Shard    shard_name=car-people
     ${leader_list} =    BuiltIn.Create_List    ${car-people_leader_index}
     ${reboot_list} =    Collections.Combine_Lists    ${leader_list}    ${car-people_follower_indices}
     BuiltIn.Set_Suite_Variable    \${list_to_reboot}    ${reboot_list}
-    BuiltIn.Set_Suite_Variable    \${buying_session}    ${car-people_leader_session}