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
10 ${CAR_SHARD} shard-car-config
12 ${NUM_ORIG_CARS} ${10}
13 ${KARAF_HOME} ${WORKSPACE}/${BUNDLEFOLDER}
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}
23 Delete Cars On Old Leader
24 [Documentation] Delete cars in Leader
25 Delete All Cars And Verify ${OLD_CAR_LEADER}
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}
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}
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}
42 Delete Cars On New Leader
43 [Documentation] Delete cars in new Leader
44 Delete All Cars And Verify ${NEW_CAR_LEADER}
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}
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}
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}
59 Delete Cars On Follower
60 [Documentation] Delete cars in follower
61 Delete All Cars And Verify @{CAR_FOLLOWERS}[0]
63 Add Cars From Follower
64 [Documentation] Add more cars from the Follower
65 Add Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS}
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}
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}
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}