# to a library at some point, when/if other suites need to use it, so wanted to make it generic.
Write Commands Until Prompt sudo -E crudini --${modifier} ${config_file} ${config_section} ${config_key} ${config_value}
-Clean Up After Running Tempest
- [Documentation] Clean up any extra leftovers that were created to allow tempest tests to run.
- Delete Network ${external_net_name}
- List Networks
- Close All Connections
-
Create Blacklist File
[Documentation] For each exclusion regex in the required @{${OPENSTACK_BRANCH}_exclusion_regexes} list a new
... line will be created in the required ${blacklist_file} location. This file is pushed to the OS_CONTROL_NODE
Library Collections
Library SSHLibrary
Library OperatingSystem
+Library RequestsLibrary
Resource DataModels.robot
Resource Utils.robot
Resource SSHKeywords.robot
\ Should Be True '${rc}' == '0'
[Return] ${ip_list}
+Delete Floating IP
+ [Arguments] ${fip}
+ [Documentation] Delete floating ip with neutron request.
+ ${rc} ${output}= Run And Return Rc And Output openstack floating ip delete ${fip}
+ Log ${output}
+ Should Be True '${rc}' == '0'
+
Verify Gateway Ips
[Documentation] Verifies the Gateway Ips with dump flow.
${output}= Write Commands Until Prompt And Log sudo ovs-ofctl -O OpenFlow13 dump-flows br-int
[Documentation] Wrapper around Get Regexp Matches to return None if not found or the first match if found.
@{matches} = String.Get Regexp Matches ${text} ${regexp}
${matches_length} = Get Length ${matches}
- BuiltIn.Set Test Variable ${match} None
- BuiltIn.Run Keyword If ${matches_length} > ${index} BuiltIn.Set Test Variable ${match} @{matches}[${index}]
- [Return] ${match}
+ BuiltIn.Set Suite Variable ${OS_MATCH} None
+ BuiltIn.Run Keyword If ${matches_length} > ${index} BuiltIn.Set Suite Variable ${OS_MATCH} @{matches}[${index}]
+ [Return] ${OS_MATCH}
Get VM IP
[Arguments] ${fail_on_none} ${vm}
${rc} ${output}= Run And Return Rc And Output openstack router remove subnet ${router_name} ${interface_name}
Should Be True '${rc}' == '0'
+Remove Gateway
+ [Arguments] ${router_name}
+ [Documentation] Remove external gateway from the router.
+ BuiltIn.Log openstack router unset ${router_name} --external-gateway
+
Update Router
[Arguments] ${router_name} ${cmd}
[Documentation] Update the router with the command. Router name and command should be passed as argument.
[Arguments] ${router_name}
[Documentation] Delete Router and Interface to the subnets.
${rc} ${output}= Run And Return Rc And Output openstack router delete ${router_name}
+ Log ${output}
Should Be True '${rc}' == '0'
Get DumpFlows And Ovsconfig
\ BuiltIn.Run Keyword And Ignore Error Delete Network ${network}
: FOR ${sg} IN @{sgs}
\ BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${sg}
+
+OpenStack List All
+ [Documentation] Get a list of different OpenStack resources that might be in use.
+ @{modules} = BuiltIn.Create List floating ip server router port network
+ ... subnet security group security group rule
+ : FOR ${module} IN @{modules}
+ \ OpenStack CLI openstack ${module} list
+
+OpenStack CLI Get List
+ [Arguments] ${cmd}
+ [Documentation] Return a json list from the output of an OpenStack command.
+ ${json} = OpenStack CLI ${cmd}
+ @{list} = RequestsLibrary.To Json ${json}
+ BuiltIn.Log ${list}
+ [Return] @{list}
+
+OpenStack CLI
+ [Arguments] ${cmd}
+ [Documentation] Run the given OpenStack ${cmd}.
+ ${rc} ${output} = OperatingSystem.Run And Return Rc And Output ${cmd}
+ BuiltIn.Log ${output}
+ Should Be True '${rc}' == '0'
+ [Return] ${output}
+
+OpenStack Cleanup All
+ [Documentation] Cleanup all Openstack resources with best effort. The keyword will query for all resources
+ ... in use and then attempt to delete them. Errors are ignored to allow the cleanup to continue.
+ @{fips} = OpenStack CLI Get List openstack floating ip list -f json
+ : FOR ${fip} IN @{fips}
+ \ BuiltIn.Run Keyword And Ignore Error Delete Floating IP ${fip['ID']}
+ @{vms} = OpenStack CLI Get List openstack server list -f json
+ : FOR ${vm} IN @{vms}
+ \ BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm['ID']}
+ @{routers} = OpenStack CLI Get List openstack router list -f json
+ : FOR ${router} IN @{routers}
+ \ BuiltIn.Run Keyword And Ignore Error Cleanup Router ${router['ID']}
+ @{ports} = OpenStack CLI Get List openstack port list -f json
+ : FOR ${port} IN @{ports}
+ \ BuiltIn.Run Keyword And Ignore Error Delete Port ${port['ID']}
+ @{networks} = OpenStack CLI Get List openstack network list -f json
+ : FOR ${network} IN @{networks}
+ \ BuiltIn.Run Keyword And Ignore Error Delete Subnet ${network['Subnets']}
+ \ BuiltIn.Run Keyword And Ignore Error Delete Network ${network['ID']}
+ @{security_groups} = OpenStack CLI Get List openstack security group list -f json
+ : FOR ${security_group} IN @{security_groups}
+ \ BuiltIn.Run Keyword If "${security_group['Name']}" != "default" BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${security_group['ID']}
+ OpenStack List All
+
+Cleanup Router
+ [Arguments] ${id}
+ [Documentation] Delete a router, but first remove any interfaces or gateways so that the delete will be successful.
+ @{ports} = OpenStack CLI Get List openstack port list --router ${id} -f json --long
+ : FOR ${port} IN @{ports}
+ \ ${subnet_id} = Get Match ${port['Fixed IP Addresses']} [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} 0
+ \ BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_gateway" BuiltIn.Run Keyword And Ignore Error Remove Gateway ${id}
+ \ 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 Teardown
+ OpenStack Cleanup All
+ SSHLibrary.Close All Connections
[Documentation] Elan suite teardown
OpenStackOperations.Get OvsDebugInfo
KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set INFO org.opendaylight.genius.mdsalutil.internal.MDSALManager
- SingleElan SuiteTeardown
- SSHLibrary.Close All Connections
-
-SingleElan SuiteTeardown
- [Documentation] Delete network,subnet and port
- BuiltIn.Log Delete Neutron Ports, Subnet and network
- : FOR ${Port} IN @{NET_1_PORTS}
- \ OpenStackOperations.Delete Port ${Port}
- OpenStackOperations.Delete SubNet @{SUBNETS}[0]
- OpenStackOperations.Delete Network @{NETWORKS}[0]
- OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
-
-SingleElan SuiteSetup
- [Documentation] Create single ELAN with Multiple DPN
+ OpenStackOperations.OpenStack Suite Teardown
MultipleElan Testsuite Setup
[Documentation] Create additional ELAN for multipleElan with Multiple DPN test
... 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 Teardown SSHLibrary.Close All Connections
+Suite Teardown OpenStackOperations.OpenStack Suite Teardown
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown OpenStackOperations.Get Test Teardown Debugs
Library OperatingSystem
VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[0]
VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[1]
VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[2]
-
-Cleanup
- @{vms} = BuiltIn.Create List @{NET_1_VMS} @{NET_2_VMS}
- @{sgs} = BuiltIn.Create List ${SECURITY_GROUP}
- Basic Vpnservice Suite Cleanup ${VPN_INSTANCE_IDS} ${vms} ${NETWORKS} ${SUBNETS} ${PORTS} ${sgs}
Suite Setup BuiltIn.Run Keywords OpenStackOperations.Get OvsDebugInfo
... AND VpnOperations.Basic Vpnservice Suite Setup
... AND OpenStackOperations.Get OvsDebugInfo
-Suite Teardown SSHLibrary.Close All Connections
+Suite Teardown OpenStackOperations.OpenStack Suite Teardown
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown OpenStackOperations.Get Test Teardown Debugs
Library OperatingSystem
VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[0]
VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[1]
VpnOperations.VPN Delete L3VPN vpnid=@{VPN_INSTANCE_IDS}[2]
-
-Cleanup
- @{vms} = BuiltIn.Create List @{NET_1_VMS} @{NET_2_VMS}
- @{sgs} = BuiltIn.Create List ${SECURITY_GROUP}
- Basic Vpnservice Suite Cleanup ${VPN_INSTANCE_IDS} ${vms} ${NETWORKS} ${SUBNETS} ${PORTS} ${sgs}
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 Teardown Close All Connections
+Suite Teardown OpenStackOperations.OpenStack Suite Teardown
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown OpenStackOperations.Get Test Teardown Debugs
Library SSHLibrary
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 Teardown Close All Connections
+Suite Teardown OpenStackOperations.OpenStack Suite Teardown
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown OpenStackOperations.Get Test Teardown Debugs
Library SSHLibrary
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 Teardown Close All Connections
+Suite Teardown OpenStackOperations.OpenStack Suite Teardown
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown OpenStackOperations.Get Test Teardown Debugs
Library SSHLibrary
... 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 Teardown Suite Teardown
+Suite Teardown OpenStackOperations.OpenStack Suite Teardown
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown OpenStackOperations.Get Test Teardown Debugs
Force Tags skip_if_${SECURITY_GROUP_MODE}
Delete Security Groups
OpenStackOperations.Delete SecurityGroup additional-sg
OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
-
-*** Keywords ***
-Suite Teardown
- : FOR ${vm} IN @{NET_1_VMS}
- \ OpenStackOperations.Delete Vm Instance ${vm}
- : FOR ${vm} IN @{NET_2_VMS}
- \ OpenStackOperations.Delete Vm Instance ${vm}
- : FOR ${subnet} IN @{SUBNETS}
- \ BuiltIn.Run Keyword And Ignore Error OpenStackOperations.Delete SubNet ${subnet}
- : FOR ${network} IN @{NETWORKS}
- \ BuiltIn.Run Keyword And Ignore Error OpenStackOperations.Delete Network ${network}
- BuiltIn.Run Keyword And Ignore Error OpenStackOperations.Delete SecurityGroup additional-sg
- BuiltIn.Run Keyword And Ignore Error OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP}
- SSHLibrary.Close All Connections
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 Teardown BuiltIn.Run Keywords Delete Configurations
-... AND Close All Connections
+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
... AND OpenStackOperations.Get Test Teardown Debugs For SFC
OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET1_VM_IPS}[3] ${DEST_VM_LIST}
OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET1_VM_IPS}[3] curl http://@{NET1_VM_IPS}[4]
-*** Keywords ***
Delete Configurations
[Documentation] Delete all elements that were created in the test case section. These are done
... in a local keyword so this can be called as part of the Suite Teardown. When called as part
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 Teardown SSHLibrary.Close All Connections
+Suite Teardown OpenStackOperations.OpenStack Suite Teardown
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown OpenStackOperations.Get Test Teardown Debugs
Library SSHLibrary
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}
-Cleanup
- @{vms} = BuiltIn.Create List
- @{sgs} = BuiltIn.Create List ${SG_UPDATED} @{SGS}
- OpenStackOperations.Neutron Cleanup ${vms} ${NETWORKS} ${SUBNETS} ${PORTS} ${sgs}
-
*** Keywords ***
Get Flows
[Arguments] ${OS_COMPUTE_1_IP} ${OS_COMPUTE_2_IP}
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 Teardown DevstackUtils.Clean Up After Running Tempest
+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
Test Template DevstackUtils.Run Tempest Tests