# TODO: also need to verify some non-zero pass count as well as other results are ok (e.g. skipped, etc)
Devstack Suite Setup Tests
- [Documentation] Login to the Openstack Control Node to run tempest suite
- SSHLibrary.Open Connection ${OS_CONTROL_NODE_IP} prompt=${DEFAULT_LINUX_PROMPT}
+ [Arguments] ${source_pwd}=no
+ [Documentation] Login to the Openstack Control Node to run tempest suite
+ ${devstack_conn_id}= SSHLibrary.Open Connection ${OS_CONTROL_NODE_IP} prompt=${DEFAULT_LINUX_PROMPT}
+ Set Suite Variable ${devstack_conn_id}
+ Set Suite Variable ${source_pwd}
+ Log ${devstack_conn_id}
Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
[Documentation] Uses "vsctl show" to check for string "is_connected"
${output}= Utils.Run Command On Remote System ${tools_system} sudo ovs-vsctl show
Should Contain ${output} is_connected
+ [Return] ${output}
Get OVSDB UUID
[Arguments] ${ovs_system_ip}=${TOOLS_SYSTEM_IP} ${controller_ip}=${ODL_SYSTEM_IP} ${controller_http_session}=session
*** Settings ***
-Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances
-Library SSHLibrary
-Resource Utils.robot
-Variables ../variables/Variables.py
+Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances
+Library SSHLibrary
+Resource Utils.robot
+Variables ../variables/Variables.py
*** Keywords ***
+Source Password
+ [Arguments] ${force}=no
+ [Documentation] Sourcing the Openstack PAsswords for neutron configurations
+ Run Keyword If '${source_pwd}' == 'yes' or '${force}' == 'yes' Write Commands Until Prompt cd ${DEVSTACK_DEPLOY_PATH}; source openrc admin admin
+
Create Network
- [Arguments] ${network_name} ${devstack_path}=/opt/stack/new/devstack
+ [Arguments] ${network_name}
[Documentation] Create Network with neutron request.
- ${output}= Write Commands Until Prompt cd ${devstack_path} && cat localrc
- Log ${output}
- ${output}= Write Commands Until Prompt source openrc admin admin
- Log ${output}
- ${output}= Write Commands Until Prompt neutron -v net-create ${network_name}
+ Switch Connection ${devstack_conn_id}
+ Source Password force=yes
+ ${output}= Write Commands Until Prompt neutron -v net-create ${network_name} 30s
Log ${output}
Should Contain ${output} Created a new network
Delete Network
[Arguments] ${network_name}
[Documentation] Delete Network with neutron request.
+ Switch Connection ${devstack_conn_id}
+ Source Password
${output}= Write Commands Until Prompt neutron -v net-delete ${network_name}
Log ${output}
Should Contain ${output} Deleted network: ${network_name}
Create SubNet
[Arguments] ${network_name} ${subnet} ${range_ip}
[Documentation] Create SubNet for the Network with neutron request.
- ${output}= Write Commands Until Prompt neutron -v subnet-create ${network_name} ${range_ip} --name ${subnet}
+ Switch Connection ${devstack_conn_id}
+ Source Password
+ ${output}= Write Commands Until Prompt neutron -v subnet-create ${network_name} ${range_ip} --name ${subnet} 30s
Log ${output}
Should Contain ${output} Created a new subnet
[Arguments] ${subnet}
[Documentation] Delete SubNet for the Network with neutron request.
Log ${subnet}
+ Switch Connection ${devstack_conn_id}
+ Source Password
${output}= Write Commands Until Prompt neutron -v subnet-delete ${subnet}
Log ${output}
Should Contain ${output} Deleted subnet: ${subnet}
: FOR ${GatewayIpElement} IN @{GATEWAY_IPS}
\ Should Not Contain ${output} ${GatewayIpElement}
-Create Vm Instance
- [Arguments] ${net_id} ${network_name}
- [Documentation] Create Vm Instance with the net id of the Netowrk.
- ${VmElement}= Set Variable If "${network_name}"=="net1_network" MyFirstInstance MySecondInstance
- ${output}= Write Commands Until Prompt nova boot --image cirros-0.3.4-x86_64-uec --flavor m1.tiny --nic net-id=${net_id} ${VmElement}
- Log ${output}
-
Delete Vm Instance
[Arguments] ${vm_name}
[Documentation] Delete Vm instances using instance names.
+ Switch Connection ${devstack_conn_id}
+ Source Password
${output}= Write Commands Until Prompt nova delete ${vm_name}
- Log ${output}
+ Should Contain ${output} ${vm_name}
Get Net Id
[Arguments] ${network_name}
[Documentation] Retrieve the net id for the given network name to create specific vm instance
+ Switch Connection ${devstack_conn_id}
+ Source Password force=yes
${output}= Write Commands Until Prompt neutron net-list | grep "${network_name}" | get_field 1
Log ${output}
${splitted_output}= Split String ${output} ${EMPTY}
[Return] ${net_id}
Create Vm Instances
- [Arguments] ${net_id} ${vm_instance_names} ${image}=cirros-0.3.4-x86_64-uec ${flavor}=m1.tiny
- [Documentation] Create Four Vm Instance with the net id of the Netowrk.
+ [Arguments] ${net_name} ${vm_instance_names} ${image}=cirros-0.3.4-x86_64-uec ${flavor}=m1.tiny
+ [Documentation] Create X Vm Instance with the net id of the Netowrk.
+ Switch Connection ${devstack_conn_id}
+ Source Password
+ ${net_id}= Get Net Id ${net_name}
: FOR ${VmElement} IN @{vm_instance_names}
\ ${output}= Write Commands Until Prompt nova boot --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${VmElement}
\ Log ${output}
+ \ Wait Until Keyword Succeeds 25s 5s Verify VM Is ACTIVE ${VmElement}
+
+Verify VM Is ACTIVE
+ [Arguments] ${vm_name}
+ [Documentation] Run these commands to check whether the created vm instance is active or not.
+ ${output}= Write Commands Until Prompt nova show ${vm_name} | grep OS-EXT-STS:vm_state
+ Log ${output}
+ Should Contain ${output} active
View Vm Console
[Arguments] ${vm_instance_names}
\ Log ${output}
Ping Vm From DHCP Namespace
- [Arguments] ${net_id} ${vm_ip}
+ [Arguments] ${net_name} ${vm_ip}
[Documentation] Reach all Vm Instance with the net id of the Netowrk.
Log ${vm_ip}
+ Switch Connection ${devstack_conn_id}
+ ${net_id}= Get Net Id ${net_name}
+ Log ${net_id}
${output}= Write Commands Until Prompt sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip} 20s
Log ${output}
- [Return] ${output}
+ Should Contain ${output} 64 bytes
Ping From Instance
[Arguments] ${dest_vm}
[Documentation] Ping to the expected destination ip.
- ${output}= Write Commands Until Expected Prompt ping -c 3 ${dest_vm} $
+ ${output}= Write Commands Until Expected Prompt ping -c 3 ${dest_vm} ${OS_SYSTEM_PROMPT}
Log ${output}
[Return] ${output}
Curl Metadata Server
[Documentation] Ping to the expected destination ip.
- ${output}= Write Commands Until Expected Prompt curl -i http://169.254.169.254 $
+ ${output}= Write Commands Until Expected Prompt curl -i http://169.254.169.254 ${OS_SYSTEM_PROMPT}
Write Commands Until Prompt exit
Should Contain ${output} 200
${output}= Write Commands Until Prompt exit
Log ${output}
-Ssh Vm Instance
- [Arguments] ${net_id} ${vm_ip} ${user}=cirros ${password}=cubswin:) ${key_file}=test.pem
+Check If Console Is VmInstance
+ [Arguments] ${console}=cirros
+ [Documentation] Check if the session has been able to login to the VM instance
+ ${output}= Write Commands Until Expected Prompt id ${OS_SYSTEM_PROMPT}
+ Should Contain ${output} ${console}
+
+Exit From Vm Console
+ [Documentation] Check if the session has been able to login to the VM instance and exit the instance
+ ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance cirros
+ Run Keyword If ${rcode} Write Commands Until Prompt exit
+ Get OvsDebugInfo
+
+Check Ping
+ [Arguments] ${ip_address}
+ [Documentation] Run Ping command on the IP available as argument
+ ${output}= Write Commands Until Expected Prompt ping -c 3 ${ip_address} ${OS_SYSTEM_PROMPT}
+ Should Contain ${output} 64 bytes
+
+Check Metadata Access
+ [Documentation] Try curl on the Metadataurl and check if it is okay
+ ${output}= Write Commands Until Expected Prompt curl -i http://169.254.169.254 ${OS_SYSTEM_PROMPT}
+ Should Contain ${output} 200
+
+Test Operations From Vm Instance
+ [Arguments] ${net_name} ${src_ip} ${list_of_local_dst_ips} ${l2_or_l3}=l2 ${list_of_external_dst_ips}=${NONE} ${user}=cirros ${password}=cubswin:)
[Documentation] Login to the vm instance using ssh in the network.
- ${output}= Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh -i ${key_file} ${user}@${vm_ip} (yes/no)?
- Log ${output}
- ${output}= Write Commands Until Expected Prompt yes d:
+ Switch Connection ${devstack_conn_id}
+ Source Password
+ ${net_id}= Get Net Id ${net_name}
+ ${output}= Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh ${user}@${src_ip} -o ConnectTimeout=10 -o StrictHostKeyChecking=no d:
Log ${output}
- ${output}= Write Commands Until Expected Prompt ${password} $
- Log ${output}
- ${output}= Write Commands Until Expected Prompt ifconfig $
- Log ${output}
- ${output}= Write Commands Until Expected Prompt route $
+ ${output}= Write Commands Until Expected Prompt ${password} ${OS_SYSTEM_PROMPT}
Log ${output}
+ ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance
+ Run Keyword If ${rcode} Write Commands Until Expected Prompt ifconfig ${OS_SYSTEM_PROMPT}
+ Run Keyword If ${rcode} Write Commands Until Expected Prompt route ${OS_SYSTEM_PROMPT}
+ ${dest_vm}= Get From List ${list_of_local_dst_ips} 0
+ Log ${dest_vm}
+ Run Keyword If ${rcode} Check Ping ${dest_vm}
+ ${dest_dhcp}= Get From List ${list_of_local_dst_ips} 1
+ Log ${dest_dhcp}
+ Run Keyword If ${rcode} Check Ping ${dest_dhcp}
+ ${dest_vm}= Get From List ${list_of_local_dst_ips} 2
+ Log ${dest_vm}
+ Run Keyword If ${rcode} Check Ping ${dest_vm}
+ Run Keyword If ${rcode} Check Metadata Access
+ Run Keyword If '${l2_or_l3}' == 'l3' Ping Other Instances ${list_of_external_dst_ips}
+ [Teardown] Exit From Vm Console
+
+Ping Other Instances
+ [Arguments] ${list_of_external_dst_ips}
+ [Documentation] Check reachability with other network's instances.
+ ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance
+ ${dest_vm}= Get From List ${list_of_external_dst_ips} 0
+ Log ${dest_vm}
+ Run Keyword If ${rcode} Check Ping ${dest_vm}
+ ${dest_dhcp}= Get From List ${list_of_external_dst_ips} 1
+ Log ${dest_dhcp}
+ Run Keyword If ${rcode} Check Ping ${dest_dhcp}
+ ${dest_vm}= Get From List ${list_of_external_dst_ips} 2
+ Log ${dest_vm}
+ Run Keyword If ${rcode} Check Ping ${dest_vm}
Create Router
[Arguments] ${router_name}
[Documentation] Create Router and Add Interface to the subnets.
+ Switch Connection ${devstack_conn_id}
+ Source Password
${output}= Write Commands Until Prompt neutron -v router-create ${router_name}
Should Contain ${output} Created a new router
Add Router Interface
[Arguments] ${router_name} ${interface_name}
+ Switch Connection ${devstack_conn_id}
+ Source Password
${output}= Write Commands Until Prompt neutron -v router-interface-add ${router_name} ${interface_name}
Should Contain ${output} Added interface
Remove Interface
[Arguments] ${router_name} ${interface_name}
[Documentation] Remove Interface to the subnets.
+ Switch Connection ${devstack_conn_id}
+ Source Password
${output}= Write Commands Until Prompt neutron -v router-interface-delete ${router_name} ${interface_name}
Should Contain ${output} Removed interface from router
Delete Router
[Arguments] ${router_name}
[Documentation] Delete Router and Interface to the subnets.
+ Switch Connection ${devstack_conn_id}
+ Source Password
${output}= Write Commands Until Prompt neutron -v router-delete ${router_name}
Should Contain ${output} Deleted router:
+Get DumpFlows And Ovsconfig
+ [Arguments] ${openstack_node_ip}
+ [Documentation] Get the OvsConfig and Flow entries from OVS from the Openstack Node
+ Log ${openstack_node_ip}
+ SSHLibrary.Open Connection ${openstack_node_ip} prompt=${DEFAULT_LINUX_PROMPT}
+ Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
+ SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
+ Write Commands Until Expected Prompt sudo ovs-vsctl show ]>
+ Write Commands Until Expected Prompt sudo ovs-ofctl dump-flows br-int -OOpenFlow13 ]>
+
+Get OvsDebugInfo
+ [Documentation] Get the OvsConfig and Flow entries from all Openstack nodes
+ Run Keyword If 0 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_CONTROL_NODE_IP}
+ Run Keyword If 1 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_1_IP}
+ Run Keyword If 2 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_COMPUTE_2_IP}
+
Show Debugs
[Arguments] ${vm_indices}
[Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node
--- /dev/null
+*** Settings ***
+Documentation Test suite to verify packet flows between vm instances.
+Suite Setup Devstack Suite Setup Tests source_pwd=yes
+Suite Teardown Close All Connections
+Library SSHLibrary
+Library OperatingSystem
+Library RequestsLibrary
+Library Collections
+Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/OpenStackOperations.robot
+Resource ../../../libraries/DevstackUtils.robot
+Resource ../../../libraries/OVSDB.robot
+Library ../../../libraries/Common.py
+Variables ../../../variables/Variables.py
+Resource ../../../libraries/ClusterKeywords.robot
+
+*** Variables ***
+@{NETWORKS_NAME} l2_net_1 l2_net_2
+@{SUBNETS_NAME} l2_sub_net_1 l2_sub_net_2
+@{NET_1_VM_INSTANCES} VmInstance1_l2_net_1 VmInstance2_net_1 VmInstance3_net_1
+@{NET_2_VM_INSTANCES} VmInstance1_l2_net_2 VmInstance2_net_2 VmInstance3_net_2
+@{NET_1_VM_IPS} 70.0.0.3 70.0.0.4 70.0.0.5
+@{NET_2_VM_IPS} 80.0.0.3 80.0.0.4 80.0.0.5
+@{VM_IPS_NOT_DELETED} 70.0.0.4
+@{GATEWAY_IPS} 70.0.0.1 80.0.0.1
+@{DHCP_IPS} 70.0.0.2 80.0.0.2
+@{cluster_down_list} 1 2
+@{SUBNETS_RANGE} 70.0.0.0/24 80.0.0.0/24
+
+*** Test Cases ***
+Create Cluster List
+ [Documentation] Create original cluster list.
+ ${original_cluster_list} ClusterKeywords.Create Controller Index List
+ Set Suite Variable ${original_cluster_list}
+ Log ${original_cluster_list}
+
+Check OVS Manager Connection Status
+ [Documentation] This will verify if the OVS manager is connected
+ ${output}= Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected ${OS_CONTROL_NODE_IP}
+ Log ${output}
+ Set Suite Variable ${status} is_connected: true
+ ${dictionary}= Create Dictionary ${status}=9
+ Utils.Check Item Occurrence ${output} ${dictionary}
+
+Create Networks
+ [Documentation] Create Network with neutron request.
+ : FOR ${NetworkElement} IN @{NETWORKS_NAME}
+ \ Create Network ${NetworkElement}
+
+Create Subnets For l2_net_1
+ [Documentation] Create Sub Nets for the Networks with neutron request.
+ Create SubNet l2_net_1 l2_sub_net_1 @{SUBNETS_RANGE}[0]
+
+Create Subnets For l2_net_2
+ [Documentation] Create Sub Nets for the Networks with neutron request.
+ Create SubNet l2_net_2 l2_sub_net_2 @{SUBNETS_RANGE}[1]
+
+Take Down ODL1
+ [Documentation] Kill the karaf in First Controller
+ ClusterKeywords.Kill Multiple Controllers 1
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Remove Values From List ${new_cluster_list} 1
+ Set Suite Variable ${new_cluster_list}
+
+Create Vm Instances For l2_net_1
+ [Documentation] Create Vm instances using flavor and image names for a network.
+ Log ${devstack_conn_id}
+ Create Vm Instances l2_net_1 ${NET_1_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_1_VM_INSTANCES}
+
+Bring Up ODL1
+ [Documentation] Bring up ODL1 again
+ ClusterKeywords.Start Multiple Controllers 300s 1
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Set Suite Variable ${new_cluster_list}
+
+Take Down ODL2
+ [Documentation] Kill the karaf in Second Controller
+ ClusterKeywords.Kill Multiple Controllers 2
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Remove Values From List ${new_cluster_list} 2
+ Set Suite Variable ${new_cluster_list}
+
+Create Vm Instances For l2_net_2
+ [Documentation] Create Vm instances using flavor and image names for a network.
+ Create Vm Instances l2_net_2 ${NET_2_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
+
+Bring Up ODL2
+ [Documentation] Bring up ODL2 again
+ ClusterKeywords.Start Multiple Controllers 300s 2
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Set Suite Variable ${new_cluster_list}
+
+Ping Vm Instance1 In l2_net_1
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[0]
+
+Ping Vm Instance2 In l2_net_1
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[1]
+
+Ping Vm Instance3 In l2_net_1
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_net_1 @{NET_1_VM_IPS}[2]
+
+Ping Vm Instance1 In l2_net_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[0]
+
+Ping Vm Instance2 In l2_net_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[1]
+
+Ping Vm Instance3 In l2_net_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_net_2 @{NET_2_VM_IPS}[2]
+
+Take Down ODL3
+ [Documentation] Kill the karaf in Third Controller
+ ClusterKeywords.Kill Multiple Controllers 3
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Remove Values From List ${new_cluster_list} 3
+ Set Suite Variable ${new_cluster_list}
+
+Connectivity Tests From Vm Instance1 In l2_net_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[0] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l2_net_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[1] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l2_net_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_net_1 @{NET_1_VM_IPS}[2] ${dst_ip_list}
+
+Bring Up ODL3
+ [Documentation] Bring up ODL3 again
+ ClusterKeywords.Start Multiple Controllers 300s 3
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Set Suite Variable ${new_cluster_list}
+
+Take Down ODL1 and ODL2
+ [Documentation] Kill the karaf in First and Second Controller
+ : FOR ${index} IN @{cluster_down_list}
+ \ ClusterKeywords.Kill Multiple Controllers ${index}
+
+Connectivity Tests From Vm Instance1 In l2_net_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[0] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l2_net_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[1] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l2_net_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_net_2 @{NET_2_VM_IPS}[2] ${dst_ip_list}
+
+Bring Up ODL1 and ODL2
+ [Documentation] Bring up ODL1 and ODL2 again.
+ : FOR ${index} IN @{cluster_down_list}
+ \ ClusterKeywords.Start Multiple Controllers 300s ${index}
+
+Delete Vm Instance
+ [Documentation] Delete Vm instances using instance names.
+ Delete Vm Instance VmInstance1_l2_net_1
+
+Ping All Vm Instances
+ [Documentation] Check reachability of vm instances by pinging to them.
+ ${net_id}= Get Net Id l2_net_1
+ : FOR ${VmIpElement} IN @{VM_IPS_NOT_DELETED}
+ \ ${output}= Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
+ \ Should Contain ${output} 64 bytes
+
+No Ping For Deleted Vm
+ [Documentation] Check non reachability of deleted vm instances by pinging to them.
+ ${output}= Ping Vm From DHCP Namespace ${net_id} @{NET_1_VM_IPS}[0]
+ Should Contain ${output} Destination Host Unreachable
+
+Delete Vm Instances In network_1
+ [Documentation] Delete Vm instances using instance names in network_1.
+ : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
+ \ Delete Vm Instance ${VmElement}
+
+Delete Vm Instances In network_2
+ [Documentation] Delete Vm instances using instance names in network_2.
+ : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
+ \ Delete Vm Instance ${VmElement}
+
+Delete Sub Networks In network_1
+ [Documentation] Delete Sub Nets for the Networks with neutron request.
+ Delete SubNet l2_sub_net_1
+
+Delete Sub Networks In network_2
+ [Documentation] Delete Sub Nets for the Networks with neutron request.
+ Delete SubNet l2_sub_net_2
+
+Delete Networks
+ [Documentation] Delete Networks with neutron request.
+ : FOR ${NetworkElement} IN @{NETWORKS_NAME}
+ \ Delete Network ${NetworkElement}
--- /dev/null
+*** Settings ***
+Documentation Test suite to check connectivity in L3 using routers.
+Suite Setup Devstack Suite Setup Tests source_pwd=yes
+Suite Teardown Close All Connections
+Library SSHLibrary
+Library OperatingSystem
+Library RequestsLibrary
+Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/OpenStackOperations.robot
+Resource ../../../libraries/DevstackUtils.robot
+Resource ../../../libraries/ClusterKeywords.robot
+
+*** Variables ***
+@{NETWORKS_NAME} l3_net_1 l3_net_2
+@{SUBNETS_NAME} l3_sub_net_1 l3_sub_net_2
+@{NET_1_VM_INSTANCES} VmInstance1_net_1 VmInstance2_net_1 VmInstance3_net_1
+@{NET_2_VM_INSTANCES} VmInstance1_net_2 VmInstance2_net_2 VmInstance3_net_2
+@{NET_1_VM_IPS} 90.0.0.3 90.0.0.4 90.0.0.5
+@{NET_2_VM_IPS} 100.0.0.3 100.0.0.4 100.0.0.5
+@{GATEWAY_IPS} 90.0.0.1 100.0.0.1
+@{DHCP_IPS} 90.0.0.2 100.0.0.2
+@{SUBNETS_RANGE} 90.0.0.0/24 100.0.0.0/24
+@{odl_1_and_2_down} 1 2
+@{odl_2_and_3_down} 2 3
+
+*** Test Cases ***
+Create Networks
+ [Documentation] Create Network with neutron request.
+ : FOR ${NetworkElement} IN @{NETWORKS_NAME}
+ \ Create Network ${NetworkElement}
+
+Create Subnets For l3_net_1
+ [Documentation] Create Sub Nets for the Networks with neutron request.
+ Create SubNet l3_net_1 l3_sub_net_1 @{SUBNETS_RANGE}[0]
+
+Create Subnets For l3_net_2
+ [Documentation] Create Sub Nets for the Networks with neutron request.
+ Create SubNet l3_net_2 l3_sub_net_2 @{SUBNETS_RANGE}[1]
+
+Take Down ODL1
+ [Documentation] Kill the karaf in First Controller
+ ClusterKeywords.Kill Multiple Controllers 1
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Remove Values From List ${new_cluster_list} 1
+ Set Suite Variable ${new_cluster_list}
+
+Create Vm Instances For l3_net_1
+ [Documentation] Create Four Vm instances using flavor and image names for a network.
+ Create Vm Instances l3_net_1 ${NET_1_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_1_VM_INSTANCES}
+
+Bring Up ODL1
+ [Documentation] Bring up ODL1 again
+ ClusterKeywords.Start Multiple Controllers 300s 1
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Set Suite Variable ${new_cluster_list}
+
+Take Down ODL2
+ [Documentation] Kill the karaf in Second Controller
+ ClusterKeywords.Kill Multiple Controllers 2
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Remove Values From List ${new_cluster_list} 2
+ Set Suite Variable ${new_cluster_list}
+
+Create Vm Instances For l3_net_2
+ [Documentation] Create Four Vm instances using flavor and image names for a network.
+ Create Vm Instances l3_net_2 ${NET_2_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
+
+Bring Up ODL2
+ [Documentation] Bring up ODL2 again
+ ClusterKeywords.Start Multiple Controllers 300s 2
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Set Suite Variable ${new_cluster_list}
+
+Take Down ODL3
+ [Documentation] Kill the karaf in Third Controller
+ ClusterKeywords.Kill Multiple Controllers 3
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Remove Values From List ${new_cluster_list} 3
+ Set Suite Variable ${new_cluster_list}
+
+Create Routers
+ [Documentation] Create Router and Add Interface to the subnets.
+ Create Router router_2
+ Create Router router_3
+
+Add Interfaces To Router
+ [Documentation] Add Interfaces
+ : FOR ${interface} IN @{SUBNETS_NAME}
+ \ Add Router Interface router_3 ${interface}
+
+Verify Created Routers
+ [Documentation] Check created routers using northbound rest calls
+ ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
+ Log ${data}
+ Should Contain ${data} router_3
+
+Bring Up ODL3
+ [Documentation] Bring up ODL3 again
+ ClusterKeywords.Start Multiple Controllers 300s 3
+ ${new_cluster_list} ClusterKeywords.Create Controller Index List
+ Set Suite Variable ${new_cluster_list}
+
+Ping Vm Instance1 In l3_net_2 From l3_net_1
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[0]
+
+Ping Vm Instance2 In l3_net_2 From l3_net_1
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[1]
+
+Ping Vm Instance3 In l3_net_2 From l3_net_1
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace l3_net_1 @{NET_2_VM_IPS}[2]
+
+Ping Vm Instance In l3_net_1 From l3_net_2
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[0]
+
+Ping Vm Instance In l3_net_1 From l3_net_2
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[1]
+
+Ping Vm Instance In l3_net_1 From l3_net_2
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace l3_net_2 @{NET_1_VM_IPS}[2]
+
+Take Down ODL1 and ODL2
+ [Documentation] Kill the karaf in First and Second Controller
+ : FOR ${index} IN @{odl_1_and_2_down}
+ \ ClusterKeywords.Kill Multiple Controllers ${index}
+
+Connectivity Tests From Vm Instance1 In l3_net_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2] @{NET_2_VM_IPS}[1]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance l3_net_1 @{NET_1_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l3_net_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance l3_net_1 @{NET_1_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l3_net_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance l3_net_1 @{NET_1_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Bring Up ODL1 and ODL2
+ [Documentation] Bring up ODL1 and ODL2 again
+ : FOR ${index} IN @{odl_1_and_2_down}
+ \ ClusterKeywords.Start Multiple Controllers 300s ${index}
+
+Take Down ODL2 and ODL3
+ [Documentation] Kill the karaf in First and Second Controller
+ : FOR ${index} IN @{odl_2_and_3_down}
+ \ ClusterKeywords.Kill Multiple Controllers ${index}
+
+Connectivity Tests From Vm Instance1 In l3_net_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance l3_net_2 @{NET_2_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l3_net_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance l3_net_2 @{NET_2_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l3_net_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance l3_net_2 @{NET_2_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Bring Up ODL2 and ODL3
+ [Documentation] Bring up ODL2 and ODL3 again.
+ : FOR ${index} IN @{odl_2_and_3_down}
+ \ ClusterKeywords.Start Multiple Controllers 300s ${index}
+
+Delete Vm Instances In l3_net_1
+ [Documentation] Delete Vm instances using instance names in l3_net_1.
+ : FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
+ \ Delete Vm Instance ${VmElement}
+
+Delete Vm Instances In l3_net_2
+ [Documentation] Delete Vm instances using instance names in l3_net_2.
+ : FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
+ \ Delete Vm Instance ${VmElement}
+
+Delete Router Interfaces
+ [Documentation] Remove Interface to the subnets.
+ : FOR ${interface} IN @{SUBNETS_NAME}
+ \ Remove Interface router_3 ${interface}
+
+Delete Routers
+ [Documentation] Delete Router and Interface to the subnets.
+ Delete Router router_2
+ Delete Router router_3
+
+Verify Deleted Routers
+ [Documentation] Check deleted routers using northbound rest calls
+ ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API}
+ Log ${data}
+ Should Not Contain ${data} router_3
+
+Delete Sub Networks In l3_net_1
+ [Documentation] Delete Sub Nets for the Networks with neutron request.
+ Delete SubNet l3_sub_net_1
+
+Delete Sub Networks In l3_net_2
+ [Documentation] Delete Sub Nets for the Networks with neutron request.
+ Delete SubNet l3_sub_net_2
+
+Delete Networks
+ [Documentation] Delete Networks with neutron request.
+ : FOR ${NetworkElement} IN @{NETWORKS_NAME}
+ \ Delete Network ${NetworkElement}
*** Settings ***
-Documentation Test suite to verify packet flows between vm instances.
-Suite Setup Devstack Suite Setup Tests
-Library SSHLibrary
-Library OperatingSystem
-Library RequestsLibrary
-Resource ../../../libraries/Utils.robot
-Resource ../../../libraries/OpenStackOperations.robot
-Resource ../../../libraries/DevstackUtils.robot
+Documentation Test suite to verify packet flows between vm instances.
+Suite Setup Devstack Suite Setup Tests
+Suite Teardown Close All Connections
+Library SSHLibrary
+Library OperatingSystem
+Library RequestsLibrary
+Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/OpenStackOperations.robot
+Resource ../../../libraries/DevstackUtils.robot
*** Variables ***
-@{NETWORKS_NAME} network_1 network_2
-@{SUBNETS_NAME} subnet_1 subnet_2
-@{NET_1_VM_INSTANCES} MyFirstInstance_1 MySecondInstance_1
-@{NET_2_VM_INSTANCES} MyFirstInstance_2 MySecondInstance_2
-@{NET_1_VM_IPS} 30.0.0.3 30.0.0.4
-@{NET_2_VM_IPS} 40.0.0.3 40.0.0.4
+@{NETWORKS_NAME} l2_network_1 l2_network_2
+@{SUBNETS_NAME} l2_subnet_1 l2_subnet_2
+@{NET_1_VM_INSTANCES} MyFirstInstance_1 MySecondInstance_1 MyThirdInstance_1
+@{NET_2_VM_INSTANCES} MyFirstInstance_2 MySecondInstance_2 MyThirdInstance_2
+@{NET_1_VM_IPS} 30.0.0.3 30.0.0.4 30.0.0.5
+@{NET_2_VM_IPS} 40.0.0.3 40.0.0.4 40.0.0.5
@{VM_IPS_NOT_DELETED} 30.0.0.4
@{GATEWAY_IPS} 30.0.0.1 40.0.0.1
@{DHCP_IPS} 30.0.0.2 40.0.0.2
+@{SUBNETS_RANGE} 30.0.0.0/24 40.0.0.0/24
*** Test Cases ***
Create Networks
[Documentation] Create Network with neutron request.
: FOR ${NetworkElement} IN @{NETWORKS_NAME}
- \ Create Network ${NetworkElement} devstack_path=/opt/stack/devstack
+ \ Create Network ${NetworkElement}
-Create Subnets For network_1
+Create Subnets For l2_network_1
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet network_1 subnet_1 30.0.0.0/24
+ Create SubNet l2_network_1 l2_subnet_1 @{SUBNETS_RANGE}[0]
-Create Subnets For network_2
+Create Subnets For l2_network_2
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet network_2 subnet_2 40.0.0.0/24
+ Create SubNet l2_network_2 l2_subnet_2 @{SUBNETS_RANGE}[1]
-Create Vm Instances For network_1
+Create Vm Instances For l2_network_1
[Documentation] Create Four Vm instances using flavor and image names for a network.
- ${net_id}= Get Net Id network_1
- Create Vm Instances ${net_id} ${NET_1_VM_INSTANCES}
+ Create Vm Instances l2_network_1 ${NET_1_VM_INSTANCES}
[Teardown] Show Debugs ${NET_1_VM_INSTANCES}
-Create Vm Instances For network_2
+Create Vm Instances For l2_network_2
[Documentation] Create Four Vm instances using flavor and image names for a network.
- ${net_id}= Get Net Id network_2
- Set Suite Variable ${net_id}
- Create Vm Instances ${net_id} ${NET_2_VM_INSTANCES}
+ Create Vm Instances l2_network_2 ${NET_2_VM_INSTANCES}
[Teardown] Show Debugs ${NET_2_VM_INSTANCES}
-Ping All Vm Instances In network_1
+Ping Vm Instance1 In l2_network_1
[Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id network_1
- : FOR ${VmIpElement} IN @{NET_1_VM_IPS}
- \ ${output} Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
- \ Should Contain ${output} 64 bytes
+ Ping Vm From DHCP Namespace l2_network_1 @{NET_1_VM_IPS}[0]
-Ping All Vm Instances In network_2
+Ping Vm Instance2 In l2_network_1
[Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id network_2
- : FOR ${VmIpElement} IN @{NET_2_VM_IPS}
- \ ${output} Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
- \ Should Contain ${output} 64 bytes
-
-Login to Vm Instances In network_1 Using Ssh
- [Documentation] Logging to the vm instance using generated key pair.
- ${net_id}= Get Net Id network_1
- Ssh Vm Instance ${net_id} 30.0.0.3
+ Ping Vm From DHCP Namespace l2_network_1 @{NET_1_VM_IPS}[1]
-Ping Vm Instance From Instance In network_1
- [Documentation] Check reachability of vm instances by pinging.
- ${output}= Ping From Instance 30.0.0.4
- Should Contain ${output} 64 bytes
+Ping Vm Instance3 In l2_network_1
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_network_1 @{NET_1_VM_IPS}[2]
-Ping Dhcp Server From Instance In network_1
- [Documentation] ping the dhcp server from instance.
- ${output}= Ping From Instance 30.0.0.2
- Should Contain ${output} 64 bytes
+Ping Vm Instance1 In l2_network_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_network_2 @{NET_2_VM_IPS}[0]
-Ping Metadata Server From Instance In network_1
- [Documentation] ping the metadata server from instance.
- Curl Metadata Server
+Ping Vm Instance2 In l2_network_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_network_2 @{NET_2_VM_IPS}[1]
-Login to Vm Instances In network_2 Using Ssh
+Ping Vm Instance3 In l2_network_2
+ [Documentation] Check reachability of vm instances by pinging to them.
+ Ping Vm From DHCP Namespace l2_network_2 @{NET_2_VM_IPS}[2]
+
+Connectivity Tests From Vm Instance1 In l2_network_1
+ [Documentation] Logging to the vm instance1
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[1] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_network_1 @{NET_1_VM_IPS}[0] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In l2_network_1
+ [Documentation] Logging to the vm instance2
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_network_1 @{NET_1_VM_IPS}[1] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance3 In l2_network_1
+ [Documentation] Logging to the vm instance2
+ ${dst_ip_list}= Create List @{NET_1_VM_IPS}[0] @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_network_1 @{NET_1_VM_IPS}[2] ${dst_ip_list}
+
+Connectivity Tests From Vm Instance1 In l2_network_2
[Documentation] Logging to the vm instance using generated key pair.
- ${net_id}= Get Net Id network_2
- Ssh Vm Instance ${net_id} 40.0.0.3
-
-Ping Vm Instance From Instance In network_2
- [Documentation] Check reachability of vm instances by pinging.
- ${output}= Ping From Instance 40.0.0.4
- Should Contain ${output} 64 bytes
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[1] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_network_2 @{NET_2_VM_IPS}[0] ${dst_ip_list}
-Ping Dhcp Server From Instance In network_2
- [Documentation] ping the dhcp server from instance.
- ${output}= Ping From Instance 40.0.0.2
- Should Contain ${output} 64 bytes
-
-Ping Metadata Server From Instance In network_2
- [Documentation] ping the metadata server from instance.
- Curl Metadata Server
+Connectivity Tests From Vm Instance2 In l2_network_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_network_2 @{NET_2_VM_IPS}[1] ${dst_ip_list}
-Delete Vm Instance
- [Documentation] Delete Vm instances using instance names.
- Delete Vm Instance MyFirstInstance_1
+Connectivity Tests From Vm Instance3 In l2_network_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{NET_2_VM_IPS}[0] @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1]
+ Log ${dst_ip_list}
+ Test Operations From Vm Instance l2_network_2 @{NET_2_VM_IPS}[2] ${dst_ip_list}
Ping All Vm Instances
[Documentation] Check reachability of vm instances by pinging to them.
- ${net_id}= Get Net Id network_1
+ ${net_id}= Get Net Id l2_network_1
: FOR ${VmIpElement} IN @{VM_IPS_NOT_DELETED}
\ ${output}= Ping Vm From DHCP Namespace ${net_id} ${VmIpElement}
\ Should Contain ${output} 64 bytes
No Ping For Deleted Vm
[Documentation] Check non reachability of deleted vm instances by pinging to them.
- ${output}= Ping Vm From DHCP Namespace ${net_id} 30.0.0.3
+ ${output}= Ping Vm From DHCP Namespace ${net_id} @{NET_1_VM_IPS}[0]
Should Contain ${output} Destination Host Unreachable
-Delete Vm Instances In network_1
- [Documentation] Delete Vm instances using instance names in network_1.
+Delete Vm Instances In l2_network_1
+ [Documentation] Delete Vm instances using instance names in l2_network_1.
: FOR ${VmElement} IN @{NET_1_VM_INSTANCES}
\ Delete Vm Instance ${VmElement}
-Delete Vm Instances In network_2
- [Documentation] Delete Vm instances using instance names in network_2.
+Delete Vm Instances In l2_network_2
+ [Documentation] Delete Vm instances using instance names in l2_network_2.
: FOR ${VmElement} IN @{NET_2_VM_INSTANCES}
\ Delete Vm Instance ${VmElement}
-Delete Sub Networks In network_1
+Delete Sub Networks In l2_network_1
[Documentation] Delete Sub Nets for the Networks with neutron request.
- Delete SubNet subnet_1
+ Delete SubNet l2_subnet_1
-Delete Sub Networks In network_2
+Delete Sub Networks In l2_network_2
[Documentation] Delete Sub Nets for the Networks with neutron request.
- Delete SubNet subnet_2
+ Delete SubNet l2_subnet_2
Delete Networks
[Documentation] Delete Networks with neutron request.
*** Settings ***
-Documentation Test suite to check connectivity in L3 using routers.
-Suite Setup Devstack Suite Setup Tests
-Library SSHLibrary
-Library OperatingSystem
-Library RequestsLibrary
-Resource ../../../libraries/Utils.robot
-Resource ../../../libraries/OpenStackOperations.robot
-Resource ../../../libraries/DevstackUtils.robot
+Documentation Test suite to check connectivity in L3 using routers.
+Suite Setup Devstack Suite Setup Tests
+Suite Teardown Close All Connections
+Library SSHLibrary
+Library OperatingSystem
+Library RequestsLibrary
+Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/OpenStackOperations.robot
+Resource ../../../libraries/DevstackUtils.robot
*** Variables ***
@{NETWORKS_NAME} network_1 network_2
@{SUBNETS_NAME} subnet_1 subnet_2
-@{NET_1_VM_INSTANCES} MyFirstInstance_1
-@{NET_2_VM_INSTANCES} MyFirstInstance_2
-@{NET_1_VM_IPS} 50.0.0.3
-@{NET_2_VM_IPS} 60.0.0.3
+@{NET_1_VM_INSTANCES} l3_instance_net_1_1 l3_instance_net_1_2 l3_instance_net_1_3
+@{NET_2_VM_INSTANCES} l3_instance_net_2_1 l3_instance_net_2_2 l3_instance_net_2_3
+@{NET_1_VM_IPS} 50.0.0.3 50.0.0.4 50.0.0.5
+@{NET_2_VM_IPS} 60.0.0.3 60.0.0.4 60.0.0.5
@{GATEWAY_IPS} 50.0.0.1 60.0.0.1
@{DHCP_IPS} 50.0.0.2 60.0.0.2
+@{SUBNETS_RANGE} 50.0.0.0/24 60.0.0.0/24
*** Test Cases ***
Create Networks
[Documentation] Create Network with neutron request.
: FOR ${NetworkElement} IN @{NETWORKS_NAME}
- \ Create Network ${NetworkElement} devstack_path=/opt/stack/devstack
+ \ Create Network ${NetworkElement}
Create Subnets For network_1
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet network_1 subnet_1 50.0.0.0/24
+ Create SubNet network_1 subnet_1 @{SUBNETS_RANGE}[0]
Create Subnets For network_2
[Documentation] Create Sub Nets for the Networks with neutron request.
- Create SubNet network_2 subnet_2 60.0.0.0/24
+ Create SubNet network_2 subnet_2 @{SUBNETS_RANGE}[1]
Create Vm Instances For network_1
[Documentation] Create Four Vm instances using flavor and image names for a network.
- ${net_id}= Get Net Id network_1
- Create Vm Instances ${net_id} ${NET_1_VM_INSTANCES}
+ Create Vm Instances network_1 ${NET_1_VM_INSTANCES}
[Teardown] Show Debugs ${NET_1_VM_INSTANCES}
Create Vm Instances For network_2
[Documentation] Create Four Vm instances using flavor and image names for a network.
- ${net_id}= Get Net Id network_2
- Create Vm Instances ${net_id} ${NET_2_VM_INSTANCES}
+ Create Vm Instances network_2 ${NET_2_VM_INSTANCES}
[Teardown] Show Debugs ${NET_2_VM_INSTANCES}
Create Routers
: FOR ${interface} IN @{SUBNETS_NAME}
\ Add Router Interface router_1 ${interface}
-Ping Vm Instance In network_2 From network_1
+Ping Vm Instance1 In network_2 From network_1
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- ${net_id}= Get Net Id network_1
- ${output} Ping Vm From DHCP Namespace ${net_id} 60.0.0.3
- Should Contain ${output} 64 bytes
+ Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[0]
-Ping Vm Instance In network_1 From network_2
+Ping Vm Instance2 In network_2 From network_1
[Documentation] Check reachability of vm instances by pinging to them after creating routers.
- ${net_id}= Get Net Id network_2
- ${output} Ping Vm From DHCP Namespace ${net_id} 50.0.0.3
- Should Contain ${output} 64 bytes
+ Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[1]
-Login to Vm Instances In network_1 Using Ssh
+Ping Vm Instance3 In network_2 From network_1
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace network_1 @{NET_2_VM_IPS}[2]
+
+Ping Vm Instance1 In network_1 From network_2
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[0]
+
+Ping Vm Instance2 In network_1 From network_2
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[1]
+
+Ping Vm Instance3 In network_1 From network_2
+ [Documentation] Check reachability of vm instances by pinging to them after creating routers.
+ Ping Vm From DHCP Namespace network_2 @{NET_1_VM_IPS}[2]
+
+Connectivity Tests From Vm Instance1 In network_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_1
[Documentation] Logging to the vm instance using generated key pair.
- ${net_id}= Get Net Id network_1
- Ssh Vm Instance ${net_id} 50.0.0.3
+ ${dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
-Ping Vm Instance From Instance In network_1
- [Documentation] Check reachability of vm instances by pinging.
- ${output}= Ping From Instance 60.0.0.3
- Should Contain ${output} 64 bytes
+Connectivity Tests From Vm Instance3 In network_1
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance network_1 @{NET_1_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
-Ping Dhcp Server In network_2 From Instance In network_1
- [Documentation] ping the dhcp server from instance.
- ${output}= Ping From Instance 60.0.0.2
- Should Contain ${output} 64 bytes
- Close Vm Instance
+Connectivity Tests From Vm Instance1 In network_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[1] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[0] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
+
+Connectivity Tests From Vm Instance2 In network_2
+ [Documentation] Logging to the vm instance using generated key pair.
+ ${dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[2]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[1] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
-Login to Vm Instances In network_2 Using Ssh
+Connectivity Tests From Vm Instance3 In network_2
[Documentation] Logging to the vm instance using generated key pair.
- ${net_id}= Get Net Id network_2
- Ssh Vm Instance ${net_id} 60.0.0.3
-
-Ping Vm Instance From Instance In network_2
- [Documentation] Check reachability of vm instances by pinging.
- ${output}= Ping From Instance 50.0.0.3
- Should Contain ${output} 64 bytes
-
-Ping Dhcp Server In network_1 From Instance In network_2
- [Documentation] ping the dhcp server from instance.
- ${output}= Ping From Instance 50.0.0.2
- Should Contain ${output} 64 bytes
- Close Vm Instance
+ ${dst_ip_list}= Create List @{DHCP_IPS}[1] @{NET_2_VM_IPS}[0] @{NET_2_VM_IPS}[1]
+ Log ${dst_ip_list}
+ ${other_dst_ip_list}= Create List @{DHCP_IPS}[0] @{NET_1_VM_IPS}[0] @{NET_1_VM_IPS}[1] @{NET_1_VM_IPS}[2]
+ Log ${other_dst_ip_list}
+ Test Operations From Vm Instance network_2 @{NET_2_VM_IPS}[2] ${dst_ip_list} l2_or_l3=l3 list_of_external_dst_ips=${other_dst_ip_list}
Delete Vm Instances In network_1
[Documentation] Delete Vm instances using instance names in network_1.
${output}= Write Commands Until Prompt nova flavor-list
Log ${output}
-Create Vm Instances
+Create Vm Instances For net1_network
[Documentation] Create Vm instances using flavor and image names.
- : FOR ${NetworkElement} IN @{NETWORKS_NAME}
- \ ${net_id}= Get Net Id ${NetworkElement}
- \ Create Vm Instance ${net_id} ${NetworkElement}
+ ${net_id}= Get Net Id net1_network
+ Create Vm Instances ${net_id} ${VM_INSTANCES_NAME}
+
+Create Vm Instances For net2_network
+ [Documentation] Create Vm instances using flavor and image names.
+ ${net_id}= Get Net Id net2_network
+ Create Vm Instances ${net_id} ${VM_INSTANCES_NAME}
Show Details of Created Vm Instance
[Documentation] View Details of the created vm instances using nova show.
integration/test/csit/suites/openstack/connectivity/
+integration/test/csit/suites/openstack/clustering/
+
# Neutron
NEUTRON_NB_API = '/controller/nb/v2/neutron'
+NEUTRON_NETWORKS_API = NEUTRON_NB_API + '/' + 'networks'
+NEUTRON_ROUTERS_API = NEUTRON_NB_API + '/' + 'routers'
+OSREST = '/v2.0/networks'
+KARAF_HOME = '${WORKSPACE}${/}${BUNDLEFOLDER}'
+
+# Openstack System Prompt
+OS_SYSTEM_PROMPT = '$'
# Other global variables
# TODO: Move these to more apropriate sections.