2 Documentation This test finds the followers of certain shards in a 3-Node cluster and executes CRUD operations on any one follower
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 Variables ../../../variables/Variables.py
14 ${REST_CONTEXT} /restconf/config/
15 ${SHARD_CAR_NAME} shard-car-config
16 ${SHARD_PEOPLE_NAME} shard-people-config
17 ${SHARD_CAR_PERSON_NAME} shard-car-people-config
22 ${CAR_FOLLOWERS} GetFollowers ${SHARD_CAR_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
24 SET SUITE VARIABLE ${CAR_FOLLOWERS}
27 ${PEOPLE_FOLLOWERS} GetFollowers ${SHARD_PEOPLE_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
28 Log ${PEOPLE_FOLLOWERS}
29 SET SUITE VARIABLE ${PEOPLE_FOLLOWERS}
31 Get Car-Person Followers
32 ${CAR_PERSON_FOLLOWERS} GetFollowers ${SHARD_CAR_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
33 Log ${CAR_PERSON_FOLLOWERS}
34 SET SUITE VARIABLE ${CAR_PERSON_FOLLOWERS}
36 Delete cars from Follower1
37 DeleteAllCars @{CAR_FOLLOWERS}[0] ${PORT} ${0}
38 ${resp} Getcars @{CAR_FOLLOWERS}[0] ${PORT} ${0}
39 Should Be Equal As Strings ${resp.status_code} 404
41 Delete people from Follower1
42 DeleteAllPersons @{PEOPLE_FOLLOWERS}[0] ${PORT} ${0}
43 ${resp} GetPersons @{PEOPLE_FOLLOWERS}[0] ${PORT} ${0}
44 Should Be Equal As Strings ${resp.status_code} 404
46 Delete car-persons from Follower1
47 DeleteAllCarsPersons @{CAR_PERSON_FOLLOWERS}[0] ${PORT} ${0}
48 ${resp} GetCarPersonMappings @{CAR_PERSON_FOLLOWERS}[0] ${PORT} ${0}
49 Should Be Equal As Strings ${resp.status_code} 404
51 Add cars and get cars from Follower1
52 [Documentation] Add cars and get added cars from Follower1
53 ${resp} AddCar @{CAR_FOLLOWERS}[0] ${PORT} ${NUM_ENTRIES}
54 ${resp} Getcars @{CAR_FOLLOWERS}[0] ${PORT} ${0}
55 Should Be Equal As Strings ${resp.status_code} 200
56 :FOR ${i} IN RANGE 1 ${NUM_ENTRIES}
57 \ Should Contain ${resp.content} manufacturer${i}
59 Get added cars using Follower2
60 [Documentation] Get added cars using Follower2
61 ${resp} Getcars @{CAR_FOLLOWERS}[1] ${PORT} ${0}
62 Should Be Equal As Strings ${resp.status_code} 200
63 :FOR ${i} IN RANGE 1 ${NUM_ENTRIES}
64 \ Should Contain ${resp.content} manufacturer${i}
66 Add persons and get persons from Follower1
67 [Documentation] Add persons and get persons from Follower1
68 [Documentation] Note: There should be one person added first to enable rpc
69 ${resp} AddPerson @{PEOPLE_FOLLOWERS}[0] ${PORT} ${0}
70 ${resp} AddPerson @{PEOPLE_FOLLOWERS}[0] ${PORT} ${NUM_ENTRIES}
72 ${resp} GetPersons @{PEOPLE_FOLLOWERS}[0] ${PORT} ${0}
73 Should Be Equal As Strings ${resp.status_code} 200
74 :FOR ${i} IN RANGE 1 ${NUM_ENTRIES}
75 \ Should Contain ${resp.content} user${i}
77 Add car-person mapping and get car-person mapping from Follower1
78 [Documentation] Add car-person and get car-person from Follower1
79 [Documentation] Note: This is done to enable working of rpc
81 ${resp} AddCarPerson @{CAR_PERSON_FOLLOWERS}[0] ${PORT} ${0}
83 ${resp} GetCarPersonMappings @{CAR_PERSON_FOLLOWERS}[0] ${PORT} ${0}
84 Should Be Equal As Strings ${resp.status_code} 200
85 Should Contain ${resp.content} user0
87 Purchase cars using Follower1
88 [Documentation] Purchase cars using Follower1
89 ${resp} BuyCar @{CAR_PERSON_FOLLOWERS}[0] ${PORT} ${NUM_ENTRIES}
92 Get car-person mappings using Follower1
93 [Documentation] Get car-person mappings using follower1 to see 100 entry
94 ${resp} GetCarPersonMappings @{CAR_PERSON_FOLLOWERS}[0] ${PORT} ${0}
95 Should Be Equal As Strings ${resp.status_code} 200
96 :FOR ${i} IN RANGE 1 ${NUM_ENTRIES}
97 \ Should Contain ${resp.content} user${i}
99 Get car-person mappings using Leader
100 [Documentation] Get car-person mappings using Leader to see 100 entry
101 ${CURRENT_CAR_LEADER} GetLeader ${SHARD_CAR_PERSON_NAME} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
102 Log ${CURRENT_CAR_LEADER}
104 ${resp} GetCarPersonMappings ${CURRENT_CAR_LEADER} ${PORT} ${0}
105 Should Be Equal As Strings ${resp.status_code} 200
106 :FOR ${i} IN RANGE 1 ${NUM_ENTRIES}
107 \ Should Contain ${resp.content} user${i}
109 Get car-person mappings using Follower2
110 [Documentation] Get car-person mappings using Follower2 to see 100 entry
111 ${resp} GetCarPersonMappings @{CAR_PERSON_FOLLOWERS}[1] ${PORT} ${0}
112 Should Be Equal As Strings ${resp.status_code} 200
113 :FOR ${i} IN RANGE 1 ${NUM_ENTRIES}
114 \ Should Contain ${resp.content} user${i}