2 Documentation Test suite for Connection Manager
3 Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
4 Suite Teardown Delete All Sessions
5 Library OperatingSystem
7 Library RequestsLibrary
8 Variables ../../../variables/Variables.py
9 Resource ../../../libraries/Utils.robot
14 ${SOUTHBOUND_CONFIG_API} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
15 ${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb
16 @{node_list} ovsdb://${MININET}:${OVSDB_PORT} ${MININET} ${OVSDB_PORT} br-int
19 Make the OVS instance to listen for connection
21 Run Command On Remote System ${MININET} sudo ovs-vsctl del-manager
22 Run Command On Remote System ${MININET} sudo ovs-vsctl set-manager ptcp:6634
25 [Documentation] Initiate the connection to OVSDB node from controller
27 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
28 ${sample1} Replace String ${sample} 127.0.0.1 ${MININET}
29 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
30 Log URL is ${SOUTHBOUND_CONFIG_API}
31 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API} data=${body}
33 Should Be Equal As Strings ${resp.status_code} 200
35 Get Operational Topology
36 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
38 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
41 [Documentation] This will create bridge on the specified OVSDB node.
43 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
44 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
45 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
46 ${sample3} Replace String ${sample2} br01 ${BRIDGE}
47 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
48 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
49 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} data=${body}
51 Should Be Equal As Strings ${resp.status_code} 200
53 Get Config Topology with Bridge
54 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
56 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
58 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
59 Should Contain ${resp.content} ${BRIDGE}
61 Get Operational Topology with Bridge
62 [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} ${list}
67 Create Port and attach to a Bridge
68 [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/
72 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/ data=${body}
74 Should Be Equal As Strings ${resp.status_code} 200
76 Get Operational Topology with Port
77 [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} ${list}
83 [Documentation] This request will delete the port node from the bridge node and data store.
85 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
86 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
88 Get Operational Topology after Deletion of Port
89 [Documentation] This request will fetch the operational topology after the Port is deleted
91 @{list} Create List vxlanport
92 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
95 [Documentation] This request will delete the bridge node from the config data store.
97 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
98 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
100 Get Operational Topology after Deletion of Bridge
101 [Documentation] This request will fetch the operational topology after the Bridge is deleted
103 @{list} Create List ${BRIDGE} vxlanport
104 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
106 Get Config Topology with integration Bridge
107 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
109 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
111 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
112 Should Contain ${resp.content} br-int
114 Delete the OVSDB Node
115 [Documentation] This request will delete the OVSDB node
117 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}
118 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
120 Get Operational Topology to make sure the connection has been deleted
121 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
123 @{list} Create List ovsdb://${MININET}:${OVSDB_PORT}
124 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
126 Get Configuration Topology to make sure the connection has been deleted
127 [Documentation] This request will fetch the configuration topology from the connected OVSDB nodes
129 @{list} Create List ovsdb://${MININET}:${OVSDB_PORT}
130 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${CONFIG_TOPO_API} ${node_list}
132 Reconnect to OVSDB Node
133 [Documentation] Initiate the connection to OVSDB node from controller
135 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
136 ${sample1} Replace String ${sample} 127.0.0.1 ${MININET}
137 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
138 Log URL is ${SOUTHBOUND_CONFIG_API}
139 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API} data=${body}
141 Should Be Equal As Strings ${resp.status_code} 200
143 Get Operational Topology with Integration Bridge
144 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes to verify the bridge is added to the data store
146 @{list} Create List br-int
147 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
149 Get Config Topology after reconnect
150 [Documentation] This will fetch the configuration topology from configuration data store after reconnect
152 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
154 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
155 Should Contain ${resp.content} br-int
157 Create integration Bridge
158 [Documentation] This will create bridge on the specified OVSDB node.
160 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
161 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
162 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
163 ${sample3} Replace String ${sample2} br01 br-int
164 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
165 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
166 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-int data=${body}
168 Should Be Equal As Strings ${resp.status_code} 200
170 Delete the integration Bridge
171 [Documentation] This request will delete the bridge node from the config data store.
173 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-int
174 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
176 Get Operational Topology after Deletion of integration Bridge
177 [Documentation] This request will fetch the operational topology after the Bridge is deleted
179 @{list} Create List br-int
180 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
182 Again Delete the OVSDB Node
183 [Documentation] This request will delete the OVSDB node
185 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}
186 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
188 Get Operational Topology after Deletion of OVSDB Node
189 [Documentation] This request will fetch the operational topology after the OVSDB node is deleted
191 @{list} Create List ovsdb://${MININET}:${OVSDB_PORT} ${BRIDGE} vxlanport
192 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}