2 Documentation Test suite for Connection Manager
3 Suite Setup Configure 1 OVSDB Node Suite Setup
4 Suite Teardown Configure 1 OVSDB Node Suite Teardown
5 Test Setup Log Testcase Start To Controller Karaf
7 Library OperatingSystem
9 Library RequestsLibrary
10 Variables ../../../variables/Variables.py
11 Resource ../../../libraries/Utils.robot
12 Resource ../../../libraries/OVSDB.robot
16 ${BRIDGE} ovsdb-csit-test-bridge
17 ${SOUTHBOUND_CONFIG_API} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
18 ${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb
19 @{node_list} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_PORT}
22 Make the OVS instance to listen for connection
23 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
24 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
27 [Documentation] Initiate the connection to OVSDB node from controller
28 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
29 ${sample1} Replace String ${sample} 127.0.0.1 ${TOOLS_SYSTEM_IP}
30 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
31 Log URL is ${SOUTHBOUND_CONFIG_API}
33 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API} data=${body}
35 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
36 Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected
38 Get Operational Topology
39 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
40 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
43 [Documentation] This will create bridge on the specified OVSDB node.
44 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
45 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${ODL_SYSTEM_IP}:6633
46 ${sample2} Replace String ${sample1} 127.0.0.1 ${TOOLS_SYSTEM_IP}
47 ${sample3} Replace String ${sample2} br01 ${BRIDGE}
48 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
49 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
51 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} data=${body}
53 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
55 Get Config Topology with Bridge
56 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
57 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
59 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
60 Should Contain ${resp.content} ${BRIDGE}
62 Get Operational Topology with Bridge
63 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
64 @{list} Create List ${BRIDGE}
65 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
67 Create Port and attach to a Bridge
68 [Documentation] This request will creates port/interface and attach it to the specific bridge
69 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
70 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
72 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/ data=${body}
74 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
76 Get Operational Topology with Port
77 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
78 @{list} Create List ${BRIDGE} vxlanport
79 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
82 [Documentation] This request will delete the port node from the bridge node and data store.
83 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
84 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
86 Get Operational Topology after Deletion of Port
87 [Documentation] This request will fetch the operational topology after the Port is deleted
88 @{list} Create List vxlanport
89 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
92 [Documentation] This request will delete the bridge node from the config data store.
93 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
94 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
96 Get Operational Topology after Deletion of Bridge
97 [Documentation] This request will fetch the operational topology after the Bridge is deleted
98 @{list} Create List ${BRIDGE} vxlanport
99 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
101 Verify Config Still Has OVS Info
102 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
103 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
105 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
106 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
108 Delete the OVSDB Node
109 [Documentation] This request will delete the OVSDB node
110 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}
111 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
113 Get Operational Topology to make sure the connection has been deleted
114 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
115 @{list} Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
116 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
118 Get Configuration Topology to make sure the connection has been deleted
119 [Documentation] This request will fetch the configuration topology from the connected OVSDB nodes
120 @{list} Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
121 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${CONFIG_TOPO_API}/topology/ovsdb:1 ${node_list}
123 Reconnect to OVSDB Node
124 [Documentation] Initiate the connection to OVSDB node from controller
125 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
126 ${sample1} Replace String ${sample} 127.0.0.1 ${TOOLS_SYSTEM_IP}
127 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
128 Log URL is ${SOUTHBOUND_CONFIG_API}
130 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API} data=${body}
132 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
134 Get Operational Topology After Node Reconnect
135 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
136 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
138 Get Config Topology After Reconnect
139 [Documentation] This will fetch the configuration topology from configuration data store after reconnect
140 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
142 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
143 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
146 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
148 Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} SimpleShardDataTreeCohort.*Unexpected failure in validation phase
149 [Teardown] Report_Failure_Due_To_Bug 4756
152 [Documentation] bug 4794 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
154 Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} Shard.*shard-topology-operational An exception occurred while preCommitting transaction
155 [Teardown] Report_Failure_Due_To_Bug 4794
158 Configure 1 OVSDB Node Suite Setup
159 Open Controller Karaf Console On Background
160 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
162 Configure 1 OVSDB Node Suite Teardown
163 [Documentation] Cleans up test environment, close existing sessions.
164 Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
165 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
166 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}