Step 1: Move vm scripts to the right place
[integration/test.git] / csit / suites / controller / Clustering_Datastore / 050_car_persistence_recovery.robot
1 *** Settings ***
2 Documentation     This test restarts all controllers to verify recovery of car data from persistene
3 Default Tags      3-node-cluster
4 Library           ../../../libraries/CrudLibrary.py
5 Library           ../../../libraries/UtilLibrary.py
6 Library           ../../../libraries/ClusterStateLibrary.py
7 Resource          ../../../libraries/ClusterKeywords.robot
8 Variables         ../../../variables/Variables.py
9
10 *** Variables ***
11 ${CAR_SHARD}      shard-car-config
12 ${NUM_CARS}       ${50}
13 ${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
14 @{controllers}    ${CONTROLLER}    ${CONTROLLER1}    ${CONTROLLER2}
15
16 *** Test Cases ***
17 Get car leader
18     ${CAR_LEADER}    Wait For Leader To Be Found    ${CAR_SHARD}
19     Set Suite Variable    ${CAR_LEADER}
20
21 Delete cars from leader
22     Delete All Cars And Verify    ${CAR_LEADER}
23
24 Stop all controllers after delete
25     Stop One Or More Controllers    @{controllers}
26
27 Start all controllers after delete
28     Start One Or More Controllers    @{controllers}
29
30 Verify no cars on leader after restart
31     ${resp}    Getcars    ${CAR_LEADER}    ${RESTCONFPORT}    ${0}
32     Should Be Equal As Strings    ${resp.status_code}    404
33
34 Add cars on leader
35     Add Cars And Verify    ${CAR_LEADER}    ${NUM_CARS}
36
37 Stop all controllers after add
38     Stop One Or More Controllers    @{controllers}
39
40 Start all controllers after add
41     Start One Or More Controllers    @{controllers}
42
43 Get cars from leader after restart
44     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${CAR_LEADER}    ${NUM_CARS}
45
46 Get car followers
47     ${CAR_FOLLOWERS}    Get All Followers    ${CAR_SHARD}
48     Set Suite Variable    ${CAR_FOLLOWERS}
49
50 Get cars from Follower1 after restart
51     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
52
53 Get cars from Follower2 after restart
54     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[1]    ${NUM_CARS}