7 [Arguments] ${shard_name} ${old_leader}=${EMPTY}
8 ${leader} GetLeader ${shard_name} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
9 Should Not Be Equal As Strings ${leader} None
10 Run Keyword If '${old_leader}'!='${EMPTY}' Should Not Be Equal ${old_leader} ${leader}
14 [Arguments] ${shard_name}
15 ${leader} Wait Until Keyword Succeeds 60s 2s Get Leader And Verify ${shard_name}
20 [Arguments] ${shard_name} ${current_leader}
21 StopController ${current_leader} ${USERNAME} ${PASSWORD} ${KARAFHOME}
22 ${new_leader} Wait Until Keyword Succeeds 60s 2s Get Leader And Verify ${shard_name} ${current_leader}
24 [Return] ${new_leader}
27 [Arguments] ${shard_name}
28 ${followers} GetFollowers ${shard_name} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
30 Should Not Be Empty ${followers}
34 [Arguments] ${controller_ip} ${num_cars} ${timeout}=60s
35 ${resp} AddCar ${controller_ip} ${PORT} ${num_cars}
36 Should Be Equal As Strings ${resp.status_code} 204
37 Wait Until Keyword Succeeds ${timeout} 2s Get Cars And Verify ${controller_ip} ${num_cars}
40 [Arguments] ${controller_ip} ${num_cars}
41 ${resp} Getcars ${controller_ip} ${PORT} ${0}
42 Should Be Equal As Strings ${resp.status_code} 200
43 :FOR ${i} IN RANGE 1 ${num_cars}+1
44 \ Should Contain ${resp.content} manufacturer${i}
47 [Arguments] ${controller_ip} ${num_people}
48 [Documentation] Note: The first AddPerson call passed with 0 posts directly to the data store to get
49 [Documentation] the people container created so the subsequent AddPerson RPC calls that put
50 [Documentation] to the person list will succeed.
51 ${resp} AddPerson ${controller_ip} ${PORT} ${0}
52 Should Be Equal As Strings ${resp.status_code} 204
53 Wait Until Keyword Succeeds 60s 2s Get One Person And Verify ${controller_ip} ${0}
54 ${resp} AddPerson ${controller_ip} ${PORT} ${num_people}
55 Wait Until Keyword Succeeds 60s 2s Get People And Verify ${controller_ip} ${num_people}
57 Get One Person And Verify
58 [Arguments] ${controller_ip} ${number}
59 ${resp} GetPersons ${controller_ip} ${PORT} ${0}
60 Should Be Equal As Strings ${resp.status_code} 200
61 Should Contain ${resp.content} user${number}
64 [Arguments] ${controller_ip} ${num_people}
65 ${resp} GetPersons ${controller_ip} ${PORT} ${0}
66 Should Be Equal As Strings ${resp.status_code} 200
67 :FOR ${i} IN RANGE 1 ${num_people}+1
68 \ Should Contain ${resp.content} user${i}
70 Add Car Person And Verify
71 [Arguments] ${controller_ip}
72 [Documentation] Add a car-person via the data store and get the car-person from Leader.
73 [Documentation] Note: This is done to get the car-people container created so subsequent BuyCar
74 [Documentation] RPC puts to the car-person list will succeed.
75 AddCarPerson ${controller_ip} ${PORT} ${0}
76 Wait Until Keyword Succeeds 60s 2s Get One Car-Person Mapping And Verify ${controller_ip} ${0}
78 Get One Car-Person Mapping And Verify
79 [Arguments] ${controller_ip} ${number}
80 ${resp} GetCarPersonMappings ${controller_ip} ${PORT} ${0}
81 Should Be Equal As Strings ${resp.status_code} 200
82 Should Contain ${resp.content} user${number}
84 Get Car-Person Mappings And Verify
85 [Arguments] ${controller_ip} ${num_entries}
86 ${resp} GetCarPersonMappings ${controller_ip} ${PORT} ${0}
87 Should Be Equal As Strings ${resp.status_code} 200
88 :FOR ${i} IN RANGE 1 ${num_entries}+1
89 \ Should Contain ${resp.content} user${i}
92 [Arguments] ${controller_ip} ${num_entries} ${start}=${0}
93 Wait Until Keyword Succeeds 60s 2s BuyCar ${controller_ip} ${PORT} ${num_entries} ${start}
96 [Arguments] ${controller_ip}
97 ${resp} Getcars ${controller_ip} ${PORT} ${0}
98 Should Be Equal As Strings ${resp.status_code} 404
100 Delete All Cars And Verify
101 [Arguments] ${controller_ip}
102 DeleteAllCars ${controller_ip} ${PORT} ${0}
103 Wait Until Keyword Succeeds 60s 2s Check Cars Deleted ${controller_ip}
106 [Arguments] ${controller_ip}
107 ${resp} GetPersons ${controller_ip} ${PORT} ${0}
108 Should Be Equal As Strings ${resp.status_code} 404
110 Delete All People And Verify
111 [Arguments] ${controller_ip}
112 DeleteAllPersons ${controller_ip} ${PORT} ${0}
113 Wait Until Keyword Succeeds 60s 2s Check People Deleted ${controller_ip}
115 Check Cars-Persons Deleted
116 [Arguments] ${controller_ip}
117 ${resp} GetCarPersonMappings ${controller_ip} ${PORT} ${0}
118 Should Be Equal As Strings ${resp.status_code} 404
120 Delete All Cars-Persons And Verify
121 [Arguments] ${controller_ip}
122 DeleteAllCarsPersons ${controller_ip} ${PORT} ${0}
123 Wait Until Keyword Succeeds 60s 2s Check Cars-Persons Deleted ${controller_ip}