Fixing mininet reads so that we always clear mininet
[integration/test.git] / test / csit / suites / controller / MD_SAL_Cluster_Routed_RPC / 024_routed_rpc_crud_test.txt
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 Library           ../../../libraries/ClusterStateLibrary.py
10 Variables         ../../../variables/Variables.py
11
12 *** Variables ***
13 ${REST_CONTEXT}    /restconf/config/
14
15 *** Test Cases *** 
16 Add cars and get cars from Leader 
17     [Documentation]    Add 100 cars and get added cars from Leader
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
25     [Documentation]    Note: There should be one person added first to enable rpc
26         ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${0}    
27         ${resp}         AddPerson       ${MEMBER1}      ${PORT} ${100}  
28         ${resp}         GetPersons      ${MEMBER1}      ${PORT} ${0}
29         Should Be Equal As Strings    ${resp.status_code}    200
30         Should Contain     ${resp.content}   user5      
31
32 Add car-person mapping and get car-person mapping from Follower1
33     [Documentation]     Add car-person and get car-person from Follower1
34     [Documentation]  Note: This is done to enable working of rpc
35         ${resp}         AddCarPerson    ${MEMBER2}      ${PORT} ${0}
36         ${resp}         GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
37         Should Be Equal As Strings    ${resp.status_code}    200
38         Should Contain  ${resp.content} user0
39
40 Purchase 100 cars using Follower 
41     [Documentation]  Purchase 100 cars using Follower
42         SLEEP   10
43         ${resp}         BuyCar  ${MEMBER2}      ${PORT} ${100}  
44         ${resp}         GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
45         Should Be Equal As Strings    ${resp.status_code}    200
46
47 Get Cars from Leader
48     [Documentation]    Get 100 using Leader
49         ${resp}         Getcars ${MEMBER1}      ${PORT} ${0}
50         Should Be Equal As Strings    ${resp.status_code}    200
51         Should Contain  ${resp.content}         manufacturer9
52
53 Get persons from Leader
54     [Documentation]    Get 11 Persons from Leader
55         ${resp}         GetPersons      ${MEMBER1}      ${PORT} ${0}
56         Should Be Equal As Strings    ${resp.status_code}    200
57         Should Contain  ${resp.content}         user100
58
59 Get car-person mappings using Leader
60    [Documentation]      Get car-person mappings using Leader to see 100 entry
61         ${resp}         GetCarPersonMappings    ${MEMBER1}      ${PORT} ${0}
62         Should Be Equal As Strings    ${resp.status_code}    200
63         Should Contain  ${resp.content}         user100
64
65 Stop Leader
66    [Documentation]      Stop Leader controller
67         ${resp}         Stopcontroller  ${MEMBER1}      ${USERNAME}     ${PASSWORD}     ${KARAF_HOME}
68         SLEEP   30
69         ${resp}         Killcontroller  ${MEMBER1}      ${USERNAME}     ${PASSWORD}     ${KARAF_HOME}
70
71         
72 Add cars and get cars from Follower1 
73     [Documentation]    Add 100 cars and get added cars from Follower
74         ${resp}         AddCar  ${MEMBER2}      ${PORT} ${100}  
75         ${resp}         Getcars ${MEMBER2}      ${PORT} ${0}
76         Should Be Equal As Strings    ${resp.status_code}    200
77         Should Contain  ${resp.content}         manufacturer1
78
79 Add persons and get persons from Follower1
80     [Documentation]    Add 100 persons and get persons
81     [Documentation]    Note: There should be one person added first to enable rpc
82         ${resp}         AddPerson       ${MEMBER2}      ${PORT} ${0}    
83         ${resp}         AddPerson       ${MEMBER2}      ${PORT} ${100}  
84         ${resp}         GetPersons      ${MEMBER2}      ${PORT} ${0}
85         Should Be Equal As Strings    ${resp.status_code}    200
86         Should Contain  ${resp.content}         user5
87         SLEEP   10
88         
89 Purchase 100 cars using Follower2 
90     [Documentation]  Purchase 100 cars using Follower2
91         ${resp}         BuyCar  ${MEMBER3}      ${PORT} ${100}
92         SLEEP   10
93         ${resp}         GetCarPersonMappings    ${MEMBER3}      ${PORT} ${0}
94         Should Be Equal As Strings    ${resp.status_code}    200
95
96 Get Cars from Follower1
97     [Documentation]    Get 100 using Follower1
98         ${resp}         Getcars ${MEMBER2}      ${PORT} ${0}
99         Should Be Equal As Strings    ${resp.status_code}    200
100         Should Contain  ${resp.content}         manufacturer9
101
102 Get persons from Follower1
103     [Documentation]    Get 11 Persons from Follower1
104         ${resp}         GetPersons      ${MEMBER2}      ${PORT} ${0}
105         Should Be Equal As Strings    ${resp.status_code}    200
106         Should Contain  ${resp.content}         user100
107
108 Get car-person mappings using Follower1
109    [Documentation]      Get car-person mappings using Follower1 to see 100 entry
110         ${resp}         GetCarPersonMappings    ${MEMBER2}      ${PORT} ${0}
111         Should Be Equal As Strings    ${resp.status_code}    200
112         Should Contain  ${resp.content}         user100
113
114 Start Leader
115    [Documentation]      Start Leader controller 
116         ${resp}         Startcontroller ${MEMBER1}      ${USERNAME}     ${PASSWORD}     ${KARAF_HOME}
117         SLEEP   20
118