Tidy for clustering test suite.
[integration/test.git] / test / csit / suites / 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.txt
8 Variables         ../../../variables/Variables.py
9
10 *** Variables ***
11 ${CAR_SHARD}      shard-car-config
12 ${NUM_CARS}       ${50}
13
14 *** Test Cases ***
15 Get car leader
16     ${CAR_LEADER}    Wait For Leader    ${CAR_SHARD}
17     Set Suite Variable    ${CAR_LEADER}
18
19 Delete cars from leader
20     Delete All Cars And Verify    ${CAR_LEADER}
21
22 Stop all controllers after delete
23     StopAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
24
25 Start all controllers after delete
26     ${rc}    StartAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${RESTCONFPORT}    ${MEMBER1}
27     ...    ${MEMBER2}    ${MEMBER3}
28     Should Be True    ${rc}
29
30 Verify no cars on leader after restart
31     ${resp}    Getcars    ${CAR_LEADER}    ${PORT}    ${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     StopAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
39
40 Start all controllers after add
41     ${rc}    StartAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${RESTCONFPORT}    ${MEMBER1}
42     ...    ${MEMBER2}    ${MEMBER3}
43     Should Be True    ${rc}
44
45 Get cars from leader after restart
46     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    ${CAR_LEADER}    ${NUM_CARS}
47
48 Get car followers
49     ${CAR_FOLLOWERS}    Get All Followers    ${CAR_SHARD}
50     Set Suite Variable    ${CAR_FOLLOWERS}
51
52 Get cars from Follower1 after restart
53     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[0]    ${NUM_CARS}
54
55 Get cars from Follower2 after restart
56     Wait Until Keyword Succeeds    60s    2s    Get Cars And Verify    @{CAR_FOLLOWERS}[1]    ${NUM_CARS}