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 Resource ../../../libraries/ClusterKeywords.robot
5 Resource ../../../libraries/CarsAndPeople.robot
6 Variables ../../../variables/Variables.py
9 ${PEOPLE_SHARD} shard-people-config
11 ${KARAF_HOME} ${WORKSPACE}/${BUNDLEFOLDER}
17 [Documentation] Find leader in the people shard
18 ${OLD_PEOPLE_LEADER} Get Leader And Verify ${PEOPLE_SHARD}
19 Set Suite Variable ${OLD_PEOPLE_LEADER}
22 [Documentation] Stop the leader to cause a new leader to be elected
23 Stop One Or More Controllers ${OLD_PEOPLE_LEADER}
24 Wait For Controller Down ${STOP_TIMEOUT} ${OLD_PEOPLE_LEADER}
25 ${NEW_PEOPLE_LEADER} Wait Until Keyword Succeeds 30s 2s Get Leader And Verify ${PEOPLE_SHARD} ${OLD_PEOPLE_LEADER}
26 Set Suite Variable ${NEW_PEOPLE_LEADER}
28 Delete People From New Leader
29 [Documentation] Delete people in new Leader
30 Delete All People And Verify ${NEW_PEOPLE_LEADER}
32 Add People And Get From New Leader
33 [Documentation] Add people and get people from new leader
34 Add People And Verify ${NEW_PEOPLE_LEADER} ${NUM_ENTRIES}
37 [Documentation] Find followers in the people shard
38 ${PEOPLE_FOLLOWERS} Get All Followers ${PEOPLE_SHARD} ${OLD_PEOPLE_LEADER}
39 Set Suite Variable ${PEOPLE_FOLLOWERS}
41 Get Added People From Follower
42 [Documentation] Get people in follower and verify
43 Get People And Verify @{PEOPLE_FOLLOWERS}[0] ${NUM_ENTRIES}
45 Delete People From New Follower
46 [Documentation] Delete people in follower and verify
47 Delete All People And Verify @{PEOPLE_FOLLOWERS}[0]
49 Add People From New Follower
50 [Documentation] Add people in follower and verify
51 Add People And Verify @{PEOPLE_FOLLOWERS}[0] ${NUM_ENTRIES}
53 Get Added People From New Leader
54 [Documentation] Get people in Leader and verify
55 Get People And Verify ${NEW_PEOPLE_LEADER} ${NUM_ENTRIES}
57 Restart Old People Leader
58 [Documentation] Start old people Leader
59 Start One Or More Controllers ${OLD_PEOPLE_LEADER}
60 Wait For Controller Sync ${START_TIMEOUT} ${OLD_PEOPLE_LEADER}
62 Check Cars In Old People Leader
63 [Documentation] Check cars in new Leader. This is to avoid delay when RPC does not work.
64 Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Check Cars ${OLD_PEOPLE_LEADER} ${NUM_ENTRIES}
66 Get Added People From Old Leader
67 [Documentation] Get people in old Leader and verify
68 Get People And Verify ${OLD_PEOPLE_LEADER} ${NUM_ENTRIES}