GIT restructure - Adding project folders and features
[integration/test.git] / test / csit / suites / controller / MD_SAL_Cluster_Datastore / 140_recovery_restart_follower.txt
1 *** Settings ***
2 Documentation     This test kills any of the followers and verifies that when that follower is restarted it can join the cluster
3 Library           Collections
4 Library           ../../../libraries/RequestsLibrary.py
5 Library           ../../../libraries/Common.py
6 Library           ../../../libraries/CrudLibrary.py
7 Library           ../../../libraries/SettingsLibrary.py
8 Library           ../../../libraries/UtilLibrary.py
9 Library           ../../../libraries/ClusterStateLibrary.py
10 Variables         ../../../variables/Variables.py
11
12 *** Variables ***
13 ${REST_CONTEXT}    /restconf/config/
14 ${KARAF_HOME}      /root/odl/dist
15 ${USER_NAME}       root
16 ${PASSWORD}        Ecp123
17 ${CAR_SHARD}       shard-car-config
18
19 *** Test Cases *** 
20 Stop All Controllers
21     [Documentation]    Stop all the controllers in the cluster
22     Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
23     Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
24     Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
25     Sleep    30
26     KillController    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
27     KillController    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
28     KillController    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
29
30
31 Clean All Journals
32     [Documentation]    Clean the journals of all the controllers in the cluster
33     CleanJournal    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
34     CleanJournal    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
35     CleanJournal    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
36     Sleep    5
37
38 Start All Controllers
39     [Documentation]    Start all the controllers in the cluster
40     Startcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
41     Startcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
42     Startcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
43     Sleep    120
44
45 Delete all cars
46     [Documentation]    Delete all the cars from the system
47         ${resp}         DeleteAllCars   ${MEMBER1}      ${PORT}         0
48         ${resp}         GetCars ${MEMBER1}      ${PORT}         0
49         Should Be Equal As Strings    ${resp.status_code}    404
50         
51
52 Delete all people
53     [Documentation]    Delete all the people from the system
54         ${resp}         DeleteAllPersons        ${MEMBER1}      ${PORT}         0
55         ${resp}         GetPersons      ${MEMBER1}      ${PORT}    0    
56         Should Be Equal As Strings    ${resp.status_code}    404
57
58 Add 200 cars
59     [Documentation]    Add 200 cars
60         ${resp}         AddCar  ${MEMBER1}      ${PORT}  ${200}
61         Should Be Equal As Strings    ${resp.status_code}    204
62
63 Add 200 people
64     [Documentation]    Add 200 people
65         ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${0}    
66         ${resp}         AddPerson       ${MEMBER1}      ${PORT}  ${200}
67         Should Be Equal As Strings    ${resp.status_code}    204
68
69 Add Car Person mapping
70     [Documentation]    Add Car Persons
71         ${resp}         AddCarPerson    ${MEMBER1}      ${PORT} ${0}    
72         ${resp}         BuyCar  ${MEMBER1}      ${PORT} ${200}  
73
74 Stop one of the followers
75     ${followers}  GetFollowers  ${CAR_SHARD}  ${3}  ${3}  ${1}  8181  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
76     ${CAR_FOLLOWER}    Set Variable    ${followers[0]}
77     Set Suite Variable    ${CAR_FOLLOWER}
78     Stopcontroller    ${CAR_FOLLOWER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
79     Sleep    30
80     KillController    ${CAR_FOLLOWER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
81
82 Get all the cars from the other Follower
83     ${followers}  GetFollowers  ${CAR_SHARD}  ${3}  ${3}  ${1}  8181  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
84         ${resp}         Getcars ${followers[0]} ${PORT} ${0}
85         Should Be Equal As Strings    ${resp.status_code}    200
86         Should Contain     ${resp.content}   manufacturer1
87
88 Restart the Stopped Follower
89     Startcontroller   ${CAR_FOLLOWER}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
90     Sleep    120
91
92 Get all the cars from Stopped Follower
93         ${resp}         Getcars ${CAR_FOLLOWER} ${PORT} ${0}
94         Should Be Equal As Strings    ${resp.status_code}    200
95         Should Contain     ${resp.content}   manufacturer1
96
97 Cleanup All Controllers 
98     [Documentation]    Stop all the controllers in the cluster
99     Stopcontroller    ${MEMBER1}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
100     Stopcontroller    ${MEMBER2}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
101     Stopcontroller    ${MEMBER3}    ${USER_NAME}    ${PASSWORD}    ${KARAF_HOME}
102     Sleep    30
103
104
105