Tidy for clustering test suite.
[integration/test.git] / test / csit / suites / clustering / routedrpc / 023_routed_rpc_crud_test.robot
1 *** Settings ***
2 Documentation     Test suite for Routed RPC.
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 Variables         ../../../variables/Variables.py
10
11 *** Variables ***
12 ${REST_CONTEXT}    /restconf/config/
13
14 *** Test Cases ***
15 Add cars and get cars from Leader
16     [Documentation]    Add 100 cars and get added cars from Leader
17     ${resp}    InitCar    ${MEMBER1}    ${PORT}
18     ${resp}    AddCar    ${MEMBER1}    ${PORT}    ${100}
19     ${resp}    Getcars    ${MEMBER1}    ${PORT}    ${0}
20     Should Be Equal As Strings    ${resp.status_code}    200
21     Should Contain    ${resp.content}    manufacturer1
22
23 Add persons and get persons from Leader
24     [Documentation]    Add 100 persons and get persons Note: There should be one person added first to enable rpc
25     ${resp}    AddPerson    ${MEMBER1}    ${PORT}    ${0}
26     ${resp}    AddPerson    ${MEMBER1}    ${PORT}    ${100}
27     ${resp}    GetPersons    ${MEMBER1}    ${PORT}    ${0}
28     Should Be Equal As Strings    ${resp.status_code}    200
29     Should Contain    ${resp.content}    user5
30     SLEEP    10
31
32 Add car-person mapping and get car-person mapping from Follower1
33     [Documentation]    Add car-person and get car-person from Leader Note: This is done to enable working of rpc
34     ${resp}    AddCarPerson    ${MEMBER2}    ${PORT}    ${0}
35     ${resp}    GetCarPersonMappings    ${MEMBER2}    ${PORT}    ${0}
36     Should Be Equal As Strings    ${resp.status_code}    200
37     Should Contain    ${resp.content}    user0
38     SLEEP    5
39
40 Purchase 100 cars using Follower1
41     [Documentation]    Purchase 100 cars using Follower1
42     ${resp}    BuyCar    ${MEMBER2}    ${PORT}    ${100}
43     ${resp}    GetCarPersonMappings    ${MEMBER2}    ${PORT}    ${0}
44     Should Be Equal As Strings    ${resp.status_code}    200
45
46 Get Cars from Leader
47     [Documentation]    Get 100 using Leader
48     ${resp}    Getcars    ${MEMBER1}    ${PORT}    ${0}
49     Should Be Equal As Strings    ${resp.status_code}    200
50     Should Contain    ${resp.content}    manufacturer99
51
52 Get persons from Leader
53     [Documentation]    Get 101 Persons from Leader
54     ${resp}    GetPersons    ${MEMBER1}    ${PORT}    ${0}
55     Should Be Equal As Strings    ${resp.status_code}    200
56     Should Contain    ${resp.content}    user100
57
58 Get car-person mappings using Leader
59     [Documentation]    Get 101 car-person mappings using Leader to see 100 entry
60     ${resp}    GetCarPersonMappings    ${MEMBER1}    ${PORT}    ${0}
61     Should Be Equal As Strings    ${resp.status_code}    200
62     Should Contain    ${resp.content}    user100