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} ${ODL_SYSTEM_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP}
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}
28 Clean One Or More Snapshots @{controllers}
31 [Documentation] Start all the controllers in the cluster
32 Start One Or More Controllers @{controllers}
33 Wait For Cluster Sync ${START_TIMEOUT} @{controllers}
35 Get Car Leader And Followers
36 [Documentation] Find leader and followers in the car shard
37 ${CURRENT_CAR_LEADER} Get Leader And Verify ${CAR_SHARD}
38 Set Suite Variable ${CURRENT_CAR_LEADER}
39 ${CAR_FOLLOWERS} Get All Followers ${CAR_SHARD}
40 Set Suite Variable ${CAR_FOLLOWERS}
42 Verify No Cars On Leader After Restart
43 [Documentation] Verify no cars after restart
44 Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Check Cars Deleted ${CURRENT_CAR_LEADER}
46 Stop Both Of The Followers
47 [Documentation] Stop car followers
48 @{followers} = Create List @{CAR_FOLLOWERS}[0] @{CAR_FOLLOWERS}[1]
49 Stop One Or More Controllers @{followers}
50 Wait For Cluster Down ${STOP_TIMEOUT} @{followers}
52 Attempt To Add A Car To The Leader
53 [Documentation] Add car should fail as both followers are down
54 AddCar ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1} 500 503
56 ${resp} Getcars ${CURRENT_CAR_LEADER} ${RESTCONFPORT} ${1}
57 Should Not Be Equal As Strings ${resp.status_code} 200
59 Restart The First Follower
60 [Documentation] Start one follower
61 Start One Or More Controllers @{CAR_FOLLOWERS}[0]
62 Wait For Controller Sync ${START_TIMEOUT} @{CAR_FOLLOWERS}[0]
64 Add Cars To The First Follower
65 [Documentation] Add cars to the follower and verify
66 Log Adding ${NUM_CARS} cars to @{CAR_FOLLOWERS}[0]
67 Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Add Cars And Verify Without Init @{CAR_FOLLOWERS}[0] ${NUM_CARS}
69 Restart The Second Follower
70 [Documentation] Start another follower
71 Start One Or More Controllers @{CAR_FOLLOWERS}[1]
72 Wait For Controller Sync ${START_TIMEOUT} @{CAR_FOLLOWERS}[1]
74 Get All The Cars From The Second Follower
75 [Documentation] Add cars to the follower and verify
76 Wait Until Keyword Succeeds ${START_TIMEOUT} 2s Get Cars And Verify @{CAR_FOLLOWERS}[1] ${NUM_CARS}