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}
128 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
130 Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} SimpleShardDataTreeCohort.*Unexpected failure in validation phase
131 [Teardown] Report_Failure_Due_To_Bug 4756
134 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
136 Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} Shard.*shard-topology-operational An exception occurred while preCommitting transaction
137 [Teardown] Report_Failure_Due_To_Bug 4794
140 OVSDB Connection Manager Suite Setup
141 SetupUtils.Setup_Utils_For_Setup_And_Teardown
142 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
144 OVSDB Connection Manager Suite Teardown
145 [Documentation] Cleans up test environment, close existing sessions.
146 Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
147 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE1}
148 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2Fuuid%2F${ovsdb_uuid}%2Fbridge%2F${BRIDGE2}
149 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}