Bug 5423: Fix for ERROR messages when intents were deleted.
[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 Resource          ../../../libraries/ClusterKeywords.robot
6 Resource          ../../../libraries/CarsAndPeople.robot
7 Variables         ../../../variables/Variables.py
8
9 *** Variables ***
10 ${CAR_SHARD}      shard-car-config
11 ${NUM_CARS}       ${50}
12 ${NUM_ORIG_CARS}    ${10}
13 ${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
14 ${START_TIMEOUT}    300s
15 ${STOP_TIMEOUT}    180s
16
17 *** Test Cases ***
18 Get Old Car Leader
19     [Documentation]    Find leader in the car shard
20     ${OLD_CAR_LEADER}    Get Leader And Verify    ${CAR_SHARD}
21     Set Suite Variable    ${OLD_CAR_LEADER}
22
23 Delete Cars On Old Leader
24     [Documentation]    Delete cars in Leader
25     Delete All Cars And Verify    ${OLD_CAR_LEADER}
26
27 Add Original Cars On Old Leader
28     [Documentation]    Add new cars in Leader and verify
29     Add Cars And Verify    ${OLD_CAR_LEADER}    ${NUM_ORIG_CARS}
30
31 Switch Car Leader
32     [Documentation]    Stop the leader to cause a new leader to be elected
33     Stop One Or More Controllers    ${OLD_CAR_LEADER}
34     Wait For Controller Down    ${STOP_TIMEOUT}    ${OLD_CAR_LEADER}
35     ${NEW_CAR_LEADER}    Wait Until Keyword Succeeds    30s    2s    Get Leader And Verify    ${CAR_SHARD}    ${OLD_CAR_LEADER}
36     Set Suite Variable    ${NEW_CAR_LEADER}
37
38 Get Original Cars On New Leader
39     [Documentation]    Get cars in new Leader
40     Get Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_ORIG_CARS}
41
42 Delete Cars On New Leader
43     [Documentation]    Delete cars in new Leader
44     Delete All Cars And Verify    ${NEW_CAR_LEADER}
45
46 Add New Cars And Get Cars From New Leader
47     [Documentation]    Add cars and get added cars from the Leader
48     Add Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_CARS}
49
50 Get Car Followers
51     [Documentation]    Find followers in the car shard
52     ${CAR_FOLLOWERS}    Get All Followers    ${CAR_SHARD}    ${OLD_CAR_LEADER}
53     Set Suite Variable    ${CAR_FOLLOWERS}
54
55 Get Added Cars From Follower
56     [Documentation]    Get the added cars from the Follower
57     Get Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
58
59 Delete Cars On Follower
60     [Documentation]    Delete cars in follower
61     Delete All Cars And Verify    @{CAR_FOLLOWERS}[0]
62
63 Add Cars From Follower
64     [Documentation]    Add more cars from the Follower
65     Add Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
66
67 Get Added Cars From New Leader
68     [Documentation]    Get added cars from the new leader
69     Get Cars And Verify    ${NEW_CAR_LEADER}    ${NUM_CARS}
70
71 Restart Old Car Leader
72     [Documentation]    Start old car Leader
73     Start One Or More Controllers    ${OLD_CAR_LEADER}
74     Wait For Controller Sync    ${START_TIMEOUT}    ${OLD_CAR_LEADER}
75
76 Get Added Cars From Old Leader
77     [Documentation]    Get the added cars from the old leader
78     Wait Until Keyword Succeeds    ${START_TIMEOUT}    2s    Get Cars And Verify    ${OLD_CAR_LEADER}    ${NUM_CARS}