259425f708d36d8e3d911e085d089275281d3ffa
[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 Resource          ../../../libraries/ClusterKeywords.robot
5 Resource          ../../../libraries/CarsAndPeople.robot
6 Variables         ../../../variables/Variables.py
7
8 *** Variables ***
9 ${CAR_SHARD}      shard-car-config
10 ${NUM_CARS}       ${50}
11 ${KARAF_HOME}     ${WORKSPACE}/${BUNDLEFOLDER}
12 @{controllers}    ${ODL_SYSTEM_IP}    ${ODL_SYSTEM_2_IP}    ${ODL_SYSTEM_3_IP}
13 ${START_TIMEOUT}    300s
14 ${STOP_TIMEOUT}    180s
15
16 *** Test Cases ***
17 Get Car Leader
18     [Documentation]    Find leader in the car shard
19     ${CAR_LEADER}    Get Leader And Verify    ${CAR_SHARD}
20     Set Suite Variable    ${CAR_LEADER}
21
22 Delete Cars From Leader
23     [Documentation]    Delete cars in Leader
24     Delete All Cars And Verify    ${CAR_LEADER}
25
26 Stop All Controllers After Delete
27     [Documentation]    Stop all controllers
28     Stop One Or More Controllers    @{controllers}
29     Wait For Cluster Down    ${STOP_TIMEOUT}    @{controllers}
30
31 Start All Controllers After Delete
32     [Documentation]    Start all controller
33     Start One Or More Controllers    @{controllers}
34     Wait For Cluster Sync    ${START_TIMEOUT}    @{controllers}
35
36 Get Car Leader After First Restart
37     [Documentation]    Find leader in the car shard
38     ${CAR_LEADER}    Get Leader And Verify    ${CAR_SHARD}
39     Set Suite Variable    ${CAR_LEADER}
40
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    ${CAR_LEADER}
44
45 Add Cars On Leader
46     [Documentation]    Add cars in Leader
47     Add Cars And Verify    ${CAR_LEADER}    ${NUM_CARS}
48
49 Stop All Controllers After Add
50     [Documentation]    Stop all controllers
51     Stop One Or More Controllers    @{controllers}
52     Wait For Cluster Down    ${STOP_TIMEOUT}    @{controllers}
53
54 Start All Controllers After Add
55     [Documentation]    Start all controllers
56     Start One Or More Controllers    @{controllers}
57     Wait For Cluster Sync    ${START_TIMEOUT}    @{controllers}
58
59 Get Car Leader After Second Restart
60     [Documentation]    Find leader in the car shard
61     ${CAR_LEADER}    Get Leader And Verify    ${CAR_SHARD}
62     Set Suite Variable    ${CAR_LEADER}
63
64 Get Cars From Leader After Restart
65     [Documentation]    Get cars from Leader and verify
66     Wait Until Keyword Succeeds    ${START_TIMEOUT}    2s    Get Cars And Verify    ${CAR_LEADER}    ${NUM_CARS}
67
68 Get Car Followers
69     [Documentation]    Find followers in the car shard
70     ${CAR_FOLLOWERS}    Get All Followers    ${CAR_SHARD}
71     Set Suite Variable    ${CAR_FOLLOWERS}
72
73 Get Cars From Follower1 After Restart
74     [Documentation]    Get cars in follower and verify
75     Wait Until Keyword Succeeds    ${START_TIMEOUT}    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
76
77 Get Cars From Follower2 After Restart
78     [Documentation]    Get cars in follower and verify
79     Wait Until Keyword Succeeds    ${START_TIMEOUT}    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[1]    ${NUM_CARS}