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} ${BRIDGE} vx1
19 Create a Topology in OVSDB node
20 [Documentation] Create topology in OVSDB and ready it for further tests
22 Run Command On Remote System ${MININET} sudo ovs-vsctl del-manager
23 Run Command On Remote System ${MININET} sudo ovs-vsctl del-br br-int
24 Run Command On Remote System ${MININET} sudo ovs-vsctl add-br ${BRIDGE}
25 Run Command On Remote System ${MININET} sudo ovs-vsctl add-port ${BRIDGE} vx1 -- set Interface vx1 type=vxlan options:remote_ip=192.168.1.11
26 Run Command On Remote System ${MININET} sudo ovs-vsctl set-manager ptcp:6634
29 [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 ${MININET}
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
42 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
44 Get Config Topology without Bridge
45 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
47 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${CONFIG_TOPO_API} ${node_list}
49 Delete the integration Bridge
50 [Documentation] This request will delete the bridge node from the config data store.
52 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-int
53 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
55 Get Operational Topology after deletion of integration bridge
56 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
58 @{list} Create List br-int
59 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
61 Create bridge of already added bridge
62 [Documentation] This will add bridge to the config datastore
64 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
65 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
66 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
67 ${sample3} Replace String ${sample2} br01 ${BRIDGE}
68 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
69 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
70 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} data=${body}
72 Should Be Equal As Strings ${resp.status_code} 200
74 Get Config Topology with Bridge
75 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
77 @{list} Create List br-s1
78 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${CONFIG_TOPO_API} ${list}
80 Create Port of already added port in OVSDB
81 [Documentation] This will add port/interface to the config datastore
83 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
84 ${sample1} Replace String ${sample} vxlanport vx1
85 ${body} Replace String ${sample1} 192.168.0.21 192.168.1.10
86 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
87 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/ data=${body}
89 Should Be Equal As Strings ${resp.status_code} 200
91 Get Config Topology with Bridge and Port
92 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
94 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${CONFIG_TOPO_API} ${node_list}
96 Modify the destination IP of Port
97 [Documentation] This will modify the dst ip of existing port
99 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
100 ${sample1} Replace String ${sample} vxlanport vx1
101 ${body} Replace String ${sample1} 192.168.0.21 10.0.0.19
102 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
103 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/ data=${body}
105 Should Be Equal As Strings ${resp.status_code} 200
107 Get Operational Topology with modified Port
108 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
110 @{list} Create List ${BRIDGE} vx1 10.0.0.19
111 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
113 Create Port and attach to a Bridge
114 [Documentation] This request will creates port/interface and attach it to the specific bridge
116 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
117 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
118 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/ data=${body}
120 Should Be Equal As Strings ${resp.status_code} 200
122 Get Operational Topology with Port
123 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
125 @{list} Create List ${BRIDGE} vxlanport
126 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
129 [Documentation] This request will delete the port node from the bridge node and data store.
131 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
132 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
134 Get Operational Topology after deletion of Port1
135 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
137 @{list} Create List vx1
138 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
141 [Documentation] This request will delete the port node from the bridge node and data store.
143 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
144 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
146 Get Operational Topology after Deletion of Port2
147 [Documentation] This request will fetch the operational topology after the Port is deleted
149 @{list} Create List vxlanport
150 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
153 [Documentation] This request will delete the bridge node from the config data store.
155 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
156 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
158 Get Operational Topology after Deletion of Bridge
159 [Documentation] This request will fetch the operational topology after the Bridge is deleted
161 @{list} Create List ${BRIDGE} vxlanport vx1
162 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
164 Delete the OVSDB Node
165 [Documentation] This request will delete the OVSDB node
167 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}
168 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
170 Get Operational Topology after Deletion of OVSDB Node
171 [Documentation] This request will fetch the operational topology after the OVSDB node is deleted
173 @{list} Create List ovsdb://${MININET}:${OVSDB_PORT} ${BRIDGE} vxlanport vx1
174 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}