*** Settings ***
Documentation Test suite connecting ODL to Mininet
+Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Teardown Delete All Sessions
+Library SSHLibrary
+Library Collections
+Library OperatingSystem
+Library String
+Library DateTime
+Library RequestsLibrary
+Library ../../../libraries/Common.py
+Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.txt
*** Variables ***
+${OVSDB_PORT} 6640
+${OF_PORT} 6653
${FLOWS_TABLE_20} actions=goto_table:20
${FLOW_CONTROLLER} actions=CONTROLLER:65535
${FLOWS_TABLE_30} actions=goto_table:30
${FLOWS_TABLE_100} actions=goto_table:100
${FLOWS_TABLE_110} actions=goto_table:110
${FLOW_DROP} actions=drop
+${PING_NOT_CONTAIN} Destination Host Unreachable
+@{node_list} ovsdb://uuid/
*** Test Cases ***
Make the OVS instance to listen for connection
[Documentation] Connect OVS to ODL
[Tags] OVSDB netvirt
Run Command On Remote System ${MININET} sudo ovs-vsctl del-manager
- Run Command On Remote System ${MININET} sudo ovs-vsctl set-manager tcp:${CONTROLLER}:6640
+ Run Command On Remote System ${MININET} sudo ovs-vsctl set-manager tcp:${CONTROLLER}:${OVSDB_PORT}
${output} Run Command On Remote System ${MININET} sudo ovs-vsctl show
+ ${pingresult} Run Command On Remote System ${MININET} ping ${CONTROLLER} -c 4
+ Should Not Contain ${pingresult} ${PING_NOT_CONTAIN}
+ Wait Until Keyword Succeeds 8s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
Get controller connection
[Documentation] This will make sure the controller is correctly set up/connected
[Tags] OVSDB netvirt
${output} Run Command On Remote System ${MININET} sudo ovs-vsctl show
- Should Contain ${output} Manager "tcp:${CONTROLLER}:6640"
+ Should Contain ${output} Manager "tcp:${CONTROLLER}:${OVSDB_PORT}"
Should Contain ${output} is_connected: true
Get bridge setup
[Documentation] This request is verifying that the br-int bridge has been created
[Tags] OVSDB netvirt
${output} Run Command On Remote System ${MININET} sudo ovs-vsctl show
- Should Contain ${output} Controller "tcp:${CONTROLLER}:6653"
+ Should Contain ${output} Controller "tcp:${CONTROLLER}:${OF_PORT}"
Should Contain ${output} Bridge br-int
Get port setup
*** Settings ***
Documentation Checking Network created in OVSDB are pushed to OpenDaylight
-Suite Setup Create Session ODLSession http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
+Suite Setup Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
Suite Teardown Delete All Sessions
Library SSHLibrary
Library Collections
${FLOAT_IP1_MAC} FA:16:3E:3F:37:BB
${FLOAT_IP1_DEVICE_ID} f013bef4-9468-494d-9417-c9d9e4abb97c
${FLOAT_IP1_ADDRESS} 192.168.111.22
+@{node_list} ovsdb://uuid/
*** Test Cases ***
Add variables to controller custom.properties
${controller_pid_2}= Get Process ID Based On Regex On Remote System ${CONTROLLER} java.*distribution.*karaf
Should Not be Equal As Numbers ${controller_pid_1} ${controller_pid_2}
+Ensure controller is running
+ [Documentation] Check if the controller is running before sending restconf requests
+ [Tags] Check controller reachability
+ Wait Until Keyword Succeeds 300s 2s Check For Elements At URI ${OPERATIONAL_TOPO_API} ${node_list}
+
Check External Net for Tenant
[Documentation] Check External Net for Tenant
[Tags] OpenStack Call Flow
- ${resp} RequestsLibrary.Get ODLSession ${ODLREST}/networks
- log http://${CONTROLLER}:${RESTCONFPORT}${ODLREST}
- Should be Equal As Strings ${resp.status_code} 200
+ ${resp} RequestsLibrary.Get session ${ODLREST}/networks
+ Log ${resp.content}
+ Should Be Equal As Strings ${resp.status_code} 200
Create External Net for Tenant
[Documentation] Create External Net for Tenant
${Data} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_ext_net.json
${Data} Replace String ${Data} {netId} ${EXT_NET1_ID}
${Data} Replace String ${Data} {tntId} ${TNT1_ID}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/networks data=${Data} headers=${HEADERS}
- log ${resp.status_code}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/networks data=${Data} headers=${HEADERS}
+ Log ${resp.content}
+ Should Be Equal As Strings ${resp.status_code} 201
Create External Subnet
[Documentation] Create External Subnet
${Data} Replace String ${Data} {netId} ${EXT_NET1_ID}
${Data} Replace String ${Data} {tntId} ${TNT1_ID}
${Data} Replace String ${Data} {subnetId} ${EXT_SUBNET1_ID}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/subnets ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/subnets ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Create Tenant Router
[Documentation] Create Tenant Router
${Data} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/create_router.json
${Data} Replace String ${Data} {tntId} ${TNT1_ID}
${Data} Replace String ${Data} {rtrId} ${TNT1_RTR_ID}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/routers ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/routers ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Set Router Gateway
[Documentation] Set Router Gateway
${Data} Replace String ${Data} {netId} ${EXT_NET1_ID}
${Data} Replace String ${Data} {subnetId} ${EXT_SUBNET1_ID}
${Data} Replace String ${Data} {portId} ${NEUTRON_PORT_TNT1_RTR_GW}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/ports ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/ports ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Update Router Port Gateway
[Documentation] Update Router Port Gateway
${Data} Replace String ${Data} {netId} ${EXT_NET1_ID}
${Data} Replace String ${Data} {subnetId} ${EXT_SUBNET1_ID}
${Data} Replace String ${Data} {portId} ${NEUTRON_PORT_TNT1_RTR_GW}
- log ${Data}
- ${resp} RequestsLibrary.Put ODLSession ${ODLREST}/routers/${TNT1_RTR_ID} ${Data}
- Should be Equal As Strings ${resp.status_code} 200
+ Log ${Data}
+ ${resp} RequestsLibrary.Put session ${ODLREST}/routers/${TNT1_RTR_ID} ${Data}
+ Should Be Equal As Strings ${resp.status_code} 200
Create Tenant Internal Net
[Documentation] Create Tenant Internal Net
${Data} Replace String ${Data} {netId} ${TNT1_NET1_ID}
${Data} Replace String ${Data} {netName} ${TNT1_NET1_NAME}
${Data} Replace String ${Data} {netSegm} ${TNT1_NET1_SEGM}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/networks ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/networks ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Create Tenant Internal Subnet
[Documentation] Create Tenant Internal Subnet
${Data} Replace String ${Data} {netId} ${TNT1_NET1_ID}
${Data} Replace String ${Data} {subnetId} ${TNT1_SUBNET1_ID}
${Data} Replace String ${Data} {subnetName} ${TNT1_SUBNET1_NAME}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/subnets ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/subnets ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Create Port DHCP
[Documentation] Create Port DHCP
${Data} Replace String ${Data} {tntId} ${TNT1_ID}
${Data} Replace String ${Data} {dhcpMac} ${TNT1_NET1_DHCP_MAC}
${Data} Replace String ${Data} {dhcpId} ${TNT1_NET1_DHCP_PORT_ID}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/ports ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/ports ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Update Port DHCP
[Documentation] Update Port DHCP
${Data} OperatingSystem.Get File ${OVSDB_CONFIG_DIR}/update_port_dhcp.json
${Data} Replace String ${Data} {BIND_HOST_ID} ${CONTROLLER}
${Data} Replace String ${Data} {dhcpDeviceId} ${TNT1_NET1_DHCP_DEVICE_ID}
- log ${Data}
- ${resp} RequestsLibrary.Put ODLSession ${ODLREST}/ports/${TNT1_NET1_DHCP_PORT_ID} ${Data}
- Should be Equal As Strings ${resp.status_code} 200
+ Log ${Data}
+ ${resp} RequestsLibrary.Put session ${ODLREST}/ports/${TNT1_NET1_DHCP_PORT_ID} ${Data}
+ Should Be Equal As Strings ${resp.status_code} 200
Create Router Interface on Tenant Internal Subnet
[Documentation] Create Router Interface on Tenant Internal Subnet
${Data} Replace String ${Data} {netId} ${TNT1_NET1_ID}
${Data} Replace String ${Data} {subnetId} ${TNT1_SUBNET1_ID}
${Data} Replace String ${Data} {portId} ${NEUTRON_PORT_TNT1_RTR_NET1}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/ports ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/ports ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Update Router Interface on Tenant Internal Subnet
[Documentation] Update Router Interface on Tenant Internal Subnet
${Data} Replace String ${Data} {rtrId} ${TNT1_RTR_ID}
${Data} Replace String ${Data} {subnetId} ${TNT1_SUBNET1_ID}
${Data} Replace String ${Data} {portId} ${NEUTRON_PORT_TNT1_RTR_NET1}
- log ${Data}
- ${resp} RequestsLibrary.Put ODLSession ${ODLREST}/routers/${TNT1_RTR_ID}/add_router_interface ${Data}
- Should be Equal As Strings ${resp.status_code} 200
+ Log ${Data}
+ ${resp} RequestsLibrary.Put session ${ODLREST}/routers/${TNT1_RTR_ID}/add_router_interface ${Data}
+ Should Be Equal As Strings ${resp.status_code} 200
Create Port VM
[Documentation] Create Port VM
${Data} Replace String ${Data} {portId} ${TNT1_VM1_PORT_ID}
${Data} Replace String ${Data} {macAddr} ${TNT1_VM1_MAC}
${Data} Replace String ${Data} {deviceId} ${TNT1_VM1_DEVICE_ID}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/ports ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/ports ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Create Port Floating IP
[Documentation] Create Port Floating IP
${Data} Replace String ${Data} {portId} ${FLOAT_IP1_PORT_ID}
${Data} Replace String ${Data} {macAddress} ${FLOAT_IP1_MAC}
${Data} Replace String ${Data} {deviceId} ${FLOAT_IP1_DEVICE_ID}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/ports ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/ports ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Create Floating IP
[Documentation] Create Floating IP
${Data} Replace String ${Data} {netId} ${EXT_NET1_ID}
${Data} Replace String ${Data} {floatIpId} ${FLOAT_IP1_ID}
${Data} Replace String ${Data} {floatIpAddress} ${FLOAT_IP1_ADDRESS}
- log ${Data}
- ${resp} RequestsLibrary.Post ODLSession ${ODLREST}/floatingips ${Data}
- Should be Equal As Strings ${resp.status_code} 201
+ Log ${Data}
+ ${resp} RequestsLibrary.Post session ${ODLREST}/floatingips ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
Associate the Floating IP with Tenant VM
[Documentation] Associate the Floating IP with Tenant VM
${Data} Replace String ${Data} {floatIpId} ${FLOAT_IP1_ID}
${Data} Replace String ${Data} {floatIpAddress} ${FLOAT_IP1_ADDRESS}
${Data} Replace String ${Data} {vmPortId} ${TNT1_VM1_PORT_ID}
- log ${Data}
- ${resp} RequestsLibrary.Put ODLSession ${ODLREST}/floatingips/${FLOAT_IP1_ID} ${Data}
- Should be Equal As Strings ${resp.status_code} 201
\ No newline at end of file
+ Log ${Data}
+ ${resp} RequestsLibrary.Put session ${ODLREST}/floatingips/${FLOAT_IP1_ID} ${Data}
+ Should Be Equal As Strings ${resp.status_code} 201
\ No newline at end of file