6 Variables ../variables/Variables.py
7 Library RequestsLibrary
10 ${OVSDB_CONFIG_DIR} ../variables/ovsdb
11 ${SOUTHBOUND_CONFIG_API} ${CONFIG_TOPO_API}/topology/ovsdb:1/node/ovsdb:%2F%2F
15 [Arguments] ${mininet_ip}
16 [Documentation] This will Initiate the connection to OVSDB node from controller
17 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/connect.json
18 ${sample1} Replace String ${sample} 127.0.0.1 ${mininet_ip}
19 ${body} Replace String ${sample1} 61644 ${OVSDB_PORT}
20 Log URL is ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}
21 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT} data=${body}
23 Should Be Equal As Strings ${resp.status_code} 200
25 Disconnect From Ovsdb Node
26 [Arguments] ${mininet_ip}
27 [Documentation] This request will disconnect the OVSDB node from the controller
28 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}
29 Should Be Equal As Strings ${resp.status_code} 200
31 Add Bridge To Ovsdb Node
32 [Arguments] ${mininet_ip} ${bridge_num} ${datapath_id}
33 [Documentation] This will create a bridge and add it to the OVSDB node.
34 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_bridge.json
35 ${sample1} Replace String ${sample} tcp:127.0.0.1:6633 tcp:${CONTROLLER}:6633
36 ${sample2} Replace String ${sample1} 127.0.0.1 ${mininet_ip}
37 ${sample3} Replace String ${sample2} br01 ${bridge_num}
38 ${sample4} Replace String ${sample3} 61644 ${OVSDB_PORT}
39 ${body} Replace String ${sample4} 0000000000000001 ${datapath_id}
40 Log URL is ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num}
41 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num} data=${body}
43 Should Be Equal As Strings ${resp.status_code} 200
45 Delete Bridge From Ovsdb Node
46 [Arguments] ${mininet_ip} ${bridge_num}
47 [Documentation] This request will delete the bridge node from the OVSDB
48 ${resp} RequestsLibrary.Delete session ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num}
49 Should Be Equal As Strings ${resp.status_code} 200
52 [Arguments] ${mininet_ip} ${bridge_num} ${vxlan_port} ${remote_ip} ${custom_port}=create_port.json
53 [Documentation] This request will create vxlan port for vxlan tunnel and attach it to the specific bridge
54 ${sample} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/${custom_port}
55 ${body} Replace String ${sample} 192.168.0.21 ${remote_ip}
56 Log URL is ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num}/termination-point/${vxlan_port}/
57 ${resp} RequestsLibrary.Put session ${SOUTHBOUND_CONFIG_API}${mininet_ip}:${OVSDB_PORT}%2Fbridge%2F${bridge_num}/termination-point/${vxlan_port}/ data=${body}
59 Should Be Equal As Strings ${resp.status_code} 200
62 [Arguments] ${switch}=br-int
63 [Documentation] Used to log useful test debugs for OVSDB related system tests.
64 ${output}= Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-vsctl show
66 ${output}= Run Command On Remote System ${TOOLS_SYSTEM_IP} sudo ovs-ofctl -O OpenFlow13 dump-flows ${switch} | cut -d',' -f3-