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
8 Resource ../../../libraries/Utils.txt
11 ${CAR_SHARD} shard-car-config
13 ${NUM_ORIG_CARS} ${10}
14 ${KARAF_HOME} ${WORKSPACE}/${BUNDLEFOLDER}
18 ${OLD_CAR_LEADER} Wait For Leader To Be Found ${CAR_SHARD}
19 Set Suite Variable ${OLD_CAR_LEADER}
21 Delete cars on old leader
22 Delete All Cars And Verify ${OLD_CAR_LEADER}
24 Add original cars on old leader
25 Add Cars And Verify ${OLD_CAR_LEADER} ${NUM_ORIG_CARS}
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}
32 Get original cars on new leader
33 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify ${NEW_CAR_LEADER} ${NUM_ORIG_CARS}
35 Delete cars on new leader
36 Delete All Cars And Verify ${NEW_CAR_LEADER}
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}
43 ${CAR_FOLLOWERS} Get All Followers ${CAR_SHARD} ${OLD_CAR_LEADER}
44 Set Suite Variable ${CAR_FOLLOWERS}
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}
50 Delete cars on Follower
51 Delete All Cars And Verify @{CAR_FOLLOWERS}[0]
53 Add cars from Follower
54 [Documentation] Add more cars from the Follower
55 Add Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS}
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}
61 Restart old Car leader
62 Start One Or More Controllers ${OLD_CAR_LEADER}
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}