From 4634d5bdc188c5ef1edc72cc185ebf61ec8912ae Mon Sep 17 00:00:00 2001 From: Sam Hague Date: Wed, 13 Dec 2017 18:26:53 -0500 Subject: [PATCH] cleanup connections Change-Id: I34ac6b55fcad6136a5f9ca51b87ba5ff662cded9 Signed-off-by: Sam Hague --- csit/libraries/DevstackUtils.robot | 42 +++--- csit/libraries/L2GatewayOperations.robot | 18 +-- csit/libraries/OpenStackOperations.robot | 137 ++++++------------ csit/libraries/VpnOperations.robot | 4 - .../l2gw/01_Configure_verify_l2gateway.robot | 126 +++++++++++++--- csit/suites/l2gw/__init__.robot | 113 --------------- csit/suites/netvirt/elan/elan.robot | 14 +- .../netvirt/vpnservice/arp_learning.robot | 7 +- csit/suites/netvirt/vpnservice/bgp.robot | 11 +- .../suites/netvirt/vpnservice/vpn_basic.robot | 22 +-- .../netvirt/vpnservice/vpn_basic_ipv6.robot | 26 ++-- csit/suites/openstack/clustering/ha_l2.robot | 3 +- csit/suites/openstack/clustering/ha_l3.robot | 2 +- .../connectivity/external_network.robot | 3 +- csit/suites/openstack/connectivity/l2.robot | 3 +- csit/suites/openstack/connectivity/l3.robot | 3 +- .../connectivity/security_group.robot | 3 +- csit/suites/openstack/extensions/sfc.robot | 3 +- .../neutron_security_group.robot | 17 +-- csit/suites/openstack/tempest/tempest.robot | 2 +- 20 files changed, 230 insertions(+), 329 deletions(-) delete mode 100644 csit/suites/l2gw/__init__.robot diff --git a/csit/libraries/DevstackUtils.robot b/csit/libraries/DevstackUtils.robot index 2d317d342d..eace9b6e8b 100644 --- a/csit/libraries/DevstackUtils.robot +++ b/csit/libraries/DevstackUtils.robot @@ -29,17 +29,20 @@ ${external_subnet_name} external-subnet ${external_gateway} 10.10.10.250 ${external_subnet_allocation_pool} start=10.10.10.2,end=10.10.10.249 ${external_subnet} 10.10.10.0/24 -${default_timeout} 420s +${TEMPEST_TIMEOUT} 420s +${OS_CNTL_CONN_ID} None +${OS_CMP1_CONN_ID} None +${OS_CMP2_CONN_ID} None *** Keywords *** Run Tempest Tests - [Arguments] ${tempest_regex} ${timeout}=${default_timeout} ${debug}=False + [Arguments] ${tempest_regex} ${timeout}=${TEMPEST_TIMEOUT} ${debug}=False Run Keyword If "${debug}"=="False" Run Tempest Tests Without Debug ${tempest_regex} timeout=${timeout} Run Keyword If "${debug}"=="True" Run Tempest Tests With Debug ${tempest_regex} timeout=${timeout} Run Keyword If "${debug}"!="True" and "${debug}"!="False" Fail debug argument must be True or False Run Tempest Tests Without Debug - [Arguments] ${tempest_regex} ${tempest_directory}=${tempest_dir} ${timeout}=${default_timeout} + [Arguments] ${tempest_regex} ${tempest_directory}=${tempest_dir} ${timeout}=${TEMPEST_TIMEOUT} [Documentation] Using ostestr will allow us to (by default) run tests in paralllel. ... Because of the parallel fashion, we must ensure there is no pause on teardown so that flag in tempest.conf is ... explicitly set to False. @@ -61,7 +64,7 @@ Run Tempest Tests Without Debug Should Contain ${output} Failed: 0 Run Tempest Tests With Debug - [Arguments] ${tempest_regex} ${tempest_directory}=${tempest_dir} ${timeout}=${default_timeout} + [Arguments] ${tempest_regex} ${tempest_directory}=${tempest_dir} ${timeout}=${TEMPEST_TIMEOUT} [Documentation] After setting pause_teardown=True in tempest.conf, use the python -m testtools.run module to execute ... a single tempest test case. We need to run only one tempest test case at a time as there will ... be potentional for an unkown number of debug pdb() prompts to catch and continue if we are running multiple @@ -91,15 +94,15 @@ Run Tempest Tests With Debug Should Contain ${output} OK Should Not Contain ${output} FAILED +Suite Setup + OpenStackOperations.OpenStack Suite Setup + Log In To Tempest Executor And Setup Test Environment + Log In To Tempest Executor And Setup Test Environment [Documentation] Initialize SetupUtils, open SSH connection to a devstack system and source the openstack ... credentials needed to run the tempest tests. The (sometimes empty) tempest blacklist file will be created ... and pushed to the tempest executor. Create Blacklist File - SetupUtils.Setup_Utils_For_Setup_And_Teardown - # source_pwd is expected to exist in the below Create Network, Create Subnet keywords. Might be a bug. - ${source_pwd} Set Variable yes - Set Suite Variable ${source_pwd} # Tempest tests need an existing external network in order to create routers. Create Network ${external_net_name} --external --default --provider-network-type flat --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} Create Subnet ${external_net_name} ${external_subnet_name} ${external_subnet} --gateway ${external_gateway} --allocation-pool ${external_subnet_allocation_pool} @@ -108,7 +111,7 @@ Log In To Tempest Executor And Setup Test Environment SSHKeywords.Flexible SSH Login ${OS_USER} Write Commands Until Prompt source ${DEVSTACK_DEPLOY_PATH}/openrc admin admin Write Commands Until Prompt sudo rm -rf /opt/stack/tempest/.testrepository - ${net_id}= Get Net Id ${external_net_name} ${control_node_conn_id} + ${net_id}= Get Net Id ${external_net_name} Tempest Conf Add External Network And Floating Network Name ${net_id} Tempest Conf Add External Network And Floating Network Name @@ -145,16 +148,21 @@ Create Blacklist File Log File ${blacklist_file} SSHKeywords.Copy File To Remote System ${OS_CONTROL_NODE_IP} ${blacklist_file} ${blacklist_file} +Open Connection + [Arguments] ${name} ${ip} + ${conn_id} = SSHLibrary.Open Connection ${ip} prompt=${DEFAULT_LINUX_PROMPT} + SSHKeywords.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD} + BuiltIn.Set Suite Variable \${${name}} ${conn_id} + [Return] ${conn_id} + Devstack Suite Setup - [Arguments] ${source_pwd}=no ${odl_ip}=${ODL_SYSTEM_IP} - [Documentation] Login to the Openstack Control Node to run tempest suite + [Arguments] ${odl_ip}=${ODL_SYSTEM_IP} + [Documentation] Open connections to the nodes Create Session session http://${odl_ip}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} - ${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} - SSHKeywords.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD} - SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout} + SSHLibrary.Set Default Configuration timeout=${default_devstack_prompt_timeout} + Run Keyword If 0 < ${NUM_OS_SYSTEM} Open Connection OS_CNTL_CONN_ID ${OS_CONTROL_NODE_IP} + Run Keyword If 1 < ${NUM_OS_SYSTEM} Open Connection OS_CMP1_CONN_ID ${OS_COMPUTE_1_IP} + Run Keyword If 2 < ${NUM_OS_SYSTEM} Open Connection OS_CMP2_CONN_ID ${OS_COMPUTE_2_IP} Write Commands Until Prompt [Arguments] ${cmd} ${timeout}=${default_devstack_prompt_timeout} diff --git a/csit/libraries/L2GatewayOperations.robot b/csit/libraries/L2GatewayOperations.robot index 245912de6b..d7490cc2c8 100644 --- a/csit/libraries/L2GatewayOperations.robot +++ b/csit/libraries/L2GatewayOperations.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation L2Gateway Operations Library. This library has useful keywords for various actions on Hwvtep and Ovs connectivity. Most of the keywords expects that ovs_conn_id,ovs2_conn_id, hwvtep_conn_id, hwvtep2_conn_id and devstack_conn_id are available. +Documentation L2Gateway Operations Library. This library has useful keywords for various actions on Hwvtep and Ovs connectivity. Most of the keywords expects that ovs_conn_id,ovs2_conn_id, hwvtep_conn_id, hwvtep2_conn_id and OS_CNTL_CONN_ID are available. Library SSHLibrary Library Collections Library RequestsLibrary @@ -17,7 +17,7 @@ ${L2GW_VAR_BASE} ${CURDIR}/../variables/l2gw *** Keywords *** Add Ovs Bridge Manager Controller And Verify - [Arguments] ${conn_id}=${ovs_conn_id} ${hwvtep_bridge}=${HWVTEP_BRIDGE} + [Arguments] ${conn_id}=${OS_CMP1_CONN_ID} ${hwvtep_bridge}=${HWVTEP_BRIDGE} [Documentation] Keyword to set OVS manager and controller to ${ODL_IP} for the OVS IP connected in ${conn_id} and verify the entries in OVSDB NETWORK TOPOLOGY and NETSTAT results. ${output}= Exec Command ${conn_id} ${OVS_RESTART} ${output}= Exec Command ${conn_id} ${OVS_DEL_MGR} @@ -76,7 +76,7 @@ Create Verify L2Gateway Delete L2Gateway [Arguments] ${gw_name} [Documentation] Keyword to delete the L2 Gateway ${gw_name} received in argument. - ${output}= Exec Command ${devstack_conn_id} ${L2GW_DELETE} ${gw_name} + ${output}= Exec Command ${OS_CNTL_CONN_ID} ${L2GW_DELETE} ${gw_name} Log ${output} @{list_to_check}= Create List ${gw_name} Utils.Check For Elements Not At URI ${L2GW_LIST_REST_URL} ${list_to_check} session @@ -98,7 +98,7 @@ Delete L2Gateway Connection [Arguments] ${gw_name} [Documentation] Delete the L2 Gateway connection existing for Gateway ${gw_name} received in argument (Using Neutron CLI). ${l2gw_conn_id}= OpenStackOperations.Get L2gw Connection Id ${gw_name} - ${output}= Exec Command ${devstack_conn_id} ${L2GW_CONN_DELETE} ${l2gw_conn_id} + ${output}= Exec Command ${OS_CNTL_CONN_ID} ${L2GW_CONN_DELETE} ${l2gw_conn_id} @{list_to_check}= Create List ${l2gw_conn_id} Utils.Check For Elements Not At URI ${L2GW_CONN_LIST_REST_URL} ${list_to_check} session Log ${output} @@ -106,7 +106,7 @@ Delete L2Gateway Connection Update Port For Hwvtep [Arguments] ${port_name} [Documentation] Keyword to update the Neutron Ports for specific configuration required to connect to HWVTEP (Using REST). - ${port_id}= Get Port Id ${port_name} ${devstack_conn_id} + ${port_id}= Get Port Id ${port_name} Log ${port_id} ${json_data}= Get Neutron Port Rest ${port_id} Should Contain ${json_data} ${STR_VIF_TYPE} @@ -182,9 +182,9 @@ Get L2gw Debug Info Log ${resp.content} ${resp} = RequestsLibrary.Get Request session ${OPERATIONAL_API}/network-topology:network-topology/topology/hwvtep:1 Log ${resp.content} - Exec Command ${devstack_conn_id} cat /etc/neutron/neutron.conf - Exec Command ${devstack_conn_id} cat /etc/neutron/l2gw_plugin.ini - Exec Command ${devstack_conn_id} ps -ef | grep neutron-server + Exec Command ${OS_CNTL_CONN_ID} cat /etc/neutron/neutron.conf + Exec Command ${OS_CNTL_CONN_ID} cat /etc/neutron/l2gw_plugin.ini + Exec Command ${OS_CNTL_CONN_ID} ps -ef | grep neutron-server Start Command In Hwvtep [Arguments] ${command} ${hwvtep_ip} @@ -226,7 +226,7 @@ Verify Ovs Tunnel ${output}= Exec Command ${conn_id} ${OVS_SHOW} Log ${output} Should Contain ${output} key="${seg_id}", remote_ip="${ovs_ip}" - ${output}= Exec Command ${ovs_conn_id} ${OVS_SHOW} + ${output}= Exec Command ${OS_CMP1_CONN_ID} ${OVS_SHOW} Log ${output} Should Contain ${output} key=flow, local_ip="${ovs_ip}", remote_ip="${hwvtep_ip}" diff --git a/csit/libraries/OpenStackOperations.robot b/csit/libraries/OpenStackOperations.robot index 48b14b75ef..98aa245473 100644 --- a/csit/libraries/OpenStackOperations.robot +++ b/csit/libraries/OpenStackOperations.robot @@ -1,13 +1,15 @@ *** Settings *** Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances Library Collections -Library SSHLibrary Library OperatingSystem Library RequestsLibrary +Library SSHLibrary Resource DataModels.robot -Resource Utils.robot -Resource SSHKeywords.robot +Resource DevstackUtils.robot Resource L2GatewayOperations.robot +Resource SetupUtils.robot +Resource SSHKeywords.robot +Resource Utils.robot Resource ../variables/Variables.robot Resource ../variables/netvirt/Variables.robot Variables ../variables/netvirt/Modules.py @@ -209,7 +211,7 @@ Delete Vm Instance Log ${output} Get Net Id - [Arguments] ${network_name} ${devstack_conn_id} + [Arguments] ${network_name} [Documentation] Retrieve the net id for the given network name to create specific vm instance ${rc} ${output}= Run And Return Rc And Output openstack network list | grep "${network_name}" | awk '{print $2}' Should Be True '${rc}' == '0' @@ -218,7 +220,7 @@ Get Net Id [Return] ${net_id} Get Subnet Id - [Arguments] ${subnet_name} ${devstack_conn_id} + [Arguments] ${subnet_name} [Documentation] Retrieve the subnet id for the given subnet name ${rc} ${output}= Run And Return Rc And Output openstack subnet show "${subnet_name}" | grep " id " | awk '{print $4}' Should Be True '${rc}' == '0' @@ -227,7 +229,7 @@ Get Subnet Id [Return] ${subnet_id} Get Port Id - [Arguments] ${port_name} ${devstack_conn_id} + [Arguments] ${port_name} [Documentation] Retrieve the port id for the given port name to attach specific vm instance to a particular port ${rc} ${output}= Run And Return Rc And Output openstack port list | grep "${port_name}" | awk '{print $2}' Should Be True '${rc}' == '0' @@ -236,7 +238,7 @@ Get Port Id [Return] ${port_id} Get Router Id - [Arguments] ${router1} ${devstack_conn_id} + [Arguments] ${router1} [Documentation] Retrieve the router id for the given router name ${rc} ${output}= Run And Return Rc And Output openstack router list -f table | grep "${router1}" | awk '{print $2}' Should Be True '${rc}' == '0' @@ -249,7 +251,7 @@ Create Vm Instances ... ${max}=1 [Documentation] Create X Vm Instance with the net id of the Netowrk. ${image} Set Variable If "${image}"=="${EMPTY}" ${CIRROS_${OPENSTACK_BRANCH}} ${image} - ${net_id}= Get Net Id ${net_name} ${devstack_conn_id} + ${net_id}= Get Net Id ${net_name} : FOR ${VmElement} IN @{vm_instance_names} \ ${rc} ${output}= Run And Return Rc And Output openstack server create --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${VmElement} --security-group ${sg} --min ${min} --max ${max} \ Should Be True '${rc}' == '0' @@ -259,7 +261,7 @@ Create Vm Instance With Port [Arguments] ${port_name} ${vm_instance_name} ${image}=${EMPTY} ${flavor}=m1.nano ${sg}=default [Documentation] Create One VM instance using given ${port_name} and for given ${compute_node} ${image} Set Variable If "${image}"=="${EMPTY}" ${CIRROS_${OPENSTACK_BRANCH}} ${image} - ${port_id}= Get Port Id ${port_name} ${devstack_conn_id} + ${port_id}= Get Port Id ${port_name} ${rc} ${output}= Run And Return Rc And Output openstack server create --image ${image} --flavor ${flavor} --nic port-id=${port_id} ${vm_instance_name} --security-group ${sg} Log ${output} @@ -267,8 +269,8 @@ Create Vm Instance With Ports [Arguments] ${port_name} ${port2_name} ${vm_instance_name} ${image}=${EMPTY} ${flavor}=m1.nano ${sg}=default [Documentation] Create One VM instance using given ${port_name} and for given ${compute_node} ${image} Set Variable If "${image}"=="${EMPTY}" ${CIRROS_${OPENSTACK_BRANCH}} ${image} - ${port_id}= Get Port Id ${port_name} ${devstack_conn_id} - ${port2_id}= Get Port Id ${port2_name} ${devstack_conn_id} + ${port_id}= Get Port Id ${port_name} + ${port2_id}= Get Port Id ${port2_name} ${rc} ${output}= Run And Return Rc And Output openstack server create --image ${image} --flavor ${flavor} --nic port-id=${port_id} --nic port-id=${port2_id} ${vm_instance_name} --security-group ${sg} Log ${output} Should Be True '${rc}' == '0' @@ -277,7 +279,7 @@ Create Vm Instance With Port On Compute Node [Arguments] ${port_name} ${vm_instance_name} ${compute_node} ${image}=${EMPTY} ${flavor}=m1.nano ${sg}=default [Documentation] Create One VM instance using given ${port_name} and for given ${compute_node} ${image} Set Variable If "${image}"=="${EMPTY}" ${CIRROS_${OPENSTACK_BRANCH}} ${image} - ${port_id}= Get Port Id ${port_name} ${devstack_conn_id} + ${port_id}= Get Port Id ${port_name} ${hostname_compute_node}= Get Hypervisor Hostname From IP ${compute_node} ${rc} ${output}= Run And Return Rc And Output openstack server create --image ${image} --flavor ${flavor} --nic port-id=${port_id} --security-group ${sg} --availability-zone nova:${hostname_compute_node} ${vm_instance_name} Log ${output} @@ -420,46 +422,27 @@ View Vm Console Ping Vm From DHCP Namespace [Arguments] ${net_name} ${vm_ip} [Documentation] Reach all Vm Instance with the net id of the Netowrk. - Log ${vm_ip} - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} - ${net_id}= Get Net Id ${net_name} ${devstack_conn_id} - Log ${net_id} + Get ControlNode Connection + ${net_id}= Get Net Id ${net_name} ${output}= Write Commands Until Prompt And Log sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip} 20s - Close Connection Should Contain ${output} 64 bytes Ping From DHCP Should Not Succeed [Arguments] ${net_name} ${vm_ip} [Documentation] Should Not Reach Vm Instance with the net id of the Netowrk. Return From Keyword If "skip_if_${SECURITY_GROUP_MODE}" in @{TEST_TAGS} - Log ${vm_ip} - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} - ${net_id}= Get Net Id ${net_name} ${devstack_conn_id} - Log ${net_id} - ${output}= Write Commands Until Prompt sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip} 20s - Close Connection - Log ${output} + Get ControlNode Connection + ${net_id}= Get Net Id ${net_name} + ${output}= Write Commands Until Prompt And Log sudo ip netns exec qdhcp-${net_id} ping -c 3 ${vm_ip} 20s Should Not Contain ${output} 64 bytes Ping Vm From Control Node [Arguments] ${vm_floating_ip} ${additional_args}=${EMPTY} [Documentation] Ping VM floating IP from control node - Log ${vm_floating_ip} - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection ${output}= Write Commands Until Prompt And Log ping ${additional_args} -c 3 ${vm_floating_ip} 20s - Close Connection Should Contain ${output} 64 bytes -Ping From Instance - [Arguments] ${dest_vm_ip} - [Documentation] Ping to the expected destination ip. - ${output}= Write Commands Until Expected Prompt ping -c 3 ${dest_vm_ip} ${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 ${OS_SYSTEM_PROMPT} @@ -480,7 +463,6 @@ 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 - Close Connection Check Ping [Arguments] ${ip_address} ${ttl}=64 @@ -504,14 +486,10 @@ Check Metadata Access Execute Command on VM Instance [Arguments] ${net_name} ${vm_ip} ${cmd} ${user}=cirros ${password}=cubswin:) [Documentation] Login to the vm instance using ssh in the network, executes a command inside the VM and returns the ouput. - ${devstack_conn_id} = Get ControlNode Connection - Switch Connection ${devstack_conn_id} - ${net_id} = Get Net Id ${net_name} ${devstack_conn_id} - Log ${vm_ip} + Get ControlNode Connection + ${net_id} = Get Net Id ${net_name} ${output} = Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh ${user}@${vm_ip} -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null password: - Log ${output} ${output} = Write Commands Until Expected Prompt ${password} ${OS_SYSTEM_PROMPT} - Log ${output} ${rcode} = Run Keyword And Return Status Check If Console Is VmInstance ${output} = Run Keyword If ${rcode} Write Commands Until Expected Prompt ${cmd} ${OS_SYSTEM_PROMPT} [Teardown] Exit From Vm Console @@ -521,14 +499,10 @@ Test Operations From Vm Instance [Arguments] ${net_name} ${src_ip} ${dest_ips} ${user}=cirros ${password}=cubswin:) ${ttl}=64 ... ${ping_should_succeed}=True ${check_metadata}=True [Documentation] Login to the vm instance using ssh in the network. - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} - Log ${src_ip} - ${net_id}= Get Net Id ${net_name} ${devstack_conn_id} + Get ControlNode Connection + ${net_id}= Get Net Id ${net_name} ${output}= Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no ${user}@${src_ip} -o UserKnownHostsFile=/dev/null password: - Log ${output} ${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 -n ${OS_SYSTEM_PROMPT} @@ -536,7 +510,6 @@ Test Operations From Vm Instance Run Keyword If ${rcode} Write Commands Until Expected Prompt arp -an ${OS_SYSTEM_PROMPT} Run Keyword If ${rcode} Write Commands Until Expected Prompt ip -f inet6 neigh show ${OS_SYSTEM_PROMPT} : FOR ${dest_ip} IN @{dest_ips} - \ Log ${dest_ip} \ ${string_empty}= Run Keyword And Return Status Should Be Empty ${dest_ip} \ Run Keyword If ${string_empty} Continue For Loop \ Run Keyword If ${rcode} and "${ping_should_succeed}" == "True" Check Ping ${dest_ip} ttl=${ttl} @@ -551,13 +524,10 @@ Test Netcat Operations From Vm Instance [Documentation] Use Netcat to test TCP/UDP connections to the controller ${client_data} Set Variable Test Client Data ${server_data} Set Variable Test Server Data - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} - Log ${vm_ip} + Get ControlNode Connection ${output}= Write Commands Until Prompt And Log ( ( echo "${server_data}" | sudo timeout 60 nc -l ${additional_args} ${port} ) & ) ${output}= Write Commands Until Prompt And Log sudo netstat -nlap | grep ${port} ${nc_output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo echo "${client_data}" | nc -v -w 5 ${additional_args} ${dest_ip} ${port} - Log ${nc_output} ${output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo route -n Log ${output} ${output}= Execute Command on VM Instance ${net_name} ${vm_ip} sudo arp -an @@ -569,7 +539,6 @@ Ping Other Instances [Documentation] Check reachability with other network's instances. ${rcode}= Run Keyword And Return Status Check If Console Is VmInstance : FOR ${dest_ip} IN @{list_of_external_dst_ips} - \ Log ${dest_ip} \ Check Ping ${dest_ip} Create Router @@ -634,12 +603,9 @@ Delete Router Should Be True '${rc}' == '0' Get DumpFlows And Ovsconfig - [Arguments] ${openstack_node_ip} + [Arguments] ${conn_id} [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} - SSHKeywords.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD} - SSHLibrary.Set Client Configuration timeout=${default_devstack_prompt_timeout} + SSHLibrary.Switch Connection ${conn_id} Write Commands Until Expected Prompt ip -o link ${DEFAULT_LINUX_PROMPT_STRICT} Write Commands Until Expected Prompt ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT} Write Commands Until Expected Prompt ip route ${DEFAULT_LINUX_PROMPT_STRICT} @@ -679,16 +645,14 @@ Get Karaf Log Events From Test Start Run Keyword If 2 < ${NUM_ODL_SYSTEM} Get Karaf Log Types From Test Start ${ODL_SYSTEM_3_IP} ${test_name} ${log_types} Get ControlNode Connection - ${control_conn_id}= SSHLibrary.Open Connection ${OS_CONTROL_NODE_IP} prompt=${DEFAULT_LINUX_PROMPT_STRICT} - SSHKeywords.Flexible SSH Login ${OS_USER} ${DEVSTACK_SYSTEM_PASSWORD} - SSHLibrary.Set Client Configuration timeout=30s - [Return] ${control_conn_id} + SSHLibrary.Switch Connection ${OS_CNTL_CONN_ID} + [Return] ${OS_CNTL_CONN_ID} 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} + Run Keyword If 0 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_CNTL_CONN_ID} + Run Keyword If 1 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_CMP1_CONN_ID} + Run Keyword If 2 < ${NUM_OS_SYSTEM} Get DumpFlows And Ovsconfig ${OS_CMP2_CONN_ID} Get Test Teardown Debugs [Arguments] ${test_name}=${TEST_NAME} @@ -703,10 +667,8 @@ Get Test Teardown Debugs For SFC Show Debugs [Arguments] @{vm_indices} [Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection ${output}= Write Commands Until Prompt And Log sudo ip netns list - Close Connection : FOR ${index} IN @{vm_indices} \ ${rc} ${output}= Run And Return Rc And Output nova show ${index} \ Log ${output} @@ -744,8 +706,7 @@ Neutron Port Show Neutron Security Group Create [Arguments] ${SecurityGroupName} ${additional_args}=${EMPTY} [Documentation] Create a security group with specified name ,description & protocol value according to security group template - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection ${rc} ${output}= Run And Return Rc And Output openstack security group create ${SecurityGroupName} ${additional_args} Log ${output} Should Be True '${rc}' == '0' @@ -882,7 +843,7 @@ Get Ports MacAddr [Documentation] Retrieve the port MacAddr for the given list of port name and return the MAC address list. ${MacAddr-list} Create List : FOR ${portName} IN @{portName_list} - \ ${macAddr}= OpenStackOperations.Get Port Mac ${portName} ${devstack_conn_id} + \ ${macAddr}= OpenStackOperations.Get Port Mac ${portName} \ Append To List ${MacAddr-list} ${macAddr} [Return] ${MacAddr-list} @@ -896,7 +857,7 @@ Get Port Ip [Return] ${port_ip} Get Port Mac - [Arguments] ${port_name} ${conn_id}=${devstack_conn_id} + [Arguments] ${port_name} [Documentation] Keyword would return the MAC ID of the ${port_name} received. ${rc} ${output}= Run And Return Rc And Output openstack port show ${port_name} | grep mac_address | awk '{print $4}' ${splitted_output}= Split String ${output} ${EMPTY} @@ -1005,10 +966,8 @@ Add Security Group To VM Remove Security Group From VM [Arguments] ${vm} ${sg} [Documentation] Remove the security group provided to the given VM. - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection ${output}= Write Commands Until Prompt And Log openstack server remove security group ${vm} ${sg} - Close Connection Create SFC Flow Classifier [Arguments] ${name} ${src_ip} ${dest_ip} ${protocol} ${dest_port} ${neutron_src_port} @@ -1022,8 +981,7 @@ Create SFC Flow Classifier Delete SFC Flow Classifier [Arguments] ${name} [Documentation] Delete a SFC flow classifier - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection ${rc} ${output}= Run And Return Rc And Output openstack sfc flow classifier delete ${name} Log ${output} Should Be True '${rc}' == '0' @@ -1032,8 +990,7 @@ Delete SFC Flow Classifier Create SFC Port Pair [Arguments] ${name} ${port_in} ${port_out} [Documentation] Creates a neutron port pair for SFC - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection ${rc} ${output}= Run And Return Rc And Output openstack sfc port pair create --ingress=${port_in} --egress=${port_out} ${name} Log ${output} Should Be True '${rc}' == '0' @@ -1069,7 +1026,7 @@ Create SFC Port Pair Group With Two Pairs Delete SFC Port Pair Group [Arguments] ${name} [Documentation] Delete a SFC port pair group - ${devstack_conn_id}= Get ControlNode Connection + Get ControlNode Connection ${rc} ${output}= Run And Return Rc And Output openstack sfc port pair group delete ${name} Log ${output} Should Be True '${rc}' == '0' @@ -1103,8 +1060,7 @@ Reboot Nova VM Remove RSA Key From KnownHosts [Arguments] ${vm_ip} [Documentation] Remove RSA - ${devstack_conn_id}= Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection ${output}= Write Commands Until Prompt And Log sudo cat /root/.ssh/known_hosts 30s ${output}= Write Commands Until Prompt And Log sudo ssh-keygen -f "/root/.ssh/known_hosts" -R ${vm_ip} 30s ${output}= Write Commands Until Prompt sudo cat "/root/.ssh/known_hosts" 30s @@ -1112,10 +1068,9 @@ Remove RSA Key From KnownHosts Wait For Routes To Propogate [Arguments] ${networks} ${subnets} [Documentation] Check propagated routes - ${devstack_conn_id} = Get ControlNode Connection - Switch Connection ${devstack_conn_id} + Get ControlNode Connection : FOR ${INDEX} IN RANGE 0 1 - \ ${net_id}= Get Net Id @{networks}[${INDEX}] ${devstack_conn_id} + \ ${net_id}= Get Net Id @{networks}[${INDEX}] \ ${is_ipv6}= Get Regexp Matches @{subnets}[${INDEX}] ${IP6_REGEX} \ ${length}= Get Length ${is_ipv6} \ ${cmd}= Set Variable If ${length} == 0 ip route ip -6 route @@ -1192,6 +1147,11 @@ Cleanup Router \ BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_interface" BuiltIn.Run Keyword And Ignore Error Remove Interface ${id} ${subnet_id} BuiltIn.Run Keyword And Ignore Error Delete Router ${id} +OpenStack Suite Setup + [Documentation] Wrapper teardown keyword that can be used in any suite running in an openstack environement + SetupUtils.Setup_Utils_For_Setup_And_Teardown + DevstackUtils.Devstack Suite Setup + OpenStack Suite Teardown [Documentation] Wrapper teardown keyword that can be used in any suite running in an openstack environement ... to clean up all openstack resources. For example, all instances, networks, ports, etc will be listed and @@ -1208,7 +1168,6 @@ Copy DHCP Files From Control Node OperatingSystem.Create Directory ${dstdir} Get ControlNode Connection BuiltIn.Run Keyword And Ignore Error SSHLibrary.Get Directory /opt/stack/data/neutron/dhcp ${dstdir} recursive=True - SSHLibrary.Close Connection Is Feature Installed [Arguments] ${features}=none diff --git a/csit/libraries/VpnOperations.robot b/csit/libraries/VpnOperations.robot index a55cde03c9..04f3afd348 100644 --- a/csit/libraries/VpnOperations.robot +++ b/csit/libraries/VpnOperations.robot @@ -22,10 +22,6 @@ ${STATE_ENABLE} ENABLED ${STATE_DISABLE} DISABLE *** Keywords *** -Basic Vpnservice Suite Setup - SetupUtils.Setup_Utils_For_Setup_And_Teardown - DevstackUtils.Devstack Suite Setup - Basic Vpnservice Suite Cleanup [Arguments] ${vpn_instance_ids}=@{EMPTY} ${vms}=@{EMPTY} ${networks}=@{EMPTY} ${subnets}=@{EMPTY} ${ports}=@{EMPTY} ${sgs}=@{EMPTY} : FOR ${vpn_instance_id} IN @{vpn_instance_ids} diff --git a/csit/suites/l2gw/01_Configure_verify_l2gateway.robot b/csit/suites/l2gw/01_Configure_verify_l2gateway.robot index 0677ec66ab..d9c5293b0f 100644 --- a/csit/suites/l2gw/01_Configure_verify_l2gateway.robot +++ b/csit/suites/l2gw/01_Configure_verify_l2gateway.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Test Suite for verification of HWVTEP usecases -Suite Setup BuiltIn.Run Keywords Basic Suite Setup +Suite Setup Basic Suite Setup Suite Teardown Basic Suite Teardown Test Teardown Get L2gw Debug Info Resource ../../libraries/L2GatewayOperations.robot @@ -141,34 +141,112 @@ TC99 Cleanup L2Gateway Connection Itm Tunnel Port Subnet And Network *** Keywords *** Basic Suite Setup [Documentation] Basic Suite Setup required for the HWVTEP Test Suite - RequestsLibrary.Create Session alias=session url=http://${ODL_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} - ${devstack_conn_id}= SSHLibrary.Open Connection ${OS_IP} prompt=${DEFAULT_LINUX_PROMPT} - Log ${devstack_conn_id} - Set Suite Variable ${devstack_conn_id} - Log ${OS_IP} - Log ${OS_USER} - Log ${OS_PASSWORD} - Wait Until Keyword Succeeds 30s 5s Flexible SSH Login ${OS_USER} ${OS_PASSWORD} + OpenStackOperations.OpenStack Suite Setup + OpenStackOperations.Get ControlNode Connection Write Commands Until Prompt cd ${DEVSTACK_DEPLOY_PATH}; source openrc admin admin 30s - ${hwvtep_conn_id}= SSHLibrary.Open Connection ${HWVTEP_IP} prompt=${DEFAULT_LINUX_PROMPT} - Log ${hwvtep_conn_id} - Set Suite Variable ${hwvtep_conn_id} - Log ${DEFAULT_USER} - Log ${DEFAULT_PASSWORD} - Wait Until Keyword Succeeds 30s 5s Flexible SSH Login ${DEFAULT_USER} ${DEFAULT_PASSWORD} - ${ovs_conn_id}= SSHLibrary.Open Connection ${OVS_IP} prompt=${DEFAULT_LINUX_PROMPT} - Log ${ovs_conn_id} - Set Suite Variable ${ovs_conn_id} - Wait Until Keyword Succeeds 30s 5s Flexible SSH Login ${DEFAULT_USER} ${DEFAULT_PASSWORD} ${port_mac_list}= Create List Set Suite Variable ${port_mac_list} ${port_ip_list}= Create List Set Suite Variable ${port_ip_list} + Start Suite Basic Suite Teardown - Switch Connection ${devstack_conn_id} - close connection + Stop Suite + OpenStackOperations.OpenStack Suite Teardown + +Start Suite + [Documentation] Suite Setup to configure HWVTEP Emulator for L2 Gateway Testcase Verification. + ${hwvtep_conn_id}= Create And Set Hwvtep Connection Id ${HWVTEP_IP} + Set Suite Variable ${hwvtep_conn_id} + Hwvtep Cleanup ${hwvtep_conn_id} ${HWVTEP_BRIDGE} + Namespace Cleanup + Hwvtep Initiate ${hwvtep_conn_id} ${HWVTEP_IP} ${HWVTEP_BRIDGE} + Namespace Intiate Hwvtep1 + Wait Until Keyword Succeeds 30s 1s Hwvtep Validation + +Stop Suite + [Documentation] Stop Suite to cleanup Hwvtep configuration + Hwvtep Cleanup ${hwvtep_conn_id} ${HWVTEP_BRIDGE} + Namespace Cleanup + +Hwvtep Cleanup + [Arguments] ${conn_id} ${hwvtep_bridge} + [Documentation] Cleanup any existing VTEP, VSWITCHD or OVSDB processes. + Switch Connection ${conn_id} + Write Commands Until Prompt ${DEL_OVS_BRIDGE} ${hwvtep_bridge} 30s + Write Commands Until Prompt ${KILL_VTEP_PROC} 30s + Write Commands Until Prompt ${KILL_VSWITCHD_PROC} 30s + Write Commands Until Prompt ${KILL_OVSDB_PROC} 30s + ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s + Log ${stdout} + Write Commands Until Prompt ${REM_OVSDB} 30s + Write Commands Until Prompt ${REM_VTEPDB} 30s + +Namespace Cleanup + [Documentation] Cleanup the existing namespaces and ports. + Switch Connection ${hwvtep_conn_id} + ${stdout}= Write Commands Until Prompt ${IP_LINK} 30s + Log ${stdout} + Write Commands Until Prompt ${IP_LINK_DEL} ${NS_PORT1} 30s + Write Commands Until Prompt ${IP_LINK_DEL} ${NS_PORT2} 30s + ${stdout}= Write Commands Until Prompt ${NETNS} 30s + Log ${stdout} + Write Commands Until Prompt ${NETNS_DEL} ${HWVTEP_NS1} 30s + Write Commands Until Prompt ${NETNS_DEL} ${HWVTEP_NS2} 30s + ${stdout}= Write Commands Until Prompt ${IP_LINK} 30s + Log ${stdout} + +Hwvtep Initiate + [Arguments] ${conn_id} ${hwvtep_ip} ${hwvtep_bridge} + [Documentation] Configure the Hwvtep Emulation + Switch Connection ${conn_id} + Write Commands Until Prompt ${CREATE_OVSDB} 30s + Write Commands Until Prompt ${CREATE VTEP} 30s + Write Commands Until Prompt ${START_OVSDB_SERVER} 30s + ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s + Log ${stdout} + Write Commands Until Prompt ${INIT_VSCTL} 30s + Write Commands Until Prompt ${DETACH_VSWITCHD} 30s + Write Commands Until Prompt ${CREATE_OVS_BRIDGE} ${hwvtep_bridge} 30s + ${stdout}= Write Commands Until Prompt ${OVS_SHOW} 30s + Log ${stdout} + Write Commands Until Prompt ${ADD_VTEP_PS} ${hwvtep_bridge} 30s + Write Commands Until Prompt ${SET_VTEP_PS} ${hwvtep_bridge} tunnel_ips=${hwvtep_ip} 30s + Write Commands Until Prompt ${START_OVSVTEP} ${hwvtep_bridge} 30s + ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s + Log ${stdout} + +Namespace Intiate Hwvtep1 + [Documentation] Create and configure the namespace, bridges and ports. + Switch Connection ${hwvtep_conn_id} + Create Configure Namespace ${HWVTEP_NS1} ${NS_PORT1} ${NS_TAP1} ${HWVTEP_BRIDGE} + Create Configure Namespace ${HWVTEP_NS2} ${NS_PORT2} ${NS2_TAP1} ${HWVTEP_BRIDGE} + +Create Configure Namespace + [Arguments] ${ns_name} ${ns_port_name} ${tap_port_name} ${hwvtep_bridge} + Write Commands Until Prompt ${NETNS_ADD} ${ns_name} 30s + Write Commands Until Prompt ${IP_LINK_ADD} ${tap_port_name} type veth peer name ${ns_port_name} 30s + Write Commands Until Prompt ${CREATE_OVS_PORT} ${hwvtep_bridge} ${ns_port_name} 30s + Write Commands Until Prompt ${IP_LINK_SET} ${tap_port_name} netns ${ns_name} 30s + Write Commands Until Prompt ${NETNS_EXEC} ${ns_name} ${IPLINK_SET} ${tap_port_name} up 30s + Write Commands Until Prompt sudo ${IPLINK_SET} ${ns_port_name} up 30s + ${stdout}= Write Commands Until Prompt ${NETNS_EXEC} ${ns_name} ${IFCONF} 30s + Log ${stdout} + +Hwvtep Validation + [Documentation] Initial validation of the Hwvtep Configuration to confirm Phyisical_Switch table entries Switch Connection ${hwvtep_conn_id} - close connection - Switch Connection ${ovs_conn_id} - close connection + ${stdout}= Write Commands Until Prompt ${VTEP LIST} ${PHYSICAL_SWITCH_TABLE} 30s + Should Contain ${stdout} ${HWVTEP_BRIDGE} + Should Contain ${stdout} ${HWVTEP_IP} + ${stdout}= Write Commands Until Prompt ${VTEP LIST} ${PHYSICAL_PORT_TABLE} 30s + Should Contain ${stdout} ${NS_PORT1} + Should Contain ${stdout} ${NS_PORT2} + +Create And Set Hwvtep Connection Id + [Arguments] ${hwvtep_ip} + [Documentation] To create connection and return connection id for hwvtep_ip received + ${conn_id}= SSHLibrary.Open Connection ${hwvtep_ip} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s + Log ${conn_id} + Flexible SSH Login ${DEFAULT_USER} ${DEFAULT_PASSWORD} + [Return] ${conn_id} diff --git a/csit/suites/l2gw/__init__.robot b/csit/suites/l2gw/__init__.robot deleted file mode 100644 index f32e088a78..0000000000 --- a/csit/suites/l2gw/__init__.robot +++ /dev/null @@ -1,113 +0,0 @@ -*** Settings *** -Documentation Test suite for HWVTEP Setup -Suite Setup Start Suite -Suite Teardown Stop Suite -Library SSHLibrary -Library Collections -Resource ../../variables/Variables.robot -Resource ../../libraries/Utils.robot -Resource ../../libraries/DevstackUtils.robot -Resource ../../libraries/KarafKeywords.robot -Resource ../../variables/l2gw/Variables.robot - -*** Variables *** - -*** Keywords *** -Start Suite - [Documentation] Suite Setup to configure HWVTEP Emulator for L2 Gateway Testcase Verification. - ${hwvtep_conn_id}= Create And Set Hwvtep Connection Id ${HWVTEP_IP} - Set Suite Variable ${hwvtep_conn_id} - Hwvtep Cleanup ${hwvtep_conn_id} ${HWVTEP_BRIDGE} - Namespace Cleanup - Hwvtep Initiate ${hwvtep_conn_id} ${HWVTEP_IP} ${HWVTEP_BRIDGE} - Namespace Intiate Hwvtep1 - Wait Until Keyword Succeeds 30s 1s Hwvtep Validation - -Stop Suite - [Documentation] Stop Suite to cleanup Hwvtep configuration - Hwvtep Cleanup ${hwvtep_conn_id} ${HWVTEP_BRIDGE} - Namespace Cleanup - Switch Connection ${hwvtep_conn_id} - Close Connection - -Hwvtep Cleanup - [Arguments] ${conn_id} ${hwvtep_bridge} - [Documentation] Cleanup any existing VTEP, VSWITCHD or OVSDB processes. - Switch Connection ${conn_id} - Write Commands Until Prompt ${DEL_OVS_BRIDGE} ${hwvtep_bridge} 30s - Write Commands Until Prompt ${KILL_VTEP_PROC} 30s - Write Commands Until Prompt ${KILL_VSWITCHD_PROC} 30s - Write Commands Until Prompt ${KILL_OVSDB_PROC} 30s - ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s - Log ${stdout} - Write Commands Until Prompt ${REM_OVSDB} 30s - Write Commands Until Prompt ${REM_VTEPDB} 30s - -Namespace Cleanup - [Documentation] Cleanup the existing namespaces and ports. - Switch Connection ${hwvtep_conn_id} - ${stdout}= Write Commands Until Prompt ${IP_LINK} 30s - Log ${stdout} - Write Commands Until Prompt ${IP_LINK_DEL} ${NS_PORT1} 30s - Write Commands Until Prompt ${IP_LINK_DEL} ${NS_PORT2} 30s - ${stdout}= Write Commands Until Prompt ${NETNS} 30s - Log ${stdout} - Write Commands Until Prompt ${NETNS_DEL} ${HWVTEP_NS1} 30s - Write Commands Until Prompt ${NETNS_DEL} ${HWVTEP_NS2} 30s - ${stdout}= Write Commands Until Prompt ${IP_LINK} 30s - Log ${stdout} - -Hwvtep Initiate - [Arguments] ${conn_id} ${hwvtep_ip} ${hwvtep_bridge} - [Documentation] Configure the Hwvtep Emulation - Switch Connection ${conn_id} - Write Commands Until Prompt ${CREATE_OVSDB} 30s - Write Commands Until Prompt ${CREATE VTEP} 30s - Write Commands Until Prompt ${START_OVSDB_SERVER} 30s - ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s - Log ${stdout} - Write Commands Until Prompt ${INIT_VSCTL} 30s - Write Commands Until Prompt ${DETACH_VSWITCHD} 30s - Write Commands Until Prompt ${CREATE_OVS_BRIDGE} ${hwvtep_bridge} 30s - ${stdout}= Write Commands Until Prompt ${OVS_SHOW} 30s - Log ${stdout} - Write Commands Until Prompt ${ADD_VTEP_PS} ${hwvtep_bridge} 30s - Write Commands Until Prompt ${SET_VTEP_PS} ${hwvtep_bridge} tunnel_ips=${hwvtep_ip} 30s - Write Commands Until Prompt ${START_OVSVTEP} ${hwvtep_bridge} 30s - ${stdout}= Write Commands Until Prompt ${GREP_OVS} 30s - Log ${stdout} - -Namespace Intiate Hwvtep1 - [Documentation] Create and configure the namespace, bridges and ports. - Switch Connection ${hwvtep_conn_id} - Create Configure Namespace ${HWVTEP_NS1} ${NS_PORT1} ${NS_TAP1} ${HWVTEP_BRIDGE} - Create Configure Namespace ${HWVTEP_NS2} ${NS_PORT2} ${NS2_TAP1} ${HWVTEP_BRIDGE} - -Create Configure Namespace - [Arguments] ${ns_name} ${ns_port_name} ${tap_port_name} ${hwvtep_bridge} - Write Commands Until Prompt ${NETNS_ADD} ${ns_name} 30s - Write Commands Until Prompt ${IP_LINK_ADD} ${tap_port_name} type veth peer name ${ns_port_name} 30s - Write Commands Until Prompt ${CREATE_OVS_PORT} ${hwvtep_bridge} ${ns_port_name} 30s - Write Commands Until Prompt ${IP_LINK_SET} ${tap_port_name} netns ${ns_name} 30s - Write Commands Until Prompt ${NETNS_EXEC} ${ns_name} ${IPLINK_SET} ${tap_port_name} up 30s - Write Commands Until Prompt sudo ${IPLINK_SET} ${ns_port_name} up 30s - ${stdout}= Write Commands Until Prompt ${NETNS_EXEC} ${ns_name} ${IFCONF} 30s - Log ${stdout} - -Hwvtep Validation - [Documentation] Initial validation of the Hwvtep Configuration to confirm Phyisical_Switch table entries - Switch Connection ${hwvtep_conn_id} - ${stdout}= Write Commands Until Prompt ${VTEP LIST} ${PHYSICAL_SWITCH_TABLE} 30s - Should Contain ${stdout} ${HWVTEP_BRIDGE} - Should Contain ${stdout} ${HWVTEP_IP} - ${stdout}= Write Commands Until Prompt ${VTEP LIST} ${PHYSICAL_PORT_TABLE} 30s - Should Contain ${stdout} ${NS_PORT1} - Should Contain ${stdout} ${NS_PORT2} - -Create And Set Hwvtep Connection Id - [Arguments] ${hwvtep_ip} - [Documentation] To create connection and return connection id for hwvtep_ip received - ${conn_id}= SSHLibrary.Open Connection ${hwvtep_ip} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s - Log ${conn_id} - Flexible SSH Login ${DEFAULT_USER} ${DEFAULT_PASSWORD} - [Return] ${conn_id} diff --git a/csit/suites/netvirt/elan/elan.robot b/csit/suites/netvirt/elan/elan.robot index 0a20b9e0a4..8304ee424a 100644 --- a/csit/suites/netvirt/elan/elan.robot +++ b/csit/suites/netvirt/elan/elan.robot @@ -2,10 +2,8 @@ Documentation Test suite to validate elan service functionality in ODL environment. ... The assumption of this suite is that the environment is already configured with the proper ... integration bridges and vxlan tunnels. -Suite Setup BuiltIn.Run Keywords OpenStackOperations.Get OvsDebugInfo -... AND Elan SuiteSetup -... AND OpenStackOperations.Get OvsDebugInfo -Suite Teardown Elan SuiteTeardown +Suite Setup Elan Suite Setup +Suite Teardown Elan Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs Library OperatingSystem @@ -127,15 +125,13 @@ Verify Datapath for Multiple ELAN with Multiple DPN ... AND MultipleElan Testsuite Cleanup *** Keywords *** -Elan SuiteSetup +Elan Suite Setup [Documentation] Elan suite setup - SetupUtils.Setup_Utils_For_Setup_And_Teardown + OpenStackOperations.OpenStack Suite Setup KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set DEBUG org.opendaylight.genius.mdsalutil.internal.MDSALManager - DevstackUtils.Devstack Suite Setup -Elan SuiteTeardown +Elan Suite Teardown [Documentation] Elan suite teardown - OpenStackOperations.Get OvsDebugInfo KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set INFO org.opendaylight.genius.mdsalutil.internal.MDSALManager OpenStackOperations.OpenStack Suite Teardown diff --git a/csit/suites/netvirt/vpnservice/arp_learning.robot b/csit/suites/netvirt/vpnservice/arp_learning.robot index c7bda529ac..dcd31b6c00 100644 --- a/csit/suites/netvirt/vpnservice/arp_learning.robot +++ b/csit/suites/netvirt/vpnservice/arp_learning.robot @@ -145,8 +145,7 @@ Cleanup *** Keywords *** Start Suite [Documentation] Run at start of the suite - DevstackUtils.Devstack Suite Setup - SetupUtils.Setup_Utils_For_Setup_And_Teardown + OpenStackOperations.OpenStack Suite Setup Create Setup Create Setup @@ -177,7 +176,7 @@ Create Setup OpenStackOperations.Create Router ${ROUTERS} OpenStackOperations.Add Router Interface ${ROUTERS} @{SUBNETS}[1] OpenStackOperations.Add Router Interface ${ROUTERS} @{SUBNETS}[2] - ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} + ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] BuiltIn.Set Suite Variable ${net_id} ${tenant_id} = OpenStackOperations.Get Tenant ID From Network ${net_id} BuiltIn.Set Suite Variable ${tenant_id} @@ -187,7 +186,7 @@ Create Setup VpnOperations.Associate L3VPN To Network networkid=${net_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${net_id} - ${router_id} = OpenStackOperations.Get Router Id ${ROUTERS} ${devstack_conn_id} + ${router_id} = OpenStackOperations.Get Router Id ${ROUTERS} BuiltIn.Set Suite Variable ${router_id} VpnOperations.Associate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] diff --git a/csit/suites/netvirt/vpnservice/bgp.robot b/csit/suites/netvirt/vpnservice/bgp.robot index 5f01760577..46477b1327 100644 --- a/csit/suites/netvirt/vpnservice/bgp.robot +++ b/csit/suites/netvirt/vpnservice/bgp.robot @@ -96,8 +96,7 @@ Delete BGP Config On DCGW *** Keywords *** BGP Vpnservice Suite Setup - SetupUtils.Setup_Utils_For_Setup_And_Teardown - DevstackUtils.Devstack Suite Setup + OpenStackOperations.OpenStack Suite Setup OpenStackOperations.Create And Configure Security Group ${SECURITY_GROUP} BgpOperations.Start Quagga Processes On ODL ${ODL_SYSTEM_IP} BgpOperations.Start Quagga Processes On DCGW ${DCGW_SYSTEM_IP} @@ -106,7 +105,7 @@ BGP Vpnservice Suite Setup BGP Vpnservice Suite Teardown BgpOperations.Delete Basic Configuartion for BGP VPNservice Suite OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP} - SSHLibrary.Close All Connections + OpenStackOperations.OpenStack Suite Teardown Create Basic Configuartion for BGP VPNservice Suite [Documentation] Create basic configuration for BGP VPNservice suite @@ -129,11 +128,11 @@ Create Basic Configuartion for BGP VPNservice Suite BuiltIn.Set Suite Variable @{VM_IPS} BuiltIn.Should Not Contain ${VM_IPS} None BuiltIn.Should Not Contain ${DHCP_IPS} None - ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} + ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${tenant_id} = OpenStackOperations.Get Tenant ID From Network ${net_id} VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RD_LIST}[0] exportrt=@{RD_LIST}[0] importrt=@{RD_LIST}[0] tenantid=${tenant_id} : FOR ${network} IN @{NETWORKS} - \ ${network_id} = Get Net Id ${network} ${devstack_conn_id} + \ ${network_id} = Get Net Id ${network} \ VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Log ${resp} @@ -141,7 +140,7 @@ Create Basic Configuartion for BGP VPNservice Suite Delete Basic Configuartion for BGP VPNservice Suite [Documentation] Delete basic configuration for BGP Vpnservice suite : FOR ${network} IN @{NETWORKS} - \ ${network_id} = OpenStackOperations.Get Net Id ${network} ${devstack_conn_id} + \ ${network_id} = OpenStackOperations.Get Net Id ${network} \ VpnOperations.Dissociate L3VPN From Networks networkid=${network_id} vpnid=@{VPN_INSTANCE_IDS}[0] VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] : FOR ${vm} IN @{VM_NAMES} diff --git a/csit/suites/netvirt/vpnservice/vpn_basic.robot b/csit/suites/netvirt/vpnservice/vpn_basic.robot index 11dacb99aa..74cc846749 100644 --- a/csit/suites/netvirt/vpnservice/vpn_basic.robot +++ b/csit/suites/netvirt/vpnservice/vpn_basic.robot @@ -2,7 +2,7 @@ Documentation Test suite to validate vpnservice functionality in an openstack integrated environment. ... The assumption of this suite is that the environment is already configured with the proper ... integration bridges and vxlan tunnels. -Suite Setup VpnOperations.Basic Vpnservice Suite Setup +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs @@ -165,7 +165,7 @@ Delete And Recreate Extra Route ... AND OpenStackOperations.Get Test Teardown Debugs Create L3VPN - ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} + ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${tenant_id} = OpenStackOperations.Get Tenant ID From Network ${net_id} BuiltIn.Log @{RDS}[0] VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RDS}[0] exportrt=@{RDS}[0] importrt=@{RDS}[0] tenantid=${tenant_id} @@ -173,7 +173,7 @@ Create L3VPN BuiltIn.Should Contain ${resp} @{VPN_INSTANCE_IDS}[0] Associate L3VPN To Routers - ${router_id} = OpenStackOperations.Get Router Id ${ROUTER} ${devstack_conn_id} + ${router_id} = OpenStackOperations.Get Router Id ${ROUTER} VpnOperations.Associate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${router_id} @@ -196,13 +196,13 @@ Verify L3VPN Datapath With Router Association OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{NET_2_VM_IPS}[0] ${dst_ip_list} Disassociate L3VPN From Router - ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} ${devstack_conn_id} + ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} VpnOperations.Dissociate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp}= VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Not Contain ${resp} ${router_id} Delete Router And Router Interfaces With L3VPN - ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} ${devstack_conn_id} + ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} VpnOperations.Associate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${router_id} @@ -210,7 +210,7 @@ Delete Router And Router Interfaces With L3VPN \ OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} : FOR ${INTERFACE} IN @{SUBNETS} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} ${devstack_conn_id} + \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} \ BuiltIn.Should Not Contain ${interface_output} ${subnet_id} Delete Router ${ROUTER} ${router_output} = OpenStackOperations.List Routers @@ -229,8 +229,8 @@ Delete Router With NonExistentRouter Name Associate L3VPN To Networks [Documentation] Associates L3VPN to networks and verify - ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} - ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] ${devstack_conn_id} + ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] + ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] VpnOperations.Associate L3VPN To Network networkid=${network1_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${network1_id} @@ -240,8 +240,8 @@ Associate L3VPN To Networks Dissociate L3VPN From Networks [Documentation] Dissociate L3VPN from networks - ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} - ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] ${devstack_conn_id} + ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] + ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] VpnOperations.Dissociate L3VPN From Networks networkid=${network1_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Not Contain ${resp} ${network1_id} @@ -255,7 +255,7 @@ Delete L3VPN Create Multiple L3VPN [Documentation] Creates three L3VPNs and then verify the same - ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} + ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${tenant_id} = OpenStackOperations.Get Tenant ID From Network ${net_id} VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RDS}[0] exportrt=@{RDS}[0] importrt=@{RDS}[0] tenantid=${tenant_id} VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[1] name=@{VPN_NAMES}[1] rd=@{RDS}[1] exportrt=@{RDS}[1] importrt=@{RDS}[1] tenantid=${tenant_id} diff --git a/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot b/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot index 692c5a9bd7..10e58d6d86 100644 --- a/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot +++ b/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot @@ -2,9 +2,7 @@ Documentation Test suite to validate IPv6 vpnservice functionality in an Openstack integrated environment. ... The assumption of this suite is that the environment is already configured with the proper ... integration bridges and vxlan tunnels. -Suite Setup BuiltIn.Run Keywords OpenStackOperations.Get OvsDebugInfo -... AND VpnOperations.Basic Vpnservice Suite Setup -... AND OpenStackOperations.Get OvsDebugInfo +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs @@ -67,7 +65,7 @@ Add Interfaces To Router \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} : FOR ${interface} IN @{SUBNETS} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${interface} ${devstack_conn_id} + \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${interface} \ BuiltIn.Should Contain ${interface_output} ${subnet_id} ${GWMAC_ADDRS} ${GWIP_ADDRS} = VpnOperations.Get Gateway MAC And IP Address ${ROUTER} ${IP6_REGEX} BuiltIn.Set Suite Variable ${GWMAC_ADDRS} @@ -184,14 +182,14 @@ Delete And Recreate Extra Route ... AND OpenStackOperations.Get Test Teardown Debugs Create L3VPN - ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} + ${net_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${tenant_id} = OpenStackOperations.Get Tenant ID From Network ${net_id} VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RDS}[0] exportrt=@{RDS}[0] importrt=@{RDS}[0] tenantid=${tenant_id} ${resp}= VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} @{VPN_INSTANCE_IDS}[0] Associate L3VPN To Routers - ${router_id} = OpenStackOperations.Get Router Id ${ROUTER} ${devstack_conn_id} + ${router_id} = OpenStackOperations.Get Router Id ${ROUTER} VpnOperations.Associate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp}= VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${router_id} @@ -215,13 +213,13 @@ Verify L3VPN Datapath With Router Association OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[1] @{VM_IP_NET20}[0] ${dst_ip_list} Dissociate L3VPN From Routers - ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} ${devstack_conn_id} + ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} VpnOperations.Dissociate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp}= VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Not Contain ${resp} ${router_id} Delete Router And Router Interfaces With L3VPN - ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} ${devstack_conn_id} + ${router_id}= OpenStackOperations.Get Router Id ${ROUTER} VpnOperations.Associate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${router_id} @@ -229,7 +227,7 @@ Delete Router And Router Interfaces With L3VPN \ OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} : FOR ${INTERFACE} IN @{SUBNETS} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} ${devstack_conn_id} + \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} \ BuiltIn.Should Not Contain ${interface_output} ${subnet_id} OpenStackOperations.Delete Router ${ROUTER} ${router_output} = OpenStackOperations.List Routers @@ -246,8 +244,8 @@ Delete Router With NonExistentRouter Name BuiltIn.Should Match Regexp ${output} Unable to find router with name or id 'nonExistentRouter'|Unable to find router\\(s\\) with id\\(s\\) 'nonExistentRouter' Associate L3VPN To Networks - ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} - ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] ${devstack_conn_id} + ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] + ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] VpnOperations.Associate L3VPN To Network networkid=${network1_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${network1_id} @@ -256,8 +254,8 @@ Associate L3VPN To Networks BuiltIn.Should Contain ${resp} ${network2_id} Dissociate L3VPN From Networks - ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] ${devstack_conn_id} - ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] ${devstack_conn_id} + ${network1_id} = OpenStackOperations.Get Net Id @{NETWORKS}[0] + ${network2_id} = OpenStackOperations.Get Net Id @{NETWORKS}[1] VpnOperations.Dissociate L3VPN From Networks networkid=${network1_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp}= VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Not Contain ${resp} ${network1_id} @@ -269,7 +267,7 @@ Delete L3VPN VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] Create Multiple L3VPN - ${net_id} = Get Net Id @{NETWORKS}[0] ${devstack_conn_id} + ${net_id} = Get Net Id @{NETWORKS}[0] ${tenant_id} = Get Tenant ID From Network ${net_id} VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RDS}[0] exportrt=@{RDS}[0] importrt=@{RDS}[0] tenantid=${tenant_id} VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[1] name=@{VPN_NAMES}[1] rd=@{RDS}[1] exportrt=@{RDS}[1] importrt=@{RDS}[1] tenantid=${tenant_id} diff --git a/csit/suites/openstack/clustering/ha_l2.robot b/csit/suites/openstack/clustering/ha_l2.robot index 68c1b57d0a..42520124da 100644 --- a/csit/suites/openstack/clustering/ha_l2.robot +++ b/csit/suites/openstack/clustering/ha_l2.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Test suite to verify packet flows between vm instances. -Suite Setup Devstack Suite Setup source_pwd=yes +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown Close All Connections Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs @@ -102,7 +102,6 @@ Take Down ODL2 Create Vm Instances For net_1 [Documentation] Create Vm instances using flavor and image names for a network. - BuiltIn.Log ${devstack_conn_id} OpenStackOperations.Create Vm Instances @{NETWORKS}[0] ${NET_1_VMS} sg=${SECURITY_GROUP} Create Vm Instances For net_2 diff --git a/csit/suites/openstack/clustering/ha_l3.robot b/csit/suites/openstack/clustering/ha_l3.robot index bf0935df25..ecaad95f18 100644 --- a/csit/suites/openstack/clustering/ha_l3.robot +++ b/csit/suites/openstack/clustering/ha_l3.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Test suite to check connectivity in L3 using routers. -Suite Setup Devstack Suite Setup source_pwd=yes +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown Close All Connections Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs diff --git a/csit/suites/openstack/connectivity/external_network.robot b/csit/suites/openstack/connectivity/external_network.robot index 40fe9e7f89..557b1882ac 100644 --- a/csit/suites/openstack/connectivity/external_network.robot +++ b/csit/suites/openstack/connectivity/external_network.robot @@ -1,7 +1,6 @@ *** Settings *** Documentation Test suite to check North-South connectivity in L3 using a router and an external network -Suite Setup BuiltIn.Run Keywords SetupUtils.Setup_Utils_For_Setup_And_Teardown -... AND DevstackUtils.Devstack Suite Setup +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs diff --git a/csit/suites/openstack/connectivity/l2.robot b/csit/suites/openstack/connectivity/l2.robot index c38eac350e..a23bde0946 100644 --- a/csit/suites/openstack/connectivity/l2.robot +++ b/csit/suites/openstack/connectivity/l2.robot @@ -1,7 +1,6 @@ *** Settings *** Documentation Test suite to verify packet flows between vm instances. -Suite Setup BuiltIn.Run Keywords SetupUtils.Setup_Utils_For_Setup_And_Teardown -... AND DevstackUtils.Devstack Suite Setup +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs diff --git a/csit/suites/openstack/connectivity/l3.robot b/csit/suites/openstack/connectivity/l3.robot index 437b90656e..8105acb856 100644 --- a/csit/suites/openstack/connectivity/l3.robot +++ b/csit/suites/openstack/connectivity/l3.robot @@ -1,7 +1,6 @@ *** Settings *** Documentation Test suite to check connectivity in L3 using routers. -Suite Setup BuiltIn.Run Keywords SetupUtils.Setup_Utils_For_Setup_And_Teardown -... AND DevstackUtils.Devstack Suite Setup +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs diff --git a/csit/suites/openstack/connectivity/security_group.robot b/csit/suites/openstack/connectivity/security_group.robot index c4c2cd7226..84f5d1fd25 100644 --- a/csit/suites/openstack/connectivity/security_group.robot +++ b/csit/suites/openstack/connectivity/security_group.robot @@ -3,8 +3,7 @@ Documentation Test suite to verify security groups basic and advanced functi ... These test cases are not so relevant for transparent mode, so each test case will be tagged with ... "skip_if_transparent" to allow any underlying keywords to return with a PASS without risking ... a false failure. The real value of this suite will be in stateful mode. -Suite Setup BuiltIn.Run Keywords SetupUtils.Setup_Utils_For_Setup_And_Teardown -... AND DevstackUtils.Devstack Suite Setup +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs diff --git a/csit/suites/openstack/extensions/sfc.robot b/csit/suites/openstack/extensions/sfc.robot index 9bf69fe7db..0634aa340c 100644 --- a/csit/suites/openstack/extensions/sfc.robot +++ b/csit/suites/openstack/extensions/sfc.robot @@ -1,7 +1,6 @@ *** Settings *** Documentation Test suite to verify SFC configuration and packet flows. -Suite Setup BuiltIn.Run Keywords SetupUtils.Setup_Utils_For_Setup_And_Teardown -... AND DevstackUtils.Devstack Suite Setup +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown BuiltIn.Run Keywords OpenStackOperations.Get Test Teardown Debugs diff --git a/csit/suites/openstack/securitygroup/neutron_security_group.robot b/csit/suites/openstack/securitygroup/neutron_security_group.robot index 6387cc1f73..876b2a44a7 100644 --- a/csit/suites/openstack/securitygroup/neutron_security_group.robot +++ b/csit/suites/openstack/securitygroup/neutron_security_group.robot @@ -1,7 +1,6 @@ *** Settings *** Documentation Test Suite for Neutron Security Group -Suite Setup BuiltIn.Run Keywords SetupUtils.Setup_Utils_For_Setup_And_Teardown -... AND DevstackUtils.Devstack Suite Setup +Suite Setup OpenStackOperations.OpenStack Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown OpenStackOperations.Get Test Teardown Debugs @@ -10,6 +9,7 @@ Library OperatingSystem Library RequestsLibrary Library json Resource ../../../libraries/DevstackUtils.robot +Resource ../../../libraries/OpenStackOperations.robot Resource ../../../libraries/SetupUtils.robot Resource ../../../variables/Variables.robot @@ -44,7 +44,6 @@ TC01_Update Security Group description and Name [Tags] Regression ${sg_id} = BuiltIn.Run Keyword Create Security Group and Validate ${SGS[0]} Create Security Rule and Validate ${SGS[0]} direction=${ADD_PARAMS[0]} ethertype=${ADD_PARAMS[1]} port_range_max=${ADD_PARAMS[3]} port_range_min=${ADD_PARAMS[2]} protocol=${ADD_PARAMS[4]} - Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} Neutron Setup Creation ${NETWORKS[0]} ${SUBNETS[0]} ${IP_SUBNETS[0]} ${PORTS[0]} ${PORTS[1]} ${SECURITY_GROUPS} ... ${sg_id} Security group verification on Neutron port ${PORTS[0]} ${sg_id} @@ -56,32 +55,21 @@ TC02_Create Security Rule with port_range_min > port_range_max [Documentation] This test case validates the security group and rule creation with optional parameters Create Security Rule with port_range_min greater than port_range_max [Tags] Regression Create Security Group and Validate ${SGS[1]} - Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} Neutron Rule Creation With Invalid Parameters ${SGS[1]} ${ADD_ARG_SSH5} ${PORT_RANGE_ERROR} TC03_Create Security Rule with port_range_min = -1 [Documentation] This test case validates the security group and rule creation with optional parameters, Create Security Rule with port_range_min = -1 [Tags] Regression Create Security Group and Validate ${SGS[2]} - Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} Neutron Rule Creation With Invalid Parameters ${SGS[2]} ${ADD_ARG_SSH6} ${INVALID_PORT_RANGE_MIN} TC04_Create Security Rule with port_range_max = -1 [Documentation] This test case validates the security group and rule creation with optional parameters, Create Security Rule with port_range_max = -1 [Tags] Regression Create Security Group and Validate ${SGS[3]} - Get Flows ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} Neutron Rule Creation With Invalid Parameters ${SGS[3]} ${ADD_ARG_SSH7} ${INVALID_PORT_RANGE_MIN} *** Keywords *** -Get Flows - [Arguments] ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP} - [Documentation] Get the Flows from DPN1 and DPN2 - ${resp} = Utils.Run Command On Remote System And Log ${OS_COMPUTE_1_IP} sudo ovs-ofctl dump-flows br-int -O OpenFlow13 - ${resp} = Utils.Run Command On Remote System And Log ${OS_COMPUTE_1_IP} sudo ovs-ofctl dump-groups br-int -OOpenflow13 - ${resp} = Utils.Run Command On Remote System And Log ${OS_COMPUTE_2_IP} sudo ovs-ofctl dump-flows br-int -O OpenFlow13 - ${resp} = Utils.Run Command On Remote System And Log ${OS_COMPUTE_2_IP} sudo ovs-ofctl dump-groups br-int -OOpenflow13 - Create Security Group and Validate [Arguments] ${sg_ssh} ${output} ${sg_id} = OpenStackOperations.Neutron Security Group Create ${sg_ssh} @@ -130,4 +118,3 @@ Neutron Rule Creation With Invalid Parameters ${rc} ${output} = OperatingSystem.Run And Return Rc And Output neutron security-group-rule-create ${sg_name} ${additional_args} BuiltIn.Log ${output} BuiltIn.Should Contain ${output} ${expected_error} - SSHLibrary.Close Connection diff --git a/csit/suites/openstack/tempest/tempest.robot b/csit/suites/openstack/tempest/tempest.robot index d0d1351967..b40360f19d 100644 --- a/csit/suites/openstack/tempest/tempest.robot +++ b/csit/suites/openstack/tempest/tempest.robot @@ -1,7 +1,7 @@ *** Settings *** Documentation Test suite for running tempest tests. It is assumed that the test environment ... is already deployed and ready. -Suite Setup DevstackUtils.Log In To Tempest Executor And Setup Test Environment +Suite Setup DevstackUtils.Suite Setup Suite Teardown OpenStackOperations.OpenStack Suite Teardown Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing Test Teardown BuiltIn.Run Keywords OpenStackOperations.Get Test Teardown Debugs -- 2.36.6