*** Keywords ***
Run Tempest Tests
[Arguments] ${tempest_regex} ${timeout}=600s
+ [Documentation] Execute the tempest tests
Write Commands Until Prompt cd /opt/stack/new/tempest
Write Commands Until Prompt sudo rm -rf /opt/stack/new/tempest/.testrepository
Write Commands Until Prompt sudo testr init
Should Contain ${results} Failed: 0
# 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}
+ Utils.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD}
+ SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
+
Devstack Suite Setup
+ [Documentation] Login to the Openstack Control Node to run tempest suite
SSHLibrary.Open Connection ${DEVSTACK_SYSTEM_IP} prompt=${DEFAULT_LINUX_PROMPT}
Utils.Flexible SSH Login ${DEVSTACK_SYSTEM_USER} ${DEVSTACK_SYSTEM_PASSWORD}
SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout}
[Return] ${output}
Get Networking ODL Version Of Release
+ [Documentation] Get version of ODL to be installed
[Arguments] ${version}
# once Beryllium SR1 goes out, we can change beryllium-latest to use 0.4.2
Return From Keyword If "${version}" == "beryllium-latest" beryllium-snapshot-0.4.2
Return From Keyword If "${version}" == "helium" helium
Show Devstack Debugs
+ [Documentation] Collect the devstack logs to debug in case of failure
Write Commands Until Prompt gunzip /opt/stack/logs/devstacklog.txt.gz
Write Commands Until Prompt tail -n2000 /opt/stack/logs/devstacklog.txt timeout=600s
Write Commands Until Prompt grep 'distribution-karaf.*zip' /opt/stack/logs/devstacklog.txt
*** Keywords ***
Create Network
- [Arguments] ${network_name}
+ [Arguments] ${network_name} ${devstack_path}=/opt/stack/new/devstack
[Documentation] Create Network with neutron request.
- ${output}= Write Commands Until Prompt cd /opt/stack/new/devstack && cat localrc
+ ${output}= Write Commands Until Prompt cd ${devstack_path} && cat localrc
Log ${output}
${output}= Write Commands Until Prompt source openrc admin admin
Log ${output}
Curl Metadata Server
[Documentation] Ping to the expected destination ip.
- ${output}= Write Commands Until Expected Prompt curl http://169.254.169.254 $
- Log ${output}
+ ${output}= Write Commands Until Expected Prompt curl -i http://169.254.169.254 $
+ Write Commands Until Prompt exit
+ Should Contain ${output} 200
Close Vm Instance
[Documentation] Exit the vm instance.
Log ${output}
Ssh Vm Instance
- [Arguments] ${net_id} ${vm_ip} ${user}=cirros ${password}=cubswin:)
+ [Arguments] ${net_id} ${vm_ip} ${user}=cirros ${password}=cubswin:) ${key_file}=test.pem
[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 test.pem ${user}@${vm_ip} (yes/no)?
+ ${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:
Log ${output}
Log ${output}
Create Router
+ [Arguments] ${router_name}
[Documentation] Create Router and Add Interface to the subnets.
- ${output}= Write Commands Until Prompt neutron -v router-create router_1
- Log ${output}
- : FOR ${SubnetElement} IN @{SUBNETS_NAME}
- \ ${output}= Write Commands Until Prompt neutron -v router-interface-add router_1 ${SubnetElement}
- Log ${output}
+ ${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}
+ ${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.
- : FOR ${SubnetElement} IN @{SUBNETS_NAME}
- \ ${output}= Write Commands Until Prompt neutron -v router-interface-delete router_1 ${SubnetElement}
- \ Log ${output}
+ ${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.
- ${output}= Write Commands Until Prompt neutron -v router-delete router_1
- Log ${output}
+ ${output}= Write Commands Until Prompt neutron -v router-delete ${router_name}
+ Should Contain ${output} Deleted router:
+
+Show Debugs
+ [Arguments] ${vm_indices}
+ [Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node
+ ${output}= Write Commands Until Prompt sudo ip netns list
+ Log ${output}
+ : FOR ${index} IN @{vm_indices}
+ \ ${output}= Write Commands Until Prompt nova show ${index}
+ \ Log ${output}
[Return] ${minutes}
Write Commands Until Expected Prompt
- [Arguments] ${cmd} ${prompt} ${timeout}=${DEFAULT_TIMEOUT}
+ [Arguments] ${cmd} ${prompt} ${timeout}=30s
[Documentation] quick wrapper for Write and Read Until Prompt Keywords to make test cases more readable
SSHLibrary.Set Client Configuration timeout=${timeout}
SSHLibrary.Write ${cmd}
--- /dev/null
+*** 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
+
+*** 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
+@{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
+
+*** Test Cases ***
+Create Networks
+ [Documentation] Create Network with neutron request.
+ : FOR ${NetworkElement} IN @{NETWORKS_NAME}
+ \ Create Network ${NetworkElement} devstack_path=/opt/stack/devstack
+
+Create Subnets For network_1
+ [Documentation] Create Sub Nets for the Networks with neutron request.
+ Create SubNet network_1 subnet_1 30.0.0.0/24
+
+Create Subnets For network_2
+ [Documentation] Create Sub Nets for the Networks with neutron request.
+ Create SubNet network_2 subnet_2 40.0.0.0/24
+
+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}
+ [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
+ Set Suite Variable ${net_id}
+ Create Vm Instances ${net_id} ${NET_2_VM_INSTANCES}
+ [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
+
+Ping All Vm Instances In 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 All Vm Instances In network_2
+ [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 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 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 Metadata Server From Instance In network_1
+ [Documentation] ping the metadata server from instance.
+ Curl Metadata Server
+
+Login to Vm Instances In network_2 Using Ssh
+ [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
+
+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
+
+Delete Vm Instance
+ [Documentation] Delete Vm instances using instance names.
+ Delete Vm Instance MyFirstInstance_1
+
+Ping All Vm Instances
+ [Documentation] Check reachability of vm instances by pinging to them.
+ ${net_id}= Get Net Id 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
+ 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 subnet_1
+
+Delete Sub Networks In network_2
+ [Documentation] Delete Sub Nets for the Networks with neutron request.
+ Delete SubNet subnet_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
+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
+@{GATEWAY_IPS} 50.0.0.1 60.0.0.1
+@{DHCP_IPS} 50.0.0.2 60.0.0.2
+
+*** Test Cases ***
+Create Networks
+ [Documentation] Create Network with neutron request.
+ : FOR ${NetworkElement} IN @{NETWORKS_NAME}
+ \ Create Network ${NetworkElement} devstack_path=/opt/stack/devstack
+
+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 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 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}
+ [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}
+ [Teardown] Show Debugs ${NET_2_VM_INSTANCES}
+
+Create Routers
+ [Documentation] Create Router
+ Create Router router_1
+
+Add Interfaces To Router
+ [Documentation] Add Interfaces
+ : FOR ${interface} IN @{SUBNETS_NAME}
+ \ Add Router Interface router_1 ${interface}
+
+Ping Vm Instance 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 Instance In network_1 From network_2
+ [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
+
+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} 50.0.0.3
+
+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
+
+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
+
+Login to Vm Instances In network_2 Using Ssh
+ [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
+
+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 Router Interfaces
+ [Documentation] Remove Interface to the subnets.
+ : FOR ${interface} IN @{SUBNETS_NAME}
+ \ Remove Interface router_1 ${interface}
+
+Delete Routers
+ [Documentation] Delete Router and Interface to the subnets.
+ Delete Router router_1
+
+Delete Sub Networks In network_1
+ [Documentation] Delete Sub Nets for the Networks with neutron request.
+ Delete SubNet subnet_1
+
+Delete Sub Networks In network_2
+ [Documentation] Delete Sub Nets for the Networks with neutron request.
+ Delete SubNet subnet_2
+
+Delete Networks
+ [Documentation] Delete Networks with neutron request.
+ : FOR ${NetworkElement} IN @{NETWORKS_NAME}
+ \ Delete Network ${NetworkElement}
Create Routers
[Documentation] Create Router and Add Interface to the subnets.
- Create Router
+ Create Router router_1
Verify Gateway Ip After Interface Added
[Documentation] Verify the existence of the gateway ips with the dump flow in Beryllium.
Delete Router Interfaces
[Documentation] Remove Interface to the subnets.
- Remove Interface
+ Remove Interface router_1
Delete Routers
[Documentation] Delete Router and Interface to the subnets.
- Delete Router
+ Delete Router router_1
Verify Deleted Routers
[Documentation] Verify Deleted Routers for the Networks with dump flow.
--- /dev/null
+integration/test/csit/suites/openstack/connectivity/
--- /dev/null
+integration/test/csit/suites/openstack/connectivity/
--- /dev/null
+integration/test/csit/suites/openstack/connectivity/01_l2_tests.robot