Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / ovsdb / Southbound_Domain / 030__configure_exit_ovsdb_node.robot
1 *** Settings ***
2 Documentation       Test suite for Connection Manager
3
4 Library             RequestsLibrary
5 Resource            ../../../libraries/OVSDB.robot
6 Resource            ../../../libraries/SetupUtils.robot
7 Resource            ../../../libraries/Utils.robot
8 Resource            ../../../variables/Variables.robot
9 Resource            ../../../variables/ovsdb/Variables.robot
10
11 Suite Setup         OVSDB.Suite Setup
12 Suite Teardown      Suite Teardown
13 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
14
15 Force Tags          southbound
16
17
18 *** Variables ***
19 ${BRIDGE}       ovsconf_exit_br
20 ${PORT1}        vx1
21 ${PORT2}        vx2
22 @{NODE_LIST}    ${BRIDGE}    ${PORT1}
23
24
25 *** Test Cases ***
26 Create a Topology in OVSDB node
27     [Documentation]    Create topology in OVSDB and ready it for further tests
28     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl del-manager
29     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl add-br ${BRIDGE}
30     Utils.Run Command On Mininet
31     ...    ${TOOLS_SYSTEM_IP}
32     ...    sudo ovs-vsctl add-port ${BRIDGE} ${PORT1} -- set Interface ${PORT1} type=vxlan options:remote_ip=192.168.1.11
33     Utils.Run Command On Mininet    ${TOOLS_SYSTEM_IP}    sudo ovs-vsctl set-manager ptcp:6634
34
35 Connect to OVSDB Node
36     [Documentation]    Initiate the connection to OVSDB node from controller
37     OVSDB.Connect To Ovsdb Node    ${TOOLS_SYSTEM_IP}
38
39 Get Operational Topology
40     [Documentation]    This request will fetch the operational topology from the connected OVSDB nodes
41     BuiltIn.Wait Until Keyword Succeeds
42     ...    8s
43     ...    2s
44     ...    Utils.Check For Elements At URI
45     ...    ${RFC8040_OPERATIONAL_TOPO_API}
46     ...    ${NODE_LIST}
47     ...    pretty_print_json=True
48     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
49
50 Verify Bridge Port Not In Config DS
51     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
52     @{list} =    BuiltIn.Create List    ${PORT1}
53     BuiltIn.Wait Until Keyword Succeeds
54     ...    8s
55     ...    2s
56     ...    Utils.Check For Elements Not At URI
57     ...    ${RFC8040_CONFIG_TOPO_API}
58     ...    ${list}
59     ...    pretty_print_json=True
60
61 Create bridge of already added bridge
62     [Documentation]    This will add bridge to the config datastore
63     OVSDB.Add Bridge To Ovsdb Node
64     ...    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
65     ...    ${TOOLS_SYSTEM_IP}
66     ...    ${BRIDGE}
67     ...    0000000000000030
68
69 Get Config Topology with Bridge
70     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
71     @{list} =    BuiltIn.Create List    ${BRIDGE}
72     BuiltIn.Wait Until Keyword Succeeds
73     ...    8s
74     ...    2s
75     ...    Utils.Check For Elements At URI
76     ...    ${RFC8040_CONFIG_TOPO_API}
77     ...    ${list}
78     ...    pretty_print_json=True
79
80 Create Port of already added port in OVSDB
81     [Documentation]    This will add port/interface to the config datastore
82     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.10
83
84 Get Config Topology with Bridge and Port
85     [Documentation]    This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
86     BuiltIn.Wait Until Keyword Succeeds
87     ...    8s
88     ...    2s
89     ...    Utils.Check For Elements At URI
90     ...    ${RFC8040_CONFIG_TOPO_API}
91     ...    ${NODE_LIST}
92     ...    pretty_print_json=True
93
94 Modify the destination IP of Port
95     [Documentation]    This will modify the dst ip of existing port
96     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT1}    10.0.0.19
97
98 Get Operational Topology with modified Port
99     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
100     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    10.0.0.19
101     BuiltIn.Wait Until Keyword Succeeds
102     ...    8s
103     ...    2s
104     ...    Utils.Check For Elements At URI
105     ...    ${RFC8040_OPERATIONAL_TOPO_API}
106     ...    ${list}
107     ...    pretty_print_json=True
108     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
109
110 Create Port and attach to a Bridge
111     [Documentation]    This request will creates port/interface and attach it to the specific bridge
112     OVSDB.Add Termination Point    ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}    ${BRIDGE}    ${PORT2}    10.0.0.121
113
114 Get Operational Topology with Port
115     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
116     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT2}
117     BuiltIn.Wait Until Keyword Succeeds
118     ...    8s
119     ...    2s
120     ...    Utils.Check For Elements At URI
121     ...    ${RFC8040_OPERATIONAL_TOPO_API}
122     ...    ${list}
123     ...    pretty_print_json=True
124     [Teardown]    Utils.Report_Failure_Due_To_Bug    5221
125
126 Delete the Port1
127     [Documentation]    This request will delete the port node from the bridge node and data store.
128     RequestsLibrary.DELETE On Session
129     ...    session
130     ...    url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT1}
131     ...    expected_status=204
132
133 Get Operational Topology after deletion of Port1
134     [Documentation]    This request will fetch the operational topology after the Port is added to the bridge
135     @{list} =    BuiltIn.Create List    ${PORT1}
136     BuiltIn.Wait Until Keyword Succeeds
137     ...    8s
138     ...    2s
139     ...    Utils.Check For Elements Not At URI
140     ...    ${RFC8040_OPERATIONAL_TOPO_API}
141     ...    ${list}
142     ...    pretty_print_json=True
143
144 Delete the Port2
145     [Documentation]    This request will delete the port node from the bridge node and data store.
146     RequestsLibrary.DELETE On Session
147     ...    session
148     ...    url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT2}
149     ...    expected_status=204
150
151 Get Operational Topology after Deletion of Port2
152     [Documentation]    This request will fetch the operational topology after the Port is deleted
153     @{list} =    BuiltIn.Create List    ${PORT2}
154     BuiltIn.Wait Until Keyword Succeeds
155     ...    8s
156     ...    2s
157     ...    Utils.Check For Elements Not At URI
158     ...    ${RFC8040_OPERATIONAL_TOPO_API}
159     ...    ${list}
160     ...    pretty_print_json=True
161
162 Delete the Bridge
163     [Documentation]    This request will delete the bridge node from the config data store.
164     RequestsLibrary.DELETE On Session
165     ...    session
166     ...    url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
167     ...    expected_status=204
168
169 Get Operational Topology after Deletion of Bridge
170     [Documentation]    This request will fetch the operational topology after the Bridge is deleted
171     @{list} =    BuiltIn.Create List    ${BRIDGE}    ${PORT1}    ${PORT2}
172     BuiltIn.Wait Until Keyword Succeeds
173     ...    8s
174     ...    2s
175     ...    Utils.Check For Elements Not At URI
176     ...    ${RFC8040_OPERATIONAL_TOPO_API}
177     ...    ${list}
178     ...    pretty_print_json=True
179
180 Delete the OVSDB Node
181     [Documentation]    This request will delete the OVSDB node
182     RequestsLibrary.DELETE On Session
183     ...    session
184     ...    url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
185     ...    expected_status=204
186
187 Get Operational Topology after Deletion of OVSDB Node
188     [Documentation]    This request will fetch the operational topology after the OVSDB node is deleted
189     @{list} =    BuiltIn.Create List
190     ...    ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
191     ...    ${BRIDGE}
192     ...    ${PORT1}
193     ...    ${PORT2}
194     BuiltIn.Wait Until Keyword Succeeds
195     ...    8s
196     ...    2s
197     ...    Utils.Check For Elements Not At URI
198     ...    ${RFC8040_OPERATIONAL_TOPO_API}
199     ...    ${list}
200     ...    pretty_print_json=True
201
202 Check For Bug 4756
203     [Documentation]    bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
204     ...    case executed
205     Utils.Check Karaf Log File Does Not Have Messages
206     ...    ${ODL_SYSTEM_IP}
207     ...    SimpleShardDataTreeCohort.*Unexpected failure in validation phase
208     [Teardown]    Utils.Report_Failure_Due_To_Bug    4756
209
210 Check For Bug 4794
211     [Documentation]    bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
212     ...    case executed.
213     Utils.Check Karaf Log File Does Not Have Messages
214     ...    ${ODL_SYSTEM_IP}
215     ...    Shard.*shard-topology-operational An exception occurred while preCommitting transaction
216     [Teardown]    Utils.Report_Failure_Due_To_Bug    4794
217
218
219 *** Keywords ***
220 Suite Teardown
221     [Documentation]    Cleans up test environment, close existing sessions.
222     @{uris} =    Builtin.Create List    ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
223     OVSDB.Suite Teardown    ${uris}