2 Documentation Test suite for Connection Manager
4 Library RequestsLibrary
5 Resource ../../../libraries/SetupUtils.robot
6 Resource ../../../libraries/Utils.robot
7 Resource ../../../libraries/OVSDB.robot
8 Resource ../../../variables/Variables.robot
9 Resource ../../../variables/ovsdb/Variables.robot
11 Suite Setup OVSDB.Suite Setup
12 Suite Teardown Suite Teardown
13 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
21 @{NODE_LIST} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_NODE_PORT}
22 ${OVSDB_UUID} ${EMPTY}
26 Connecting an OVS instance to the controller
27 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
28 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
29 BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Verify OVS Reports Connected
31 Get Operational Topology to verify the ovs instance is connected to the controller
32 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
33 @{list} = BuiltIn.Create List ovsdb://uuid "remote-ip":"${TOOLS_SYSTEM_IP}" "local-port":${OVSDBPORT}
34 BuiltIn.Wait Until Keyword Succeeds
37 ... Utils.Check For Elements At URI
38 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
40 ... pretty_print_json=True
41 ${OVSDB_UUID} = OVSDB.Get OVSDB UUID ${TOOLS_SYSTEM_IP}
42 BuiltIn.Set Suite Variable ${OVSDB_UUID}
44 Verify OVS Not In Config Topology
45 [Documentation] This request will fetch the configuration topology from configuration data store
46 Utils.Check For Elements Not At URI ${RFC8040_CONFIG_TOPO_API} ${NODE_LIST} pretty_print_json=True
48 Create bridge manually
49 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-br ${BRIDGE1}
51 Get Operational Topology to verify the bridge has been added
52 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
53 @{list} = BuiltIn.Create List ${BRIDGE1}
54 BuiltIn.Wait Until Keyword Succeeds
57 ... Utils.Check For Elements At URI
58 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
60 ... pretty_print_json=True
62 Get Config Topology to verify the manually added bridge is not added to the config datastore
63 [Documentation] This request will fetch the configuration topology from configuration data store
64 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
65 OVSDB.Log Request ${resp.text}
66 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
67 BuiltIn.Should Not Contain ${resp.text} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}/bridge/${BRIDGE1}
69 Create a Bridge through controller
70 [Documentation] This will create bridge on the specified OVSDB node.
71 OVSDB.Add Bridge To Ovsdb Node uuid/${OVSDB_UUID} ${TOOLS_SYSTEM_IP} ${BRIDGE2} 0000000000000002
73 Get Operational Topology to verify the bridge has been added through rest call
74 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
75 @{list} = BuiltIn.Create List ${BRIDGE2}
76 BuiltIn.Wait Until Keyword Succeeds
79 ... Utils.Check For Elements At URI
80 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
82 ... pretty_print_json=True
84 Get Config Topology to verify the entry added to the config datastore
85 [Documentation] This request will fetch the configuration topology from configuration data store
86 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
87 OVSDB.Log Request ${resp.text}
88 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
89 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
91 Create bridge of already added bridge
92 [Documentation] This will add bridge to the config datastore
93 OVSDB.Add Bridge To Ovsdb Node uuid/${OVSDB_UUID} ${TOOLS_SYSTEM_IP} ${BRIDGE1} 0000000000000001
95 Get Config Topology to verify the entry of existing bridge added to the config datastore
96 [Documentation] This request will fetch the configuration topology from configuration data store
97 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
98 OVSDB.Log Request ${resp.text}
99 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
100 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE1}
102 Delete bridge manually
103 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-br ${BRIDGE2}
105 Get Operational Topology to verify the bridge has been deleted manually
106 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
107 @{list} = BuiltIn.Create List ${BRIDGE2}
108 BuiltIn.Wait Until Keyword Succeeds
111 ... Utils.Check For Elements Not At URI
112 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
114 ... pretty_print_json=True
116 Config Topology Still Contains Bridge
117 [Documentation] This request will fetch the configuration topology from configuration data store
118 ${resp} = RequestsLibrary.Get Request session ${RFC8040_CONFIG_TOPO_API}
119 OVSDB.Log Request ${resp.text}
120 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
121 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
123 Delete the Bridge through rest call
124 [Documentation] This request will delete the bridge node from the config data store.
125 ${resp} = RequestsLibrary.Delete Request
127 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
128 BuiltIn.Should Be Equal As Strings ${resp.status_code} 204
130 Get Operational Topology after Deletion of Bridge
131 [Documentation] This request will fetch the operational topology after the Bridge is deleted
132 @{list} = BuiltIn.Create List ${BRIDGE2}
133 BuiltIn.Wait Until Keyword Succeeds
136 ... Utils.Check For Elements Not At URI
137 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
139 ... pretty_print_json=True
141 Trunk And Vlan Tag Is Removed From Operational
142 [Documentation] Verify that when the vlan tag is added and removed from an ovs port, it should be accurately reflected
143 ... in the operational store. Also verify that when all trunks are cleared from ovs, it's accurate in operational.
144 [Tags] 8529 bug exclude
145 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
146 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
147 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-br vlan-tag-br
148 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-port vlan-tag-br vlan-tag-port
149 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port tag=81
150 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port trunks=[181,182]
151 BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Verify OVS Reports Connected
152 OVSDB.Collect OVSDB Debugs
153 @{list} = BuiltIn.Create List
156 ... "ovsdb:vlan-tag":81
159 BuiltIn.Wait Until Keyword Succeeds
162 ... Utils.Check For Elements At URI
163 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
165 ... pretty_print_json=True
166 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port tag
167 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl remove port vlan-tag-port trunks 181
168 @{list} = BuiltIn.Create List "ovsdb:vlan-tag":81 "trunk":181
169 OVSDB.Collect OVSDB Debugs
170 BuiltIn.Wait Until Keyword Succeeds
173 ... Utils.Check For Elements Not At URI
174 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
176 ... pretty_print_json=True
177 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port trunks
178 @{list} = BuiltIn.Create List "ovsdb:vlan-tag":81 "trunk":181 "trunk":182
179 OVSDB.Collect OVSDB Debugs
180 BuiltIn.Wait Until Keyword Succeeds
183 ... Utils.Check For Elements Not At URI
184 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
186 ... pretty_print_json=True
187 [Teardown] Builtin.Run Keywords Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
188 ... AND Utils.Report_Failure_Due_To_Bug OVSDB-413
191 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
193 Utils.Check Karaf Log File Does Not Have Messages
195 ... SimpleShardDataTreeCohort.*Unexpected failure in validation phase
196 [Teardown] Utils.Report_Failure_Due_To_Bug 4756
199 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
201 Utils.Check Karaf Log File Does Not Have Messages
203 ... Shard.*shard-topology-operational An exception occurred while preCommitting transaction
204 [Teardown] Utils.Report_Failure_Due_To_Bug 4794
209 [Documentation] Cleans up test environment, close existing sessions.
210 @{uris} = Builtin.Create List
211 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE1}
212 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
213 OVSDB.Suite Teardown ${uris}