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
5 Library ../../../libraries/CrudLibrary.py
6 Library ../../../libraries/UtilLibrary.py
7 Library ../../../libraries/ClusterStateLibrary.py
8 Resource ../../../libraries/ClusterKeywords.txt
11 ${CAR_SHARD} shard-car-config
13 ${NUM_ORIG_CARS} ${10}
17 ${OLD_CAR_LEADER} Wait For Leader ${CAR_SHARD}
18 Set Suite Variable ${OLD_CAR_LEADER}
20 Delete cars on old leader
21 Delete All Cars And Verify ${OLD_CAR_LEADER}
23 Add original cars on old leader
24 Add Cars And Verify ${OLD_CAR_LEADER} ${NUM_ORIG_CARS}
27 [Documentation] Stop the leader to cause a new leader to be elected
28 ${NEW_CAR_LEADER} Switch Leader ${CAR_SHARD} ${OLD_CAR_LEADER}
29 Set Suite Variable ${NEW_CAR_LEADER}
31 Get original cars on new leader
32 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify ${NEW_CAR_LEADER} ${NUM_ORIG_CARS}
34 Delete cars on new leader
35 Delete All Cars And Verify ${NEW_CAR_LEADER}
37 Add new cars and get cars from new leader
38 [Documentation] Add cars and get added cars from the Leader
39 Add Cars And Verify ${NEW_CAR_LEADER} ${NUM_CARS}
42 ${CAR_FOLLOWERS} Get All Followers ${CAR_SHARD}
43 Set Suite Variable ${CAR_FOLLOWERS}
45 Get added cars from Follower
46 [Documentation] Get the added cars from the Follower
47 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS}
49 Delete cars on Follower
50 Delete All Cars And Verify @{CAR_FOLLOWERS}[0]
52 Add cars from Follower
53 [Documentation] Add more cars from the Follower
54 Add Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS}
56 Get added cars from new leader
57 [Documentation] Get added cars from the new leader
58 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify ${NEW_CAR_LEADER} ${NUM_CARS}
60 Restart old Car leader
61 StartController ${OLD_CAR_LEADER} ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
63 Get added cars from old leader
64 [Documentation] Get the added cars from the old leader
65 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify ${OLD_CAR_LEADER} ${NUM_CARS}