Step 2: Move test folder to root
[integration/test.git] / csit / suites / controller / 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
3 ...               operations on the new leader
4 Default Tags      3-node-cluster
5 Library           ../../../libraries/CrudLibrary.py
6 Library           ../../../libraries/UtilLibrary.py
7 Library           ../../../libraries/ClusterStateLibrary.py
8 Resource          ../../../libraries/ClusterKeywords.robot
9
10 *** Variables ***
11 ${CAR_SHARD}      shard-car-config
12 ${NUM_CARS}       ${50}
13 ${NUM_ORIG_CARS}    ${10}
14 ${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
15
16 *** Test Cases ***
17 Get old car leader
18     ${OLD_CAR_LEADER}    Wait For Leader To Be Found    ${CAR_SHARD}
19     Set Suite Variable    ${OLD_CAR_LEADER}
20
21 Delete cars on old leader
22     Delete All Cars And Verify    ${OLD_CAR_LEADER}
23
24 Add original cars on old leader
25     Add Cars And Verify    ${OLD_CAR_LEADER}    ${NUM_ORIG_CARS}
26
27 Switch car leader
28     [Documentation]    Stop the leader to cause a new leader to be elected
29     ${NEW_CAR_LEADER}    Switch Leader    ${CAR_SHARD}    ${OLD_CAR_LEADER}
30     Set Suite Variable    ${NEW_CAR_LEADER}
31
32 Get original cars on new leader
33     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_ORIG_CARS}
34
35 Delete cars on new leader
36     Delete All Cars And Verify    ${NEW_CAR_LEADER}
37
38 Add new cars and get cars from new leader
39     [Documentation]    Add cars and get added cars from the Leader
40     Add Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_CARS}
41
42 Get Car Followers
43     ${CAR_FOLLOWERS}    Get All Followers    ${CAR_SHARD}    ${OLD_CAR_LEADER}
44     Set Suite Variable    ${CAR_FOLLOWERS}
45
46 Get added cars from Follower
47     [Documentation]    Get the added cars from the Follower
48     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
49
50 Delete cars on Follower
51     Delete All Cars And Verify    @{CAR_FOLLOWERS}[0]
52
53 Add cars from Follower
54     [Documentation]    Add more cars from the Follower
55     Add Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
56
57 Get added cars from new leader
58     [Documentation]    Get added cars from the new leader
59     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_CARS}
60
61 Restart old Car leader
62     Start One Or More Controllers    ${OLD_CAR_LEADER}
63
64 Get added cars from old leader
65     [Documentation]    Get the added cars from the old leader
66     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${OLD_CAR_LEADER}    ${NUM_CARS}