2 Documentation Test suite for Connection Manager
3 Suite Setup OVSDB Connection Manager Suite Setup
4 Suite Teardown OVSDB Connection Manager Suite Teardown
5 Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
7 Library OperatingSystem
9 Library RequestsLibrary
10 Variables ../../../variables/Variables.py
11 Resource ../../../libraries/SetupUtils.robot
12 Resource ../../../libraries/Utils.robot
13 Resource ../../../libraries/OVSDB.robot
17 ${BRIDGE1} ovsdb-csit-test-bridge1
18 ${BRIDGE2} ovsdb-csit-test-bridge2
19 ${SOUTHBOUND_CONFIG_API} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
20 ${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb
21 @{node_list} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_PORT}
24 Connecting an OVS instance to the controller
25 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
26 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
27 Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected
29 Get Operational Topology to verify the ovs instance is connected to the controller
30 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
31 @{list} Create List ovsdb://uuid "remote-ip":"${TOOLS_SYSTEM_IP}" "local-port":6640
32 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
33 ${ovsdb_uuid}= Get OVSDB UUID ${TOOLS_SYSTEM_IP}
34 Set Suite Variable ${ovsdb_uuid}
36 Verify OVS Not In Config Topology
37 [Documentation] This request will fetch the configuration topology from configuration data store
38 Check For Elements Not At URI ${CONFIG_TOPO_API} ${node_list}
40 Create bridge manually
41 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-br ${BRIDGE1}
43 Get Operational Topology to verify the bridge has been added
44 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
45 @{list} Create List ${BRIDGE1}
46 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
48 Get Config Topology to verify the manually added bridge is not added to the config datastore
49 [Documentation] This request will fetch the configuration topology from configuration data store
50 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
52 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
53 Should not Contain ${resp.content} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}/bridge/${BRIDGE1}
55 Create a Bridge through controller
56 [Documentation] This will create bridge on the specified OVSDB node.
57 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
58 ${body} Replace String ${body} ovsdb://127.0.0.1:61644 ovsdb://uuid/${ovsdb_uuid}
59 ${body} Replace String ${body} tcp:127.0.0.1:6633 tcp:${ODL_SYSTEM_IP}:6633
60 ${body} Replace String ${body} 127.0.0.1 ${TOOLS_SYSTEM_IP}
61 ${body} Replace String ${body} br01 ${BRIDGE2}
62 ${body} Replace String ${body} 61644 ${OVSDB_PORT}
63 ${uri}= Set Variable ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE2}
66 ${resp} RequestsLibrary.Put Request session ${uri} data=${body}
67 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
69 Get Operational Topology to verify the bridge has been added through rest call
70 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
71 @{list} Create List ${BRIDGE2}
72 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
74 Get Config Topology to verify the entry added to the config datastore
75 [Documentation] This request will fetch the configuration topology from configuration data store
76 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
78 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
79 Should Contain ${resp.content} ovsdb://uuid/${ovsdb_uuid}/bridge/${BRIDGE2}
81 Create bridge of already added bridge
82 [Documentation] This will add bridge to the config datastore
83 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
84 ${body} Replace String ${body} ovsdb://127.0.0.1:61644 ovsdb://uuid/${ovsdb_uuid}
85 ${body} Replace String ${body} tcp:127.0.0.1:6633 tcp:${ODL_SYSTEM_IP}:6633
86 ${body} Replace String ${body} 127.0.0.1 ${TOOLS_SYSTEM_IP}
87 ${body} Replace String ${body} br01 ${BRIDGE1}
88 ${body} Replace String ${body} 61644 ${OVSDB_PORT}
89 ${uri}= Set Variable ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE1}
92 ${resp} RequestsLibrary.Put Request session ${uri} data=${body}
93 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
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 ${CONFIG_TOPO_API}
99 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
100 Should Contain ${resp.content} ovsdb://uuid/${ovsdb_uuid}/bridge/${BRIDGE1}
102 Delete bridge manually
103 Run Command On Remote System ${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} Create List ${BRIDGE2}
108 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
110 Config Topology Still Contains Bridge
111 [Documentation] This request will fetch the configuration topology from configuration data store
112 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
114 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
115 Should Contain ${resp.content} ovsdb://uuid/${ovsdb_uuid}/bridge/${BRIDGE2}
117 Delete the Bridge through rest call
118 [Documentation] This request will delete the bridge node from the config data store.
119 ${resp} RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE2}
120 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
122 Get Operational Topology after Deletion of Bridge
123 [Documentation] This request will fetch the operational topology after the Bridge is deleted
124 @{list} Create List ${BRIDGE2}
125 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
127 Trunk And Vlan Tag Is Removed From Operational
128 [Documentation] Verify that when the vlan tag is added and removed from an ovs port, it should be accurately reflected
129 ... in the operational store. Also verify that when all trunks are cleared from ovs, it's accurate in operational.
131 Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
132 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:6640
133 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-br vlan-tag-br
134 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-port vlan-tag-br vlan-tag-port
135 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port tag=81
136 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set port vlan-tag-port trunks=[181,182]
137 Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected
139 @{list} Create List vlan-tag-br vlan-tag-port "ovsdb:vlan-tag":81 "trunk":181 "trunk":182
140 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
141 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port tag
142 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl remove port vlan-tag-port trunks 181
143 @{list} Create List "ovsdb:vlan-tag":81 "trunk":181
145 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
146 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl clear port vlan-tag-port trunks
147 @{list} Create List "ovsdb:vlan-tag":81 "trunk":181 "trunk":182
149 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
150 [Teardown] Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
153 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
155 Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} SimpleShardDataTreeCohort.*Unexpected failure in validation phase
156 [Teardown] Report_Failure_Due_To_Bug 4756
159 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
161 Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} Shard.*shard-topology-operational An exception occurred while preCommitting transaction
162 [Teardown] Report_Failure_Due_To_Bug 4794
165 OVSDB Connection Manager Suite Setup
166 SetupUtils.Setup_Utils_For_Setup_And_Teardown
167 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
169 OVSDB Connection Manager Suite Teardown
170 [Documentation] Cleans up test environment, close existing sessions.
171 Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
172 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE1}
173 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE2}
174 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}