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 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 ${BRIDGE} ovsdb-csit-test-bridge
18 ${SOUTHBOUND_CONFIG_API} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
19 ${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb
20 @{node_list} ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT} ${TOOLS_SYSTEM_IP} ${OVSDB_PORT}
23 Make the OVS instance to listen for connection
24 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl del-manager
25 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager ptcp:${OVSDB_PORT}
28 [Documentation] Initiate the connection to OVSDB node from controller
29 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
30 ${sample1} Replace String ${sample} 127.0.0.1 ${TOOLS_SYSTEM_IP}
31 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
32 Log URL is ${SOUTHBOUND_CONFIG_API}
34 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API} data=${body}
36 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
37 Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected
39 Get Operational Topology
40 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
41 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
44 [Documentation] This will create bridge on the specified OVSDB node.
45 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
46 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${ODL_SYSTEM_IP}:6633
47 ${sample2} Replace String ${sample1} 127.0.0.1 ${TOOLS_SYSTEM_IP}
48 ${sample3} Replace String ${sample2} br01 ${BRIDGE}
49 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
50 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
52 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} data=${body}
54 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
56 Get Config Topology with Bridge
57 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
58 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
60 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
61 Should Contain ${resp.content} ${BRIDGE}
63 Get Operational Topology with Bridge
64 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
65 @{list} Create List ${BRIDGE}
66 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
68 Create Port and attach to a Bridge
69 [Documentation] This request will creates port/interface and attach it to the specific bridge
70 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
71 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
73 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/ data=${body}
75 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
77 Get Operational Topology with Port
78 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
79 @{list} Create List ${BRIDGE} vxlanport
80 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
83 [Documentation] This request will delete the port node from the bridge node and data store.
84 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
85 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
87 Get Operational Topology after Deletion of Port
88 [Documentation] This request will fetch the operational topology after the Port is deleted
89 @{list} Create List vxlanport
90 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
93 [Documentation] This request will delete the bridge node from the config data store.
94 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
95 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
97 Get Operational Topology after Deletion of Bridge
98 [Documentation] This request will fetch the operational topology after the Bridge is deleted
99 @{list} Create List ${BRIDGE} vxlanport
100 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
102 Verify Config Still Has OVS Info
103 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
104 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
106 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
107 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
109 Delete the OVSDB Node
110 [Documentation] This request will delete the OVSDB node
111 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}
112 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
114 Get Operational Topology to make sure the connection has been deleted
115 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
116 @{list} Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
117 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${list}
119 Get Configuration Topology to make sure the connection has been deleted
120 [Documentation] This request will fetch the configuration topology from the connected OVSDB nodes
121 @{list} Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
122 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${CONFIG_TOPO_API}/topology/ovsdb:1 ${node_list}
124 Reconnect to OVSDB Node
125 [Documentation] Initiate the connection to OVSDB node from controller
126 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
127 ${sample1} Replace String ${sample} 127.0.0.1 ${TOOLS_SYSTEM_IP}
128 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
129 Log URL is ${SOUTHBOUND_CONFIG_API}
131 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API} data=${body}
133 Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
135 Get Operational Topology After Node Reconnect
136 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
137 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
139 Get Config Topology After Reconnect
140 [Documentation] This will fetch the configuration topology from configuration data store after reconnect
141 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}
143 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
144 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API}/topology/ovsdb:1 ${node_list}
147 [Documentation] bug 4756 has been seen in the OVSDB Southbound suites. This test case should be one of the last test
149 Check Karaf Log File Does Not Have Messages ${ODL_SYSTEM_IP} SimpleShardDataTreeCohort.*Unexpected failure in validation phase
150 [Teardown] Report_Failure_Due_To_Bug 4756
153 [Documentation] bug 4794 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} Shard.*shard-topology-operational An exception occurred while preCommitting transaction
156 [Teardown] Report_Failure_Due_To_Bug 4794
159 Configure 1 OVSDB Node Suite Setup
160 SetupUtils.Setup_Utils_For_Setup_And_Teardown
161 Open Controller Karaf Console On Background
162 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
164 Configure 1 OVSDB Node Suite Teardown
165 [Documentation] Cleans up test environment, close existing sessions.
166 Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP}
167 RequestsLibrary.Delete Request session ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
168 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}