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 ../../../libraries/RequestsLibrary.py
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.txt
12 Variables ../../../variables/Variables.py
15 ${REST_CONTEXT} /restconf/config/
16 ${SHARD_CAR_NAME} shard-car-config
17 ${SHARD_PEOPLE_NAME} shard-people-config
18 ${SHARD_CAR_PERSON_NAME} shard-car-people-config
22 Get Car Leader And Followers
23 ${CURRENT_CAR_LEADER} Wait For Leader ${SHARD_CAR_NAME}
24 Set Suite Variable ${CURRENT_CAR_LEADER}
25 ${CAR_FOLLOWERS} Get All Followers ${SHARD_CAR_NAME}
26 Set Suite Variable ${CAR_FOLLOWERS}
28 Add cars and get cars from Leader
29 [Documentation] Add some cars and get added cars from Leader
30 Add Cars And Verify ${CURRENT_CAR_LEADER} ${NUM_ENTRIES}
32 Get added cars from Follower1
33 [Documentation] Get added cars from Follower1
34 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_ENTRIES}
36 Get added cars from Follower2
37 [Documentation] Get added cars from Follower2
38 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_ENTRIES}
40 Get People Leader And Followers
41 ${CURRENT_PEOPLE_LEADER} Wait For Leader ${SHARD_PEOPLE_NAME}
42 Set Suite Variable ${CURRENT_PEOPLE_LEADER}
43 ${PEOPLE_FOLLOWERS} Get All Followers ${SHARD_PEOPLE_NAME}
44 Set Suite Variable ${PEOPLE_FOLLOWERS}
46 Add people and get people from Leader
47 [Documentation] Add some people and get people from Leader.
48 Add People And Verify ${CURRENT_PEOPLE_LEADER} ${NUM_ENTRIES}
50 Get added people from Follower1
51 [Documentation] Get added people from Follower1
52 Wait Until Keyword Succeeds 60s 2s Get People And Verify @{PEOPLE_FOLLOWERS}[0] ${NUM_ENTRIES}
54 Get added people from Follower2
55 [Documentation] Get added people from Follower2
56 Wait Until Keyword Succeeds 60s 2s Get People And Verify @{PEOPLE_FOLLOWERS}[1] ${NUM_ENTRIES}
58 Get Car-Person Leader And Followers
59 ${CURRENT_CAR_PERSON_LEADER} Wait For Leader ${SHARD_CAR_PERSON_NAME}
60 Set Suite Variable ${CURRENT_CAR_PERSON_LEADER}
61 ${CAR_PERSON_FOLLOWERS} Get All Followers ${SHARD_CAR_PERSON_NAME}
62 Set Suite Variable ${CAR_PERSON_FOLLOWERS}
64 Add car-person mapping and get car-person mapping from Leader
65 Add Car Person And Verify ${CURRENT_CAR_PERSON_LEADER}
67 Purchase cars on Leader
68 [Documentation] Purchase some cars on the Leader
69 ${NUM_BUY_CARS_ON_LEADER} Evaluate ${NUM_ENTRIES}/3
70 ${NUM_BUY_CARS_ON_FOLLOWER1} Evaluate ${NUM_ENTRIES}/3
71 ${NUM_BUY_CARS_ON_FOLLOWER2} Evaluate ${NUM_ENTRIES}-${NUM_BUY_CARS_ON_LEADER}-${NUM_BUY_CARS_ON_FOLLOWER1}
72 Set Suite Variable ${NUM_BUY_CARS_ON_LEADER}
73 Set Suite Variable ${NUM_BUY_CARS_ON_FOLLOWER1}
74 Set Suite Variable ${NUM_BUY_CARS_ON_FOLLOWER2}
75 Buy Cars And Verify ${CURRENT_CAR_PERSON_LEADER} ${NUM_BUY_CARS_ON_LEADER}
77 Purchase cars on Follower1
78 [Documentation] Purchase some cars on Follower1
79 Buy Cars And Verify @{CAR_PERSON_FOLLOWERS}[0] ${NUM_BUY_CARS_ON_FOLLOWER1} ${NUM_BUY_CARS_ON_LEADER}
81 Purchase cars on Follower2
82 [Documentation] Purchase some cars on Follower2
83 ${start} Evaluate ${NUM_BUY_CARS_ON_LEADER}+${NUM_BUY_CARS_ON_FOLLOWER1}
84 Buy Cars And Verify @{CAR_PERSON_FOLLOWERS}[1] ${NUM_BUY_CARS_ON_FOLLOWER2} ${start}
86 Get car-person mappings from Leader
87 [Documentation] Get car-person mappings from Leader to see all entries
88 Wait Until Keyword Succeeds 60s 2s Get Car-Person Mappings And Verify ${CURRENT_CAR_PERSON_LEADER} ${NUM_ENTRIES}
90 Get car-person mappings from Follower1
91 [Documentation] Get car-person mappings from Follower1 to see all entries
92 Wait Until Keyword Succeeds 60s 2s Get Car-Person Mappings And Verify @{CAR_PERSON_FOLLOWERS}[0] ${NUM_ENTRIES}
94 Get car-person mappings from Follower2
95 [Documentation] Get car-person mappings from Follower2 to see all entries
96 Wait Until Keyword Succeeds 60s 2s Get Car-Person Mappings And Verify @{CAR_PERSON_FOLLOWERS}[1] ${NUM_ENTRIES}