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 On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
65 Utils.Log Content ${resp.text}
66 BuiltIn.Should Not Contain ${resp.text} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}/bridge/${BRIDGE1}
68 Create a Bridge through controller
69 [Documentation] This will create bridge on the specified OVSDB node.
70 OVSDB.Add Bridge To Ovsdb Node uuid/${OVSDB_UUID} ${TOOLS_SYSTEM_IP} ${BRIDGE2} 0000000000000002
72 Get Operational Topology to verify the bridge has been added through rest call
73 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
74 @{list} = BuiltIn.Create List ${BRIDGE2}
75 BuiltIn.Wait Until Keyword Succeeds
78 ... Utils.Check For Elements At URI
79 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
81 ... pretty_print_json=True
83 Get Config Topology to verify the entry added to the config datastore
84 [Documentation] This request will fetch the configuration topology from configuration data store
85 ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
86 Utils.Log Content ${resp.text}
87 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
89 Create bridge of already added bridge
90 [Documentation] This will add bridge to the config datastore
91 OVSDB.Add Bridge To Ovsdb Node uuid/${OVSDB_UUID} ${TOOLS_SYSTEM_IP} ${BRIDGE1} 0000000000000001
93 Get Config Topology to verify the entry of existing bridge added to the config datastore
94 [Documentation] This request will fetch the configuration topology from configuration data store
95 ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
96 Utils.Log Content ${resp.text}
97 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE1}
99 Delete bridge manually
100 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-br ${BRIDGE2}
102 Get Operational Topology to verify the bridge has been deleted manually
103 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
104 @{list} = BuiltIn.Create List ${BRIDGE2}
105 BuiltIn.Wait Until Keyword Succeeds
108 ... Utils.Check For Elements Not At URI
109 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
111 ... pretty_print_json=True
113 Config Topology Still Contains Bridge
114 [Documentation] This request will fetch the configuration topology from configuration data store
115 ${resp} = RequestsLibrary.GET On Session session url=${RFC8040_CONFIG_TOPO_API} expected_status=200
116 Utils.Log Content ${resp.text}
117 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
119 Delete the Bridge through rest call
120 [Documentation] This request will delete the bridge node from the config data store.
121 RequestsLibrary.DELETE On Session
123 ... url=${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
124 ... expected_status=204
126 Get Operational Topology after Deletion of Bridge
127 [Documentation] This request will fetch the operational topology after the Bridge is deleted
128 @{list} = BuiltIn.Create List ${BRIDGE2}
129 BuiltIn.Wait Until Keyword Succeeds
132 ... Utils.Check For Elements Not At URI
133 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
135 ... pretty_print_json=True
137 Trunk And Vlan Tag Is Removed From Operational
138 [Documentation] Verify that when the vlan tag is added and removed from an ovs port, it should be accurately reflected
139 ... in the operational store. Also verify that when all trunks are cleared from ovs, it's accurate in operational.
140 [Tags] 8529 bug exclude
141 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
142 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
143 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-br vlan-tag-br
144 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-port vlan-tag-br vlan-tag-port
145 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port tag=81
146 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port trunks=[181,182]
147 BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Verify OVS Reports Connected
148 OVSDB.Collect OVSDB Debugs
149 @{list} = BuiltIn.Create List
152 ... "ovsdb:vlan-tag":81
155 BuiltIn.Wait Until Keyword Succeeds
158 ... Utils.Check For Elements At URI
159 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
161 ... pretty_print_json=True
162 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port tag
163 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl remove port vlan-tag-port trunks 181
164 @{list} = BuiltIn.Create List "ovsdb:vlan-tag":81 "trunk":181
165 OVSDB.Collect OVSDB Debugs
166 BuiltIn.Wait Until Keyword Succeeds
169 ... Utils.Check For Elements Not At URI
170 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
172 ... pretty_print_json=True
173 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port trunks
174 @{list} = BuiltIn.Create List "ovsdb:vlan-tag":81 "trunk":181 "trunk":182
175 OVSDB.Collect OVSDB Debugs
176 BuiltIn.Wait Until Keyword Succeeds
179 ... Utils.Check For Elements Not At URI
180 ... ${RFC8040_OPERATIONAL_TOPO_OVSDB1_API}
182 ... pretty_print_json=True
183 [Teardown] Builtin.Run Keywords Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
184 ... AND Utils.Report_Failure_Due_To_Bug OVSDB-413
187 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
189 Utils.Check Karaf Log File Does Not Have Messages
191 ... SimpleShardDataTreeCohort.*Unexpected failure in validation phase
192 [Teardown] Utils.Report_Failure_Due_To_Bug 4756
195 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
197 Utils.Check Karaf Log File Does Not Have Messages
199 ... Shard.*shard-topology-operational An exception occurred while preCommitting transaction
200 [Teardown] Utils.Report_Failure_Due_To_Bug 4794
205 [Documentation] Cleans up test environment, close existing sessions.
206 @{uris} = Builtin.Create List
207 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE1}
208 ... ${RFC8040_SOUTHBOUND_NODE_API}uuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
209 OVSDB.Suite Teardown ${uris}