2 Documentation Test suite for Connection Manager
3 Suite Setup Configure Exit OVSDB Node Suite Setup
4 Suite Teardown Configure Exit 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} ${BRIDGE} vx1
22 Create a Topology in OVSDB node
23 [Documentation] Create topology in OVSDB and ready it for further tests
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 add-br ${BRIDGE}
26 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl add-port ${BRIDGE} vx1 -- set Interface vx1 type=vxlan options:remote_ip=192.168.1.11
27 Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl set-manager ptcp:6634
30 [Documentation] Initiate the connection to OVSDB node from controller
31 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
32 ${sample1} Replace String ${sample} 127.0.0.1 ${TOOLS_SYSTEM_IP}
33 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
34 Log URL is ${SOUTHBOUND_CONFIG_API}
35 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API} data=${body}
37 Should Be Equal As Strings ${resp.status_code} 200
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} ${node_list}
42 [Teardown] Report_Failure_Due_To_Bug 4756
44 Verify Bridge Port Not In Config DS
45 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
46 @{list} Create List vx1
47 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${CONFIG_TOPO_API} ${list}
49 Create bridge of already added bridge
50 [Documentation] This will add bridge to the config datastore
51 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
52 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${ODL_SYSTEM_IP}:6633
53 ${sample2} Replace String ${sample1} 127.0.0.1 ${TOOLS_SYSTEM_IP}
54 ${sample3} Replace String ${sample2} br01 ${BRIDGE}
55 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
56 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
58 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} data=${body}
60 Should Be Equal As Strings ${resp.status_code} 200
62 Get Config Topology with Bridge
63 [Documentation] This will fetch the configuration topology from configuration data store 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 ${CONFIG_TOPO_API} ${list}
67 Create Port of already added port in OVSDB
68 [Documentation] This will add port/interface to the config datastore
69 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
70 ${sample1} Replace String ${sample} vxlanport vx1
71 ${body} Replace String ${sample1} 192.168.0.21 192.168.1.10
72 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
74 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/ data=${body}
76 Should Be Equal As Strings ${resp.status_code} 200
78 Get Config Topology with Bridge and Port
79 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
80 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${CONFIG_TOPO_API} ${node_list}
82 Modify the destination IP of Port
83 [Documentation] This will modify the dst ip of existing port
84 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
85 ${sample1} Replace String ${sample} vxlanport vx1
86 ${body} Replace String ${sample1} 192.168.0.21 10.0.0.19
87 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
89 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/ data=${body}
91 Should Be Equal As Strings ${resp.status_code} 200
93 Get Operational Topology with modified Port
94 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
95 @{list} Create List ${BRIDGE} vx1 10.0.0.19
96 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
98 Create Port and attach to a Bridge
99 [Documentation] This request will creates port/interface and attach it to the specific bridge
100 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
101 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
103 ${resp} RequestsLibrary.Put Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/ data=${body}
105 Should Be Equal As Strings ${resp.status_code} 200
107 Get Operational Topology with Port
108 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
109 @{list} Create List ${BRIDGE} vxlanport
110 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
113 [Documentation] This request will delete the port node from the bridge node and data store.
114 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
115 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
117 Get Operational Topology after deletion of Port1
118 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
119 @{list} Create List vx1
120 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
123 [Documentation] This request will delete the port node from the bridge node and data store.
124 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
125 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
127 Get Operational Topology after Deletion of Port2
128 [Documentation] This request will fetch the operational topology after the Port is deleted
129 @{list} Create List vxlanport
130 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
133 [Documentation] This request will delete the bridge node from the config data store.
134 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
135 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
137 Get Operational Topology after Deletion of Bridge
138 [Documentation] This request will fetch the operational topology after the Bridge is deleted
139 @{list} Create List ${BRIDGE} vxlanport vx1
140 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
142 Delete the OVSDB Node
143 [Documentation] This request will delete the OVSDB node
144 ${resp} RequestsLibrary.Delete Request session ${SOUTHBOUND_CONFIG_API}
145 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
147 Get Operational Topology after Deletion of OVSDB Node
148 [Documentation] This request will fetch the operational topology after the OVSDB node is deleted
149 @{list} Create List ovsdb://${TOOLS_SYSTEM_IP}:${OVSDB_PORT} ${BRIDGE} vxlanport vx1
150 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
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 Configure Exit OVSDB Node Suite Setup
166 Open Controller Karaf Console On Background
167 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
169 Configure Exit OVSDB Node 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%2F${TOOLS_SYSTEM_IP}:${OVSDB_PORT}
173 ${resp} RequestsLibrary.Get Request session ${CONFIG_TOPO_API}