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
13 ${SOUTHBOUND_CONFIG_API} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F${MININET}:${OVSDB_PORT}
14 ${OVSDB_CONFIG_DIR} ${CURDIR}/../../../variables/ovsdb
15 @{node_list} ovsdb://${MININET}:${OVSDB_PORT} ${MININET} ${OVSDB_PORT} br-int
18 Connecting an OVS instance to the controller
20 Run Command On Remote System ${MININET} sudo ovs-vsctl del-manager
21 Run Command On Remote System ${MININET} sudo ovs-vsctl set-manager tcp:${CONTROLLER}:6640
23 Get Operational Topology to verify the ovs instance is connected to the controller
24 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
26 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
29 [Documentation] This request will fetch the configuration topology from configuration data store
31 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
33 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
34 Should Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-int
36 Create bridge manually
38 Run Command On Remote System ${MININET} sudo ovs-vsctl add-br br-s1
40 Get Operational Topology to verify the bridge has been added
41 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
43 @{list} Create List br-s1
44 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
46 Get Config Topology to verify the manually added bridge is not added to the config datastore
47 [Documentation] This request will fetch the configuration topology from configuration data store
49 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
51 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
52 Should not Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s1
54 Create a Bridge through controller
55 [Documentation] This will create bridge on the specified OVSDB node.
57 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
58 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
59 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
60 ${sample3} Replace String ${sample2} br01 br-s2
61 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
62 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s2
63 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s2 data=${body}
65 Should Be Equal As Strings ${resp.status_code} 200
67 Get Operational Topology to verify the bridge has been added through rest call
68 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
70 @{list} Create List br-s2
71 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
73 Get Config Topology to verify the entry added to the config datastore
74 [Documentation] This request will fetch the configuration topology from configuration data store
76 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
78 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
79 Should Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s2
81 Create bridge of already added bridge
82 [Documentation] This will add bridge to the config datastore
84 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
85 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
86 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
87 ${sample3} Replace String ${sample2} br01 br-s1
88 ${body} Replace String ${sample3} 61644 ${OVSDB_PORT}
89 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s1
90 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s1 data=${body}
92 Should Be Equal As Strings ${resp.status_code} 200
94 Get Config Topology to verify the entry of existing bridge added to the config datastore
95 [Documentation] This request will fetch the configuration topology from configuration data store
97 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
99 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
100 Should Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s1
102 Delete bridge manually
104 Run Command On Remote System ${MININET} sudo ovs-vsctl del-br br-s2
106 Get Operational Topology to verify the bridge has been deleted manually
107 [Documentation] This request will fetch the operational topology from the connected OVSDB nodes
109 @{list} Create List br-s2
110 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
112 Get Config Topology to verify the entry deleted from the config datastore
113 [Documentation] This request will fetch the configuration topology from configuration data store
115 ${resp} RequestsLibrary.Get session ${CONFIG_TOPO_API}
117 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
118 Should not Contain ${resp.content} ovsdb://${MININET}:${OVSDB_PORT}/bridge/br-s2
120 Delete the Bridge through rest call
121 [Documentation] This request will delete the bridge node from the config data store.
123 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-s1
124 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
126 Get Operational Topology after Deletion of Bridge
127 [Documentation] This request will fetch the operational topology after the Bridge is deleted
129 @{list} Create List br-s1
130 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
132 Delete the integration Bridge
133 [Documentation] This request will delete the bridge node from the config data store.
135 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2Fbr-int
136 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
138 Get Operational Topology after Deletion of integration Bridge
139 [Documentation] This request will fetch the operational topology after the Bridge is deleted
141 @{list} Create List br-int br-s1
142 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}