2 Documentation This test kills any of the followers and verifies that when that follower is restarted it can join the cluster
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 ${CAR_SHARD} shard-car-config
21 [Documentation] Stop all the controllers in the cluster
22 StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${MEMBER1} ${MEMBER2} ${MEMBER3}
25 [Documentation] Clean the journals of all the controllers in the cluster
26 CleanJournal ${MEMBER1} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
27 CleanJournal ${MEMBER2} ${USER_NAME} ${PASSWORD} ${KARAF_HOME}
28 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} ${MEMBER1}
33 ... ${MEMBER2} ${MEMBER3}
36 Get car leader and followers
37 ${CURRENT_CAR_LEADER} Wait For Leader ${CAR_SHARD}
38 Set Suite Variable ${CURRENT_CAR_LEADER}
39 ${CAR_FOLLOWERS} Get All Followers ${CAR_SHARD}
40 Set Suite Variable ${CAR_FOLLOWERS}
42 Stop both of the followers
43 StopAllControllers ${USER_NAME} ${PASSWORD} ${KARAF_HOME} @{CAR_FOLLOWERS}[0] @{CAR_FOLLOWERS}[1]
44 Wait Until Keyword Succeeds 30s 2s Expect No Leader
46 Attempt to add a car from the leader
47 [Documentation] Should fail as both followers are down
48 AddCar ${CURRENT_CAR_LEADER} ${PORT} ${1}
50 ${resp} Getcars ${CURRENT_CAR_LEADER} ${PORT} ${1}
51 Should Not Be Equal As Strings ${resp.status_code} 200
53 Restart the first follower
54 StartController @{CAR_FOLLOWERS}[0] ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
57 Add cars from the first follower
58 Wait Until Keyword Succeeds 60s 2s Add Cars And Verify @{CAR_FOLLOWERS}[0] ${NUM_CARS} 4s
60 Restart the second follower
61 StartController @{CAR_FOLLOWERS}[1] ${USER_NAME} ${PASSWORD} ${KARAF_HOME} ${PORT}
63 Get all the cars from the second follower
64 Wait Until Keyword Succeeds 60s 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}
68 ${leader} GetLeader ${CAR_SHARD} ${3} ${1} ${1} ${PORT}
69 ... ${CURRENT_CAR_LEADER}
70 Should Be Equal As Strings ${leader} None