2 Documentation This test kills any of the followers and verifies that when that follower is restarted it can join the cluster
4 Library ../../../libraries/RequestsLibrary.py
5 Library ../../../libraries/Common.py
6 Library ../../../libraries/CrudLibrary.py
7 Library ../../../libraries/SettingsLibrary.py
8 Library ../../../libraries/UtilLibrary.py
9 Library ../../../libraries/ClusterStateLibrary.py
10 Variables ../../../variables/Variables.py
13 ${REST_CONTEXT} /restconf/config/
14 ${CAR_SHARD} shard-car-config
19 [Documentation] Stop all the controllers in the cluster
20 StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${MEMBER1} ${MEMBER2} ${MEMBER3}
24 [Documentation] Clean the journals of all the controllers in the cluster
25 CleanJournal ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
26 CleanJournal ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
27 CleanJournal ${MEMBER3} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
31 [Documentation] Start all the controllers in the cluster
32 ${rc} StartAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${RESTCONFPORT}
33 ... ${MEMBER1} ${MEMBER2} ${MEMBER3}
37 Get car leader and followers
38 ${CURRENT_CAR_LEADER} GetLeader ${CAR_SHARD} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
39 Set Suite Variable ${CURRENT_CAR_LEADER}
40 ${CAR_FOLLOWERS} GetFollowers ${CAR_SHARD} ${3} ${3} ${1} ${PORT} ${MEMBER1} ${MEMBER2} ${MEMBER3}
41 Set Suite Variable ${CAR_FOLLOWERS}
43 Stop both of the followers
44 StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} @{CAR_FOLLOWERS}[0] @{CAR_FOLLOWERS}[1]
46 Attempt to add a car from the leader
47 [Documentation] Should fail as both followers are down
48 ${resp} AddCar ${CURRENT_CAR_LEADER} ${PORT} ${1}
49 ${resp} Getcars ${CURRENT_CAR_LEADER} ${PORT} ${1}
50 Should Be Equal As Strings ${resp.status_code} 404
52 Restart the first follower
53 Startcontroller @{CAR_FOLLOWERS}[0] ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
56 Add cars from the first follower
57 ${resp} AddCar @{CAR_FOLLOWERS}[0] ${PORT} ${NUM_CARS}
58 Should Be Equal As Strings ${resp.status_code} 204
59 ${resp} Getcars @{CAR_FOLLOWERS}[0] ${PORT} ${0}
60 Should Be Equal As Strings ${resp.status_code} 200
61 :FOR ${i} IN RANGE 1 ${NUM_CARS}
62 \ Should Contain ${resp.content} manufacturer${i}
64 Restart the second follower
65 Startcontroller @{CAR_FOLLOWERS}[1] ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
68 Get all the cars from the second follower
69 ${resp} Getcars @{CAR_FOLLOWERS}[1] ${PORT} ${0}
70 Should Be Equal As Strings ${resp.status_code} 200
71 :FOR ${i} IN RANGE 1 ${NUM_CARS}
72 \ Should Contain ${resp.content} manufacturer${i}
74 Cleanup All Controllers
75 [Documentation] Stop all the controllers in the cluster
76 StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${MEMBER1} ${MEMBER2} ${MEMBER3}