Enhancements to 3-node cluster tests
[integration/test.git] / test / csit / suites / clustering / datastore / 050_car_persistence_recovery.txt
1 *** Settings ***
2 Documentation     This test restarts all controllers to verify recovery of car data from persistene
3 Library           ../../../libraries/CrudLibrary.py
4 Library           ../../../libraries/UtilLibrary.py
5 Library           ../../../libraries/ClusterStateLibrary.py
6 Variables         ../../../variables/Variables.py
7
8 *** Variables ***
9 ${CAR_SHARD}      shard-car-config
10 ${NUM_CARS}  ${50}
11
12 *** Test Cases ***
13 Get car leader
14     ${CAR_LEADER}    GetLeader  ${CAR_SHARD}  ${3}  ${3}  ${2}  ${PORT}  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
15     Should Not Be Equal As Strings   ${CAR_LEADER}   None
16     Set Suite Variable    ${CAR_LEADER}
17
18 Delete cars from leader
19     DeleteAllCars  ${CAR_LEADER}  ${PORT}  ${0}
20     ${resp}     Getcars   ${CAR_LEADER}   ${PORT}   ${0}
21     Should Be Equal As Strings    ${resp.status_code}    404
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     ${resp}             AddCar    ${CAR_LEADER}   ${PORT}   ${NUM_CARS}
37     ${resp}             Getcars   ${CAR_LEADER}   ${PORT}   ${0}
38     Should Be Equal As Strings    ${resp.status_code}    200
39     :FOR    ${i}    IN RANGE    1    ${NUM_CARS}
40     \    Should Contain     ${resp.content}   manufacturer${i}
41
42 Stop all controllers after add
43     StopAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
44
45 Start all controllers after add
46     ${rc}    StartAllControllers    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}    ${RESTCONFPORT}
47     ...    ${MEMBER1}    ${MEMBER2}    ${MEMBER3}
48     Should Be True    ${rc}
49
50 Get cars from leader after restart
51     ${resp}  Getcars   ${CAR_LEADER}   ${PORT}   ${0}
52     Should Be Equal As Strings    ${resp.status_code}    200
53     :FOR    ${i}    IN RANGE    1    ${NUM_CARS}
54     \    Should Contain     ${resp.content}   manufacturer${i}
55