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
10 ${CAR_SHARD} shard-car-config
12 ${NUM_ORIG_CARS} ${10}
16 ${OLD_CAR_LEADER} Wait For Leader ${CAR_SHARD}
17 Set Suite Variable ${OLD_CAR_LEADER}
19 Delete cars on old leader
20 Delete All Cars And Verify ${OLD_CAR_LEADER}
22 Add original cars on old leader
23 Add Cars And Verify ${OLD_CAR_LEADER} ${NUM_ORIG_CARS}
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}
30 Get original cars on new leader
31 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify ${NEW_CAR_LEADER} ${NUM_ORIG_CARS}
33 Delete cars on new leader
34 Delete All Cars And Verify ${NEW_CAR_LEADER}
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}
41 ${CAR_FOLLOWERS} Get All Followers ${CAR_SHARD}
42 Set Suite Variable ${CAR_FOLLOWERS}
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}
48 Delete cars on Follower
49 Delete All Cars And Verify @{CAR_FOLLOWERS}[0]
51 Add cars from Follower
52 [Documentation] Add more cars from the Follower
53 Add Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS}
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}
59 Restart old Car leader
60 StartController ${OLD_CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
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}