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 RequestsLibrary
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.robot
12 Variables ../../../variables/Variables.py
15 ${CAR_SHARD} shard-car-config
17 @{controllers} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
18 ${KARAF_HOME} ${WORKSPACE}/${BUNDLEFOLDER}
22 [Documentation] Stop all the controllers in the cluster
23 Stop One Or More Controllers @{controllers}
26 [Documentation] Clean the journals of all the controllers in the cluster
27 Clean One Or More Journals @{controllers}
30 [Documentation] Start all the controllers in the cluster
31 Start One Or More Controllers @{controllers}
33 Get car leader and followers
34 ${CURRENT_CAR_LEADER} Wait For Leader To Be Found ${CAR_SHARD}
35 Set Suite Variable ${CURRENT_CAR_LEADER}
36 ${CAR_FOLLOWERS} Get All Followers ${CAR_SHARD}
37 Set Suite Variable ${CAR_FOLLOWERS}
39 Stop both of the followers
40 @{followers} = Create List @{CAR_FOLLOWERS}[0] @{CAR_FOLLOWERS}[1]
41 Stop One Or More Controllers @{followers}
43 Attempt to add a car to the leader
44 [Documentation] Should fail as both followers are down
45 AddCar ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1} 500
47 ${resp} Getcars ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1}
48 Should Not Be Equal As Strings ${resp.status_code} 200
50 Restart the first follower
51 Start One Or More Controllers @{CAR_FOLLOWERS}[0]
53 Add cars to the first follower
54 Log Adding ${NUM_CARS} cars to @{CAR_FOLLOWERS}[0]
55 Add Cars And Verify Without Init @{CAR_FOLLOWERS}[0] ${NUM_CARS} 4s
57 Restart the second follower
58 Start One Or More Controllers @{CAR_FOLLOWERS}[1]
60 Get all the cars from the second follower
61 Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}
65 ${leader} GetLeader ${CAR_SHARD} ${3} ${1} ${1} ${RESTCONFPORT}
66 ... ${CURRENT_CAR_LEADER}
67 Should Be Equal As Strings ${leader} None