2 Documentation Test suite for Connection Manager
3 Suite Setup OVSDB Connection Manager Suite Setup
4 Suite Teardown Delete All Sessions
5 Test Setup Log Testcase Start To Controller Karaf
6 Library OperatingSystem
8 Library RequestsLibrary
9 Variables ../../../variables/Variables.py
10 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 Connecting an OVS instance to the controller
21 Run Command On Remote System ${MININET} sudo ovs-vsctl del-manager
22 Run Command On Remote System ${MININET} sudo ovs-vsctl set-manager tcp:${CONTROLLER}:6640
24 Get Operational Topology to verify the ovs instance is connected to the controller
25 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
27 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
30 [Documentation] This request will fetch the configuration topology from configuration data store
32 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
34 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
35 Should Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-int
37 Create bridge manually
39 Run Command On Remote System ${MININET} sudo ovs-vsctl add-br br-s1
41 Get Operational Topology to verify the bridge has been added
42 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
44 @{list} Create List br-s1
45 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
47 Get Config Topology to verify the manually added bridge is not added to the config datastore
48 [Documentation] This request will fetch the configuration topology from configuration data store
50 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
52 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
53 Should not Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s1
55 Create a Bridge through controller
56 [Documentation] This will create bridge on the specified OVSDB node.
58 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
59 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
60 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
61 ${sample3} Replace String ${sample2} br01 br-s2
62 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
63 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s2
64 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s2 data=${body}
66 Should Be Equal As Strings ${resp.status_code} 200
68 Get Operational Topology to verify the bridge has been added through rest call
69 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
71 @{list} Create List br-s2
72 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
74 Get Config Topology to verify the entry added to the config datastore
75 [Documentation] This request will fetch the configuration topology from configuration data store
77 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
79 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
80 Should Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s2
82 Create bridge of already added bridge
83 [Documentation] This will add bridge to the config datastore
85 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
86 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
87 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
88 ${sample3} Replace String ${sample2} br01 br-s1
89 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
90 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s1
91 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s1 data=${body}
93 Should Be Equal As Strings ${resp.status_code} 200
95 Get Config Topology to verify the entry of existing bridge added to the config datastore
96 [Documentation] This request will fetch the configuration topology from configuration data store
98 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
100 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
101 Should Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s1
103 Delete bridge manually
105 Run Command On Remote System ${MININET} sudo ovs-vsctl del-br br-s2
107 Get Operational Topology to verify the bridge has been deleted manually
108 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
110 @{list} Create List br-s2
111 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
113 Get Config Topology to verify the entry deleted from the config datastore
114 [Documentation] This request will fetch the configuration topology from configuration data store
116 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
118 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
119 Should not Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s2
121 Delete the Bridge through rest call
122 [Documentation] This request will delete the bridge node from the config data store.
124 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s1
125 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
127 Get Operational Topology after Deletion of Bridge
128 [Documentation] This request will fetch the operational topology after the Bridge is deleted
130 @{list} Create List br-s1
131 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
133 Delete the integration Bridge
134 [Documentation] This request will delete the bridge node from the config data store.
136 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-int
137 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
139 Get Operational Topology after Deletion of integration Bridge
140 [Documentation] This request will fetch the operational topology after the Bridge is deleted
142 @{list} Create List br-int br-s1
143 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
146 OVSDB Connection Manager Suite Setup
147 Open Controller Karaf Console On Background
148 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}