Tidy for clustering test suite.
[integration/test.git] / test / csit / suites / clustering / datastore / 030_car_failover_crud_on_new_leader.robot
1 *** Settings ***
2 Documentation     This test brings down the current leader of the "car" shard and then executes CRUD operations on the new leader
3 Default Tags      3-node-cluster
4 Library           ../../../libraries/CrudLibrary.py
5 Library           ../../../libraries/UtilLibrary.py
6 Library           ../../../libraries/ClusterStateLibrary.py
7 Resource          ../../../libraries/ClusterKeywords.txt
8
9 *** Variables ***
10 ${CAR_SHARD}      shard-car-config
11 ${NUM_CARS}       ${50}
12 ${NUM_ORIG_CARS}    ${10}
13
14 *** Test Cases ***
15 Get old car leader
16     ${OLD_CAR_LEADER}    Wait For Leader    ${CAR_SHARD}
17     Set Suite Variable    ${OLD_CAR_LEADER}
18
19 Delete cars on old leader
20     Delete All Cars And Verify    ${OLD_CAR_LEADER}
21
22 Add original cars on old leader
23     Add Cars And Verify    ${OLD_CAR_LEADER}    ${NUM_ORIG_CARS}
24
25 Switch car leader
26     [Documentation]    Stop the leader to cause a new leader to be elected
27     ${NEW_CAR_LEADER}    Switch Leader    ${CAR_SHARD}    ${OLD_CAR_LEADER}
28     Set Suite Variable    ${NEW_CAR_LEADER}
29
30 Get original cars on new leader
31     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_ORIG_CARS}
32
33 Delete cars on new leader
34     Delete All Cars And Verify    ${NEW_CAR_LEADER}
35
36 Add new cars and get cars from new leader
37     [Documentation]    Add cars and get added cars from the Leader
38     Add Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_CARS}
39
40 Get Car Followers
41     ${CAR_FOLLOWERS}    Get All Followers    ${CAR_SHARD}
42     Set Suite Variable    ${CAR_FOLLOWERS}
43
44 Get added cars from Follower
45     [Documentation]    Get the added cars from the Follower
46     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
47
48 Delete cars on Follower
49     Delete All Cars And Verify    @{CAR_FOLLOWERS}[0]
50
51 Add cars from Follower
52     [Documentation]    Add more cars from the Follower
53     Add Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
54
55 Get added cars from new leader
56     [Documentation]    Get added cars from the new leader
57     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_CARS}
58
59 Restart old Car leader
60     StartController    ${OLD_CAR_LEADER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${PORT}
61
62 Get added cars from old leader
63     [Documentation]    Get the added cars from the old leader
64     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${OLD_CAR_LEADER}    ${NUM_CARS}