2 Documentation Test suite for Connection Manager
4 Library OperatingSystem
5 Library RequestsLibrary
6 Resource ../../../libraries/OVSDB.robot
7 Resource ../../../libraries/SetupUtils.robot
8 Resource ../../../libraries/Utils.robot
9 Resource ../../../variables/Variables.robot
10 Resource ../../../variables/ovsdb/Variables.robot
12 Suite Setup OVSDB.Suite Setup
13 Suite Teardown Suite Teardown
14 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
24 @{NODE_LIST} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_NODE_PORT}
28 Make the OVS instance to listen for connection
29 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
30 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_NODE_PORT}
33 [Documentation] Initiate the connection to OVSDB node from controller
34 OVSDB.Connect To Ovsdb Node ${TOOLS_SYSTEM_IP}
35 BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Verify OVS Reports Connected
37 Get Operational Topology
38 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
39 BuiltIn.Wait Until Keyword Succeeds
42 ... Utils.Check For Elements At URI
43 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
45 ... pretty_print_json=True
48 [Documentation] This will create bridge on the specified OVSDB node.
49 OVSDB.Add Bridge To Ovsdb Node
50 ... ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
51 ... ${TOOLS_SYSTEM_IP}
55 Get Config Topology with Bridge
56 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
57 ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
58 Utils.Log Content ${resp.text}
59 BuiltIn.Should Contain ${resp.text} ${BRIDGE}
61 Get Operational Topology with Bridge
62 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
63 @{list} = BuiltIn.Create List ${BRIDGE}
64 BuiltIn.Wait Until Keyword Succeeds
67 ... Utils.Check For Elements At URI
68 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
70 ... pretty_print_json=True
72 Create Port and Attach to a Bridge
73 [Documentation] This request will creates port/interface and attach it to the specific bridge
74 OVSDB.Add Termination Point ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} ${BRIDGE} ${PORT} 10.0.0.10
76 Get Operational Topology with Port
77 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
78 @{list} = BuiltIn.Create List ${BRIDGE} ${PORT}
79 BuiltIn.Wait Until Keyword Succeeds
82 ... Utils.Check For Elements At URI
83 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
85 ... pretty_print_json=True
88 [Documentation] This request will delete the port node from the bridge node and data store.
89 RequestsLibrary.DELETE On Session
91 ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT}
92 ... expected_status=204
94 Get Operational Topology after Deletion of Port
95 [Documentation] This request will fetch the operational topology after the Port is deleted
96 @{list} = BuiltIn.Create List ${PORT}
97 BuiltIn.Wait Until Keyword Succeeds
100 ... Utils.Check For Elements Not At URI
101 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
103 ... pretty_print_json=True
106 [Documentation] This request will delete the bridge node from the config data store.
107 RequestsLibrary.DELETE On Session
109 ... url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
110 ... expected_status=204
112 Get Operational Topology after Deletion of Bridge
113 [Documentation] This request will fetch the operational topology after the Bridge is deleted
114 @{list} = BuiltIn.Create List ${BRIDGE} ${PORT}
115 BuiltIn.Wait Until Keyword Succeeds
118 ... Utils.Check For Elements Not At URI
119 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
121 ... pretty_print_json=True
123 Verify Config Still Has OVS Info
124 [Documentation] This will fetch the configuration topology from configuration data store to verify the node is still in the data store
125 ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
126 Utils.Log Content ${resp.text}
127 BuiltIn.Wait Until Keyword Succeeds
130 ... Utils.Check For Elements At URI
131 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
133 ... pretty_print_json=True
135 Delete the OVSDB Node
136 [Documentation] This request will delete the OVSDB node
137 RequestsLibrary.DELETE On Session session url=${RFC8040_SOUTHBOUND_NODE_TOOLS_API} expected_status=204
139 Get Operational Topology to make sure the connection has been deleted
140 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
141 @{list} = BuiltIn.Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
142 BuiltIn.Wait Until Keyword Succeeds
145 ... Utils.Check For Elements Not At URI
146 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
148 ... pretty_print_json=True
150 Get Configuration Topology to make sure the connection has been deleted
151 [Documentation] This request will fetch the configuration topology from the connected OVSDB nodes
152 @{list} = BuiltIn.Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
153 BuiltIn.Wait Until Keyword Succeeds
156 ... Utils.Check For Elements Not At URI
157 ... ${RFC8040_CONFIG_TOPO_OVSDB1_API}
159 ... pretty_print_json=True
161 Reconnect to OVSDB Node
162 [Documentation] Initiate the connection to OVSDB node from controller
163 OVSDB.Connect To Ovsdb Node ${TOOLS_SYSTEM_IP}
165 Get Operational Topology After Node Reconnect
166 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
167 BuiltIn.Wait Until Keyword Succeeds
170 ... Utils.Check For Elements At URI
171 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
173 ... pretty_print_json=True
175 Get Config Topology After Reconnect
176 [Documentation] This will fetch the configuration topology from configuration data store after reconnect
177 ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
178 Utils.Log Content ${resp.text}
179 BuiltIn.Wait Until Keyword Succeeds
182 ... Utils.Check For Elements At URI
183 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
185 ... pretty_print_json=True
187 Create OVSDB NODE HOST1
188 [Documentation] This request will create OVSDB NODE HOST1
189 OVSDB.Create Ovsdb Node ${TOOLS_SYSTEM_IP}
192 [Documentation] This request will create QOS entry
193 OVSDB.Create Qos ${QOS}
195 Create Queue entry to the queues list of a ovsdb node
196 [Documentation] This request will creates Queue entry in the queues list of a ovsdb node
197 OVSDB.Create Queue ${QUEUE}
199 Update existing Queue entry to a OVSDB Node
200 [Documentation] This request will update the existing queue entry to a OVSDB Node
201 OVSDB.Create Queue ${queue}
203 Update QOS with a Linked queue entry to a OVSDB Node
204 [Documentation] This request will update the QOS entry with a Linked queue entry to a OVSDB Node
205 OVSDB.Update Qos ${QOS}
207 Get QOS Config Topology with port
208 [Documentation] This will fetch the configuration topology from configuration data store to verify the QOS is added to the data store
209 ${resp} = RequestsLibrary.GET On Session
211 ... url=${RFC8040_CONFIG_TOPO_API}
212 ... expected_status=anything
213 Utils.Log Content ${resp.text}
214 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
215 BuiltIn.Should Contain ${resp.text} ${QOS}
217 Get QOS Operational Topology with port
218 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the QOS is added to the data store
219 @{list} = BuiltIn.Create List ${QOS}
220 BuiltIn.Wait Until Keyword Succeeds
223 ... Utils.Check For Elements At URI
224 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
226 ... pretty_print_json=True
228 Get Queue Config Topology with port
229 [Documentation] This request will fetch the configuration topology from configuration data store to verify the Queue is added to the data store
230 ${resp} = RequestsLibrary.GET On Session
232 ... url=${RFC8040_CONFIG_TOPO_API}
233 ... expected_status=anything
234 Utils.Log Content ${resp.text}
235 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
236 BuiltIn.Should Contain ${resp.text} ${QUEUE}
238 Get Queue Operational Topology with port
239 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the Queue is added to the data store
240 @{list} = BuiltIn.Create List ${QUEUE}
241 BuiltIn.Wait Until Keyword Succeeds
244 ... Utils.Check For Elements At URI
245 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
247 ... pretty_print_json=True
249 Delete a Queue entry from a Qos entry
250 [Documentation] This request will Delete a Queue entry from a Qos entry
251 ${resp} = RequestsLibrary.DELETE On Session
253 ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}/queue-list=0
254 ... expected_status=anything
255 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
257 Delete a QoS entry from a node
258 [Documentation] This request will Delete a QoS entry from a node.
259 ${resp} = RequestsLibrary.DELETE On Session
261 ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}
262 ... expected_status=anything
263 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
265 Delete a Queue entry from an ovsdb node
266 [Documentation] This request will Delete a Queue entry from an ovsdb node
267 ${resp} = RequestsLibrary.DELETE On Session
269 ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${QUEUE}
270 ... expected_status=anything
271 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
273 Delete the OVSDB Node HOST1
274 [Documentation] This request will delete the OVSDB node
275 ${resp} = RequestsLibrary.DELETE On Session
277 ... url=${RFC8040_SOUTHBOUND_NODE_HOST1_API}
278 ... expected_status=anything
279 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
281 Get Config Topology to verify that deleted configurations are cleaned from config datastore
282 [Documentation] This request will fetch the configuration topology from configuration data store to verify OVSDB NODE is deleted frrom the configuration data store
283 ${resp} = RequestsLibrary.GET On Session
285 ... url=${RFC8040_CONFIG_TOPO_API}
286 ... expected_status=anything
287 Utils.Log Content ${resp.text}
288 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
289 BuiltIn.Should Not Contain ${resp.text} ovsdb:HOST1
292 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
294 Utils.Check Karaf Log File Does Not Have Messages
296 ... SimpleShardDataTreeCohort.*Unexpected failure in validation phase
297 [Teardown] Utils.Report_Failure_Due_To_Bug 4756
300 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
302 Utils.Check Karaf Log File Does Not Have Messages
304 ... Shard.*shard-topology-operational An exception occurred while preCommitting transaction
305 [Teardown] Utils.Report_Failure_Due_To_Bug 4794
310 [Documentation] Cleans up test environment, close existing sessions.
311 @{uris} = Builtin.Create List ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
312 OVSDB.Suite Teardown ${uris}