c7eb7815bb84793ebb5fd3a0bfcb705d1d196e38
[integration/test.git] / test / csit / suites / controller / Clustering_Routedrpc / 023_routed_rpc_crud_test.robot
1 *** Settings ***
2 Documentation     Test suite for Routed RPC.
3 Library           Collections
4 Library           RequestsLibrary
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 @{controllers}    ${CONTROLLER}    ${CONTROLLER1}    ${CONTROLLER2}
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    ${CONTROLLER}    ${PORT}
18     ${resp}    AddCar    ${CONTROLLER}    ${PORT}    ${100}
19     ${resp}    Getcars    ${CONTROLLER}    ${PORT}    ${0}
20     Should Be Equal As Strings    ${resp.status_code}    200
21     Should Contain    ${resp.content}    manufacturer1    cars not added!
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    ${CONTROLLER}    ${PORT}    ${0}
26     ${resp}    AddPerson    ${CONTROLLER}    ${PORT}    ${100}
27     ${resp}    GetPersons    ${CONTROLLER}    ${PORT}    ${0}
28     Should Be Equal As Strings    ${resp.status_code}    200
29     Should Contain    ${resp.content}    user5    people not added!
30
31 Add car-person mapping and get car-person mapping from Follower1
32     [Documentation]    Add car-person and get car-person from Leader Note: This is done to enable working of rpc
33     ${resp}    AddCarPerson    ${CONTROLLER1}    ${PORT}    ${0}
34     ${resp}    GetCarPersonMappings    ${CONTROLLER1}    ${PORT}    ${0}
35     Should Be Equal As Strings    ${resp.status_code}    200
36     Should Contain    ${resp.content}    user0    car-person not initialized!
37
38 Purchase 100 cars using Follower1
39     [Documentation]    Purchase 100 cars using Follower1
40     ${resp}    BuyCar    ${CONTROLLER1}    ${PORT}    ${100}
41     ${resp}    GetCarPersonMappings    ${CONTROLLER1}    ${PORT}    ${0}
42     Should Be Equal As Strings    ${resp.status_code}    200
43
44 Get Cars from Leader
45     [Documentation]    Get 100 using Leader
46     ${resp}    Getcars    ${CONTROLLER}    ${PORT}    ${0}
47     Should Be Equal As Strings    ${resp.status_code}    200
48     Should Contain    ${resp.content}    manufacturer99
49
50 Get persons from Leader
51     [Documentation]    Get 101 Persons from Leader
52     ${resp}    GetPersons    ${CONTROLLER}    ${PORT}    ${0}
53     Should Be Equal As Strings    ${resp.status_code}    200
54     Should Contain    ${resp.content}    user100
55
56 Get car-person mappings using Leader
57     [Documentation]    Get 101 car-person mappings using Leader to see 100 entry
58     ${resp}    GetCarPersonMappings    ${CONTROLLER}    ${PORT}    ${0}
59     Should Be Equal As Strings    ${resp.status_code}    200
60     Should Contain    ${resp.content}    user100