Fixing mininet reads so that we always clear mininet
[integration/test.git] / test / csit / suites / controller / MD_SAL_Cluster_Datastore / 050_failover_crud_on_any_follower.txt
1 *** Settings ***
2 Documentation     This test executes CRUD operations on any one follower after the old leader has been brought down
3 Library           ../../../libraries/CrudLibrary.py
4 Library           ../../../libraries/ClusterStateLibrary.py
5
6 *** Variables ***
7 ${SHARD}    shard-car-config
8
9 *** Test Cases ***
10 Find follower
11     [Documentation]    find follower
12   ${FOLLOWERS}    GetFollowers  ${SHARD}  ${3}  ${3}  ${2}  ${8181}  ${MEMBER1}  ${MEMBER2}  ${MEMBER3}
13   Log  ${FOLLOWERS}
14   ${LAST_FOLLOWER}  Set Variable  ${FOLLOWERS[0]}
15   Set Suite Variable    ${LAST_FOLLOWER}
16
17 Delete cars at last follower
18     [Documentation]    delete cars
19   DeleteAllCars  ${LAST_FOLLOWER}  ${PORT}  ${0}
20   ${resp}               Getcars ${LAST_FOLLOWER}        ${PORT} ${0}
21   Should Be Equal As Strings    ${resp.status_code}    404
22
23 Delete people at last follower
24     [Documentation]    delete people
25         DeleteAllPersons  ${LAST_FOLLOWER}  ${PORT}  ${0}
26         ${resp}         GetPersons      ${LAST_FOLLOWER}        ${PORT} ${0}
27   Should Be Equal As Strings    ${resp.status_code}    404
28
29 Add cars and get cars from last follower
30     [Documentation]    Add 40 cars and get added cars from last follower
31         ${resp}         AddCar  ${LAST_FOLLOWER}        ${PORT} ${40}
32         Sleep    8
33         ${resp}         Getcars ${LAST_FOLLOWER}        ${PORT} ${0}
34         Should Be Equal As Strings    ${resp.status_code}    200
35         Should Contain     ${resp.content}   manufacturer1
36         Should Contain     ${resp.content}   manufacturer40
37         Should Not Contain     ${resp.content}   manufacturer50
38
39 Add people and get people from last follower
40     [Documentation]    Add 40 persons and get people
41     [Documentation]    Note: There should be one person added first to enable rpc
42         ${resp}         AddPerson       ${LAST_FOLLOWER}        ${PORT} ${0}
43         ${resp}         AddPerson       ${LAST_FOLLOWER}        ${PORT} ${40}
44         Sleep    8
45         ${resp}         GetPersons      ${LAST_FOLLOWER}        ${PORT} ${0}
46         Should Be Equal As Strings    ${resp.status_code}    200
47         Should Contain     ${resp.content}   user2
48         Should Contain     ${resp.content}   user40
49         Should Not Contain     ${resp.content}   user50
50
51 Purchase 40 cars at last follower
52     [Documentation]     Add car-person and get car-person from last follower
53     [Documentation]  Note: This is done to enable working of rpc
54     [Documentation]  Purchase 40 cars using Leader
55   ${resp}               AddCarPerson    ${LAST_FOLLOWER}        ${PORT} ${0}
56         ${resp}         GetCarPersonMappings    ${LAST_FOLLOWER}        ${PORT} ${0}
57         Should Be Equal As Strings    ${resp.status_code}    200
58         Should Contain     ${resp.content}   user0
59         ${resp}         BuyCar  ${LAST_FOLLOWER}        ${PORT} ${40}
60         Sleep    8
61
62 Get car-person mappings at last follower
63    [Documentation]      Get car-person mappings using last follower to see 40 entry
64         ${resp}         GetCarPersonMappings    ${LAST_FOLLOWER}        ${PORT} ${0}
65         Should Be Equal As Strings    ${resp.status_code}    200
66         Should Contain     ${resp.content}   user5
67         Should Contain     ${resp.content}   user40