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 Request session ${RFC8040_CONFIG_TOPO_API}
58 OVSDB.Log Request ${resp.text}
59 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
60 BuiltIn.Should Contain ${resp.text} ${BRIDGE}
62 Get Operational Topology with Bridge
63 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
64 @{list} = BuiltIn.Create List ${BRIDGE}
65 BuiltIn.Wait Until Keyword Succeeds
68 ... Utils.Check For Elements At URI
69 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
71 ... pretty_print_json=True
73 Create Port and Attach to a Bridge
74 [Documentation] This request will creates port/interface and attach it to the specific bridge
75 OVSDB.Add Termination Point ${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} ${BRIDGE} ${PORT} 10.0.0.10
77 Get Operational Topology with Port
78 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
79 @{list} = BuiltIn.Create List ${BRIDGE} ${PORT}
80 BuiltIn.Wait Until Keyword Succeeds
83 ... Utils.Check For Elements At URI
84 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
86 ... pretty_print_json=True
89 [Documentation] This request will delete the port node from the bridge node and data store.
90 ${resp} = RequestsLibrary.Delete Request
92 ... ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}/termination-point=${PORT}
93 BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
95 Get Operational Topology after Deletion of Port
96 [Documentation] This request will fetch the operational topology after the Port is deleted
97 @{list} = BuiltIn.Create List ${PORT}
98 BuiltIn.Wait Until Keyword Succeeds
101 ... Utils.Check For Elements Not At URI
102 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
104 ... pretty_print_json=True
107 [Documentation] This request will delete the bridge node from the config data store.
108 ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}%2Fbridge%2F${BRIDGE}
109 BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
111 Get Operational Topology after Deletion of Bridge
112 [Documentation] This request will fetch the operational topology after the Bridge is deleted
113 @{list} = BuiltIn.Create List ${BRIDGE} ${PORT}
114 BuiltIn.Wait Until Keyword Succeeds
117 ... Utils.Check For Elements Not At URI
118 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
120 ... pretty_print_json=True
122 Verify Config Still Has OVS Info
123 [Documentation] This will fetch the configuration topology from configuration data store to verify the node is still in the data store
124 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
125 OVSDB.Log Request ${resp.text}
126 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
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 ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
138 BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
140 Get Operational Topology to make sure the connection has been deleted
141 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
142 @{list} = BuiltIn.Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
143 BuiltIn.Wait Until Keyword Succeeds
146 ... Utils.Check For Elements Not At URI
147 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
149 ... pretty_print_json=True
151 Get Configuration Topology to make sure the connection has been deleted
152 [Documentation] This request will fetch the configuration topology from the connected OVSDB nodes
153 @{list} = BuiltIn.Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}
154 BuiltIn.Wait Until Keyword Succeeds
157 ... Utils.Check For Elements Not At URI
158 ... ${RFC8040_CONFIG_TOPO_OVSDB1_API}
160 ... pretty_print_json=True
162 Reconnect to OVSDB Node
163 [Documentation] Initiate the connection to OVSDB node from controller
164 OVSDB.Connect To Ovsdb Node ${TOOLS_SYSTEM_IP}
166 Get Operational Topology After Node Reconnect
167 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
168 BuiltIn.Wait Until Keyword Succeeds
171 ... Utils.Check For Elements At URI
172 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
174 ... pretty_print_json=True
176 Get Config Topology After Reconnect
177 [Documentation] This will fetch the configuration topology from configuration data store after reconnect
178 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
179 OVSDB.Log Request ${resp.text}
180 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
181 BuiltIn.Wait Until Keyword Succeeds
184 ... Utils.Check For Elements At URI
185 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
187 ... pretty_print_json=True
189 Create OVSDB NODE HOST1
190 [Documentation] This request will create OVSDB NODE HOST1
191 OVSDB.Create Ovsdb Node ${TOOLS_SYSTEM_IP}
194 [Documentation] This request will create QOS entry
195 OVSDB.Create Qos ${QOS}
197 Create Queue entry to the queues list of a ovsdb node
198 [Documentation] This request will creates Queue entry in the queues list of a ovsdb node
199 OVSDB.Create Queue ${QUEUE}
201 Update existing Queue entry to a OVSDB Node
202 [Documentation] This request will update the existing queue entry to a OVSDB Node
203 OVSDB.Create Queue ${queue}
205 Update QOS with a Linked queue entry to a OVSDB Node
206 [Documentation] This request will update the QOS entry with a Linked queue entry to a OVSDB Node
207 OVSDB.Update Qos ${QOS}
209 Get QOS Config Topology with port
210 [Documentation] This will fetch the configuration topology from configuration data store to verify the QOS is added to the data store
211 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
212 OVSDB.Log Request ${resp.text}
213 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
214 BuiltIn.Should Contain ${resp.text} ${QOS}
216 Get QOS Operational Topology with port
217 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the QOS is added to the data store
218 @{list} = BuiltIn.Create List ${QOS}
219 BuiltIn.Wait Until Keyword Succeeds
222 ... Utils.Check For Elements At URI
223 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
225 ... pretty_print_json=True
227 Get Queue Config Topology with port
228 [Documentation] This request will fetch the configuration topology from configuration data store to verify the Queue is added to the data store
229 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
230 OVSDB.Log Request ${resp.text}
231 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
232 BuiltIn.Should Contain ${resp.text} ${QUEUE}
234 Get Queue Operational Topology with port
235 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the Queue is added to the data store
236 @{list} = BuiltIn.Create List ${QUEUE}
237 BuiltIn.Wait Until Keyword Succeeds
240 ... Utils.Check For Elements At URI
241 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
243 ... pretty_print_json=True
245 Delete a Queue entry from a Qos entry
246 [Documentation] This request will Delete a Queue entry from a Qos entry
247 ${resp} = RequestsLibrary.Delete Request
249 ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}/queue-list=0
250 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
252 Delete a QoS entry from a node
253 [Documentation] This request will Delete a QoS entry from a node.
254 ${resp} = RequestsLibrary.Delete Request
256 ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:qos-entries=${QOS}
257 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
259 Delete a Queue entry from an ovsdb node
260 [Documentation] This request will Delete a Queue entry from an ovsdb node
261 ${resp} = RequestsLibrary.Delete Request
263 ... ${RFC8040_SOUTHBOUND_NODE_HOST1_API}/ovsdb:queues=${QUEUE}
264 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
266 Delete the OVSDB Node HOST1
267 [Documentation] This request will delete the OVSDB node
268 ${resp} = RequestsLibrary.Delete Request session ${RFC8040_SOUTHBOUND_NODE_HOST1_API}
269 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
271 Get Config Topology to verify that deleted configurations are cleaned from config datastore
272 [Documentation] This request will fetch the configuration topology from configuration data store to verify OVSDB NODE is deleted frrom the configuration data store
273 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
274 OVSDB.Log Request ${resp.text}
275 BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
276 BuiltIn.Should Not Contain ${resp.text} ovsdb:HOST1
279 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
281 Utils.Check Karaf Log File Does Not Have Messages
283 ... SimpleShardDataTreeCohort.*Unexpected failure in validation phase
284 [Teardown] Utils.Report_Failure_Due_To_Bug 4756
287 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
289 Utils.Check Karaf Log File Does Not Have Messages
291 ... Shard.*shard-topology-operational An exception occurred while preCommitting transaction
292 [Teardown] Utils.Report_Failure_Due_To_Bug 4794
297 [Documentation] Cleans up test environment, close existing sessions.
298 @{uris} = Builtin.Create List ${RFC8040_SOUTHBOUND_NODE_TOOLS_API}
299 OVSDB.Suite Teardown ${uris}