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.txt
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 add-br ${BRIDGE}
24 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
25 Run Command On Remote System ${MININET} sudo ovs-vsctl set-manager ptcp:6644
28 [Documentation] Initiate the connection to OVSDB node from controller
30 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
31 ${sample1} Replace String ${sample} 127.0.0.1 ${MININET}
32 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
33 Log URL is ${SOUTHBOUND_CONFIG_API}
34 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API} data=${body}
36 Should Be Equal As Strings ${resp.status_code} 200
38 Get Operational Topology
39 [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}
43 Get Config Topology without Bridge
44 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
46 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${CONFIG_TOPO_API} ${node_list}
48 Create bridge of already added bridge
49 [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:${CONTROLLER}:6633
53 ${sample2} Replace String ${sample1} 127.0.0.1 ${MININET}
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}
57 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE} data=${body}
59 Should Be Equal As Strings ${resp.status_code} 200
61 Create Port of already added port in OVSDB
62 [Documentation] This will add port/interface to the config datastore
64 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
65 ${sample1} Replace String ${sample} vxlanport vx1
66 ${body} Replace String ${sample1} 192.168.0.21 192.168.1.10
67 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
68 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/ data=${body}
70 Should Be Equal As Strings ${resp.status_code} 200
72 Get Config Topology with Bridge
73 [Documentation] This will fetch the configuration topology from configuration data store to verify the bridge is added to the data store
75 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${CONFIG_TOPO_API} ${node_list}
77 Modify the destination IP of Port
78 [Documentation] This will modify the dst ip of existing port
80 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
81 ${sample1} Replace String ${sample} vxlanport vx1
82 ${body} Replace String ${sample1} 192.168.0.21 10.0.0.19
83 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
84 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/ data=${body}
86 Should Be Equal As Strings ${resp.status_code} 200
88 Create Port and attach to a Bridge
89 [Documentation] This request will creates port/interface and attach it to the specific bridge
91 ${body} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_port.json
92 Log URL is ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
93 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/ data=${body}
95 Should Be Equal As Strings ${resp.status_code} 200
97 Get Operational Topology with Port
98 [Documentation] This request will fetch the operational topology after the Port is added to the bridge
100 @{list} Create List ${BRIDGE} vxlanport vx1 10.0.0.19
101 Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${list}
104 [Documentation] This request will delete the port node from the bridge node and data store.
106 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vx1/
107 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
110 [Documentation] This request will delete the port node from the bridge node and data store.
112 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}/termination-point/vxlanport/
113 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
115 Get Operational Topology after Deletion of Port
116 [Documentation] This request will fetch the operational topology after the Port is deleted
118 @{list} Create List vxlanport vx1
119 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
122 [Documentation] This request will delete the bridge node from the config data store.
124 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}%2Fbridge%2F${BRIDGE}
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 ${BRIDGE} vxlanport vx1
131 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}
133 Delete the OVSDB Node
134 [Documentation] This request will delete the OVSDB node
136 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}
137 Should Be Equal As Strings ${resp.status_code} 200 Response status code error
139 Get Operational Topology after Deletion of OVSDB Node
140 [Documentation] This request will fetch the operational topology after the OVSDB node is deleted
142 @{list} Create List ovsdb://${MININET}:${OVSDB_PORT} ${BRIDGE} vxlanport vx1
143 Wait Until Keyword Succeeds 8s 2s Check For Elements Not At URI ${OPERATIONAL_TOPO_API} ${list}