2 Documentation Test suite for Connection Manager
3 Suite Setup OVSDB.Suite Setup
4 Suite Teardown Suite Teardown
5 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
7 Library RequestsLibrary
8 Resource ../../../libraries/SetupUtils.robot
9 Resource ../../../libraries/Utils.robot
10 Resource ../../../libraries/OVSDB.robot
11 Resource ../../../variables/Variables.robot
16 @{NODE_LIST} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_NODE_PORT}
17 ${OVSDB_UUID} ${EMPTY}
20 Connecting an OVS instance to the controller
21 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
22 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
23 BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Verify OVS Reports Connected
25 Get Operational Topology to verify the ovs instance is connected to the controller
26 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
27 @{list} = BuiltIn.Create List ovsdb://uuid "remote-ip":"${TOOLS_SYSTEM_IP}" "local-port":${OVSDBPORT}
28 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
29 ${OVSDB_UUID} = OVSDB.Get OVSDB UUID ${TOOLS_SYSTEM_IP}
30 BuiltIn.Set Suite Variable ${OVSDB_UUID}
32 Verify OVS Not In Config Topology
33 [Documentation] This request will fetch the configuration topology from configuration data store
34 Utils.Check For Elements Not At URI ${CONFIG_TOPO_API} ${NODE_LIST} pretty_print_json=True
36 Create bridge manually
37 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-br ${BRIDGE1}
39 Get Operational Topology to verify the bridge has been added
40 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
41 @{list} = BuiltIn.Create List ${BRIDGE1}
42 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
44 Get Config Topology to verify the manually added bridge is not added to the config datastore
45 [Documentation] This request will fetch the configuration topology from configuration data store
46 ${resp} = RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
47 OVSDB.Log Request ${resp.text}
48 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
49 BuiltIn.Should Not Contain ${resp.text} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_NODE_PORT}/bridge/${BRIDGE1}
51 Create a Bridge through controller
52 [Documentation] This will create bridge on the specified OVSDB node.
53 OVSDB.Add Bridge To Ovsdb Node uuid/${OVSDB_UUID} ${TOOLS_SYSTEM_IP} ${BRIDGE2} 0000000000000002
55 Get Operational Topology to verify the bridge has been added through rest call
56 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
57 @{list} = BuiltIn.Create List ${BRIDGE2}
58 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
60 Get Config Topology to verify the entry added to the config datastore
61 [Documentation] This request will fetch the configuration topology from configuration data store
62 ${resp} = RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
63 OVSDB.Log Request ${resp.text}
64 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
65 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
67 Create bridge of already added bridge
68 [Documentation] This will add bridge to the config datastore
69 OVSDB.Add Bridge To Ovsdb Node uuid/${OVSDB_UUID} ${TOOLS_SYSTEM_IP} ${BRIDGE1} 0000000000000001
71 Get Config Topology to verify the entry of existing bridge added to the config datastore
72 [Documentation] This request will fetch the configuration topology from configuration data store
73 ${resp} = RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
74 OVSDB.Log Request ${resp.text}
75 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
76 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE1}
78 Delete bridge manually
79 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-br ${BRIDGE2}
81 Get Operational Topology to verify the bridge has been deleted manually
82 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
83 @{list} = BuiltIn.Create List ${BRIDGE2}
84 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
86 Config Topology Still Contains Bridge
87 [Documentation] This request will fetch the configuration topology from configuration data store
88 ${resp} = RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
89 OVSDB.Log Request ${resp.text}
90 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
91 BuiltIn.Should Contain ${resp.text} ovsdb://uuid/${OVSDB_UUID}/bridge/${BRIDGE2}
93 Delete the Bridge through rest call
94 [Documentation] This request will delete the bridge node from the config data store.
95 ${resp} = RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
96 BuiltIn.Should Be Equal As Strings ${resp.status_code} 200
98 Get Operational Topology after Deletion of Bridge
99 [Documentation] This request will fetch the operational topology after the Bridge is deleted
100 @{list} = BuiltIn.Create List ${BRIDGE2}
101 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
103 Trunk And Vlan Tag Is Removed From Operational
104 [Documentation] Verify that when the vlan tag is added and removed from an ovs port, it should be accurately reflected
105 ... in the operational store. Also verify that when all trunks are cleared from ovs, it's accurate in operational.
107 OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
108 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT}
109 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-br vlan-tag-br
110 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-port vlan-tag-br vlan-tag-port
111 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port tag=81
112 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port trunks=[181,182]
113 BuiltIn.Wait Until Keyword Succeeds 5s 1s OVSDB.Verify OVS Reports Connected
114 OVSDB.Collect OVSDB Debugs
115 @{list} BuiltIn.Create List vlan-tag-br vlan-tag-port "ovsdb:vlan-tag":81 "trunk":181 "trunk":182
116 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
117 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port tag
118 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl remove port vlan-tag-port trunks 181
119 @{list} BuiltIn.Create List "ovsdb:vlan-tag":81 "trunk":181
120 OVSDB.Collect OVSDB Debugs
121 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
122 Utils.Run Command On Mininet ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port trunks
123 @{list} BuiltIn.Create List "ovsdb:vlan-tag":81 "trunk":181 "trunk":182
124 OVSDB.Collect OVSDB Debugs
125 BuiltIn.Wait Until Keyword Succeeds 8s 2s Utils.Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list} pretty_print_json=True
126 [Teardown] Builtin.Run Keywords Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
127 ... AND Utils.Report_Failure_Due_To_Bug OVSDB-413
130 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
132 Utils.Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} SimpleShardDataTreeCohort.*Unexpected failure in validation phase
133 [Teardown] Utils.Report_Failure_Due_To_Bug 4756
136 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
138 Utils.Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} Shard.*shard-topology-operational An exception occurred while preCommitting transaction
139 [Teardown] Utils.Report_Failure_Due_To_Bug 4794
143 [Documentation] Cleans up test environment, close existing sessions.
144 @{uris} = Builtin.Create List ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE1} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${OVSDB_UUID}%2Fbridge%2F${BRIDGE2}
145 OVSDB.Suite Teardown ${uris}