e5358aab5157ede27af6fd39a9b9b7139d40f7f6
[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
5 Library           ../../../libraries/CrudLibrary.py
6 Library           ../../../libraries/UtilLibrary.py
7 Library           ../../../libraries/ClusterStateLibrary.py
8 Resource          ../../../libraries/ClusterKeywords.txt
9 Variables         ../../../variables/Variables.py
10
11 *** Variables ***
12 ${CAR_SHARD}      shard-car-config
13 ${NUM_CARS}  ${50}
14
15 *** Test Cases ***
16 Get car leader
17     ${CAR_LEADER}    Wait For Leader  ${CAR_SHARD}
18     Set Suite Variable    ${CAR_LEADER}
19
20 Delete cars from leader
21     Delete All Cars And Verify   ${CAR_LEADER}
22
23 Stop all controllers after delete
24     StopAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
25
26 Start all controllers after delete
27     ${rc}    StartAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${RESTCONFPORT}
28     ...    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
29     Should Be True    ${rc}
30
31 Verify no cars on leader after restart
32     ${resp}  Getcars   ${CAR_LEADER}   ${PORT}   ${0}
33     Should Be Equal As Strings    ${resp.status_code}    404
34
35 Add cars on leader
36     Add Cars And Verify  ${CAR_LEADER}   ${NUM_CARS}
37
38 Stop all controllers after add
39     StopAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
40
41 Start all controllers after add
42     ${rc}    StartAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${RESTCONFPORT}
43     ...    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
44     Should Be True    ${rc}
45
46 Get cars from leader after restart
47     Wait Until Keyword Succeeds   60s  2s  Get Cars And Verify   ${CAR_LEADER}   ${NUM_CARS}
48
49 Get car followers
50     ${CAR_FOLLOWERS}   Get All Followers   ${CAR_SHARD}
51     Set Suite Variable  ${CAR_FOLLOWERS}
52
53 Get cars from Follower1 after restart
54     Wait Until Keyword Succeeds   60s  2s  Get Cars And Verify   @{CAR_FOLLOWERS}[0]   ${NUM_CARS}
55
56 Get cars from Follower2 after restart
57     Wait Until Keyword Succeeds   60s  2s  Get Cars And Verify   @{CAR_FOLLOWERS}[1]   ${NUM_CARS}
58