2 Documentation This test finds the leader for shards in a 3-Node cluster and executes CRUD operations on them
3 Default Tags 3-node-cluster
5 Library RequestsLibrary
6 Library ../../../libraries/Common.py
7 Library ../../../libraries/CrudLibrary.py
8 Library ../../../libraries/SettingsLibrary.py
9 Library ../../../libraries/UtilLibrary.py
10 Library ../../../libraries/ClusterStateLibrary.py
11 Resource ../../../libraries/ClusterKeywords.robot
12 Variables ../../../variables/Variables.py
15 ${SHARD_CAR_NAME} shard-car-config
16 ${SHARD_PEOPLE_NAME} shard-people-config
17 ${SHARD_CAR_PERSON_NAME} shard-car-people-config
21 Get Car Leader And Followers
22 ${CURRENT_CAR_LEADER} Wait For Leader To Be Found ${SHARD_CAR_NAME}
23 Set Suite Variable ${CURRENT_CAR_LEADER}
24 ${CAR_FOLLOWERS} Get All Followers ${SHARD_CAR_NAME}
25 Set Suite Variable ${CAR_FOLLOWERS}
27 Add cars and get cars from Leader
28 [Documentation] Add some cars and get added cars from Leader
29 Add Cars And Verify ${CURRENT_CAR_LEADER} ${NUM_ENTRIES}
31 Get added cars from Follower1
32 [Documentation] Get added cars from Follower1
33 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
35 Get added cars from Follower2
36 [Documentation] Get added cars from Follower2
37 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_ENTRIES}
39 Get People Leader And Followers
40 ${CURRENT_PEOPLE_LEADER} Wait For Leader To Be Found ${SHARD_PEOPLE_NAME}
41 Set Suite Variable ${CURRENT_PEOPLE_LEADER}
42 ${PEOPLE_FOLLOWERS} Get All Followers ${SHARD_PEOPLE_NAME}
43 Set Suite Variable ${PEOPLE_FOLLOWERS}
45 Add people and get people from Leader
46 [Documentation] Add some people and get people from Leader.
47 Add People And Verify ${CURRENT_PEOPLE_LEADER} ${NUM_ENTRIES}
49 Get added people from Follower1
50 [Documentation] Get added people from Follower1
51 Wait Until Keyword Succeeds 60s 2s Get People And Verify @{PEOPLE_FOLLOWERS}[0] ${NUM_ENTRIES}
53 Get added people from Follower2
54 [Documentation] Get added people from Follower2
55 Wait Until Keyword Succeeds 60s 2s Get People And Verify @{PEOPLE_FOLLOWERS}[1] ${NUM_ENTRIES}
57 Get Car-Person Leader And Followers
58 ${CURRENT_CAR_PERSON_LEADER} Wait For Leader To Be Found ${SHARD_CAR_PERSON_NAME}
59 Set Suite Variable ${CURRENT_CAR_PERSON_LEADER}
60 ${CAR_PERSON_FOLLOWERS} Get All Followers ${SHARD_CAR_PERSON_NAME}
61 Set Suite Variable ${CAR_PERSON_FOLLOWERS}
63 Add car-person mapping and get car-person mapping from Leader
64 Add Car Person And Verify ${CURRENT_CAR_PERSON_LEADER}
66 Purchase cars on Leader
67 [Documentation] Purchase some cars on the Leader
68 ${NUM_BUY_CARS_ON_LEADER} Evaluate ${NUM_ENTRIES}/3
69 ${NUM_BUY_CARS_ON_FOLLOWER1} Evaluate ${NUM_ENTRIES}/3
70 ${NUM_BUY_CARS_ON_FOLLOWER2} Evaluate ${NUM_ENTRIES}-${NUM_BUY_CARS_ON_LEADER}-${NUM_BUY_CARS_ON_FOLLOWER1}
71 Set Suite Variable ${NUM_BUY_CARS_ON_LEADER}
72 Set Suite Variable ${NUM_BUY_CARS_ON_FOLLOWER1}
73 Set Suite Variable ${NUM_BUY_CARS_ON_FOLLOWER2}
74 Buy Cars And Verify ${CURRENT_CAR_PERSON_LEADER} ${NUM_BUY_CARS_ON_LEADER}
76 Purchase cars on Follower1
77 [Documentation] Purchase some cars on Follower1
78 Buy Cars And Verify @{CAR_PERSON_FOLLOWERS}[0] ${NUM_BUY_CARS_ON_FOLLOWER1} ${NUM_BUY_CARS_ON_LEADER}
80 Purchase cars on Follower2
81 [Documentation] Purchase some cars on Follower2
82 ${start} Evaluate ${NUM_BUY_CARS_ON_LEADER}+${NUM_BUY_CARS_ON_FOLLOWER1}
83 Buy Cars And Verify @{CAR_PERSON_FOLLOWERS}[1] ${NUM_BUY_CARS_ON_FOLLOWER2} ${start}
85 Get car-person mappings from Leader
86 [Documentation] Get car-person mappings from Leader to see all entries
87 Wait Until Keyword Succeeds 60s 2s Get Car-Person Mappings And Verify ${CURRENT_CAR_PERSON_LEADER} ${NUM_ENTRIES}
89 Get car-person mappings from Follower1
90 [Documentation] Get car-person mappings from Follower1 to see all entries
91 Wait Until Keyword Succeeds 60s 2s Get Car-Person Mappings And Verify @{CAR_PERSON_FOLLOWERS}[0] ${NUM_ENTRIES}
93 Get car-person mappings from Follower2
94 [Documentation] Get car-person mappings from Follower2 to see all entries
95 Wait Until Keyword Succeeds 60s 2s Get Car-Person Mappings And Verify @{CAR_PERSON_FOLLOWERS}[1] ${NUM_ENTRIES}