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/CrudLibrary.py
7 Resource ../../../libraries/ClusterKeywords.robot
8 Resource ../../../libraries/CarsAndPeople.robot
9 Variables ../../../variables/Variables.py
12 ${CAR_SHARD} shard-car-config
14 @{controllers} ${CONTROLLER} ${CONTROLLER1} ${CONTROLLER2}
15 ${KARAF_HOME} ${WORKSPACE}/${BUNDLEFOLDER}
21 [Documentation] Stop all the controllers in the cluster
22 Stop One Or More Controllers @{controllers}
23 Wait For Cluster Down ${STOP_TIMEOUT} @{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}
32 Wait For Cluster Sync ${START_TIMEOUT} @{controllers}
34 Get Car Leader And Followers
35 [Documentation] Find leader and followers in the car shard
36 ${CURRENT_CAR_LEADER} Get Leader And Verify ${CAR_SHARD}
37 Set Suite Variable ${CURRENT_CAR_LEADER}
38 ${CAR_FOLLOWERS} Get All Followers ${CAR_SHARD}
39 Set Suite Variable ${CAR_FOLLOWERS}
41 Verify No Cars On Leader After Restart
42 [Documentation] Verify no cars after restart
43 Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Check Cars Deleted ${CURRENT_CAR_LEADER}
45 Stop Both Of The Followers
46 [Documentation] Stop car followers
47 @{followers} = Create List @{CAR_FOLLOWERS}[0] @{CAR_FOLLOWERS}[1]
48 Stop One Or More Controllers @{followers}
49 Wait For Cluster Down ${STOP_TIMEOUT} @{followers}
51 Attempt To Add A Car To The Leader
52 [Documentation] Add car should fail as both followers are down
53 AddCar ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1} 500
55 ${resp} Getcars ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1}
56 Should Not Be Equal As Strings ${resp.status_code} 200
58 Restart The First Follower
59 [Documentation] Start one follower
60 Start One Or More Controllers @{CAR_FOLLOWERS}[0]
61 Wait For Controller Sync ${START_TIMEOUT} @{CAR_FOLLOWERS}[0]
63 Add Cars To The First Follower
64 [Documentation] Add cars to the follower and verify
65 Log Adding ${NUM_CARS} cars to @{CAR_FOLLOWERS}[0]
66 Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Add Cars And Verify Without Init @{CAR_FOLLOWERS}[0] ${NUM_CARS}
68 Restart The Second Follower
69 [Documentation] Start another follower
70 Start One Or More Controllers @{CAR_FOLLOWERS}[1]
71 Wait For Controller Sync ${START_TIMEOUT} @{CAR_FOLLOWERS}[1]
73 Get All The Cars From The Second Follower
74 [Documentation] Add cars to the follower and verify
75 Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}