In some jobs where we run tempest we do not have all required services
Good example of that are infra jobs where only keystone is deployed.
During conversion to usage of openstack_resources role, a condition for
glance images creation task was missed, that avoided image uploads
when glance is not present.
Change-Id: Ibcf16abab20eadf984ad1c8307ad14b43a889793
With efforts to create a resources in same, unified way,
we convert tempest role to use openstack_resources
for creating and managing openstack resources, like projects, flavors,
networks, images, etc. This should reduce maintenance costs
in case of futher collection updates and unify approach.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/878794
Change-Id: I8d7609fac96935ed51e92ebf58515e8eb0c44d5c
Due to typo in condition, we ended up in removing excludelist file right
after it being provisioned in certain circumstances.
Change-Id: I455f4e796fb8dcac29fe7947fc192baee9367187
Combine all variables starting with tempest_tempest_conf_overrides
to give a complete set of configuration to tempest when multiple
different test scenarios are enabled at the same time.
Change-Id: Iba5e061d1682d16c0516249f628f948a20580df8
If the role variable overrides are updated to remove a set of
existing tempest test exclusions, the previous exclusions file
remains on the disk even though it is not use, and not passed
to the tempest command. This is confusing and the file should
not be present unless there are active exclusions in place.
Change-Id: I5d69bf6258a00ade825cd3c746d1443dc1a35120
Previously the os_tempest role had a single variable for
defining the include and exclude lists in order to select the
tempest tests to run.
This works for simple scenarios, where a single service
is deployed and the tests for that service are enabled through
the necessary variables set in user_variables. This approach is
used in openstack-ansible CI / AIO.
More complicated scenarios such as magnum+barbican+octavia, would
create several user_variables files each with conflicting settings
for the test settings. It is possible in this scenario for there to
be no valid tempest tests to run and tempest to fail immediately.
This patch adds the possibility to have many variables defining
the include/exclude lists which have names using a common prefix.
Any variable names matching the prefix are gathered and combined
with the original role default to make extending the test lists
easy to do in an incremental/distibuted way in the ansible variables
instead of having to maintain a single point defining all necessary
tests.
Change-Id: Ie3a9a7be849171af042567ba8a152e5df5d2cb53
These variable names collide with the best name prefix to use when
gathering many variable names into a combined include/exclude list.
Codesearch shows no use of these as overrides and the number of
cases when an override would be needed is small.
Change-Id: Ic64165e41d24ae8dc75061589de84fa57998f03d
More suitable replacement variables have been available for
several releases now so we can remove the deprecated vars.
Tripleo still defines these deprecated variables in several
places but seems to have made no attempt to move to the new
vars, and tripleo is itself now deprecated so we should move
ahead with removal of these vars from os_tempest.
Change-Id: I5a4a90bc963acc8b44caf7eb060b763e0f90a50f
With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.
With that we also update metdata to reflect current state.
Change-Id: Ifcb6ebfa971e324e447509e50cc7294bddd6a4a0
Ubuntu distro installation installs tempest plugins from source.
For this scenario we're ensuring that wheels won't be built as
repo container that should handle wheels build is simply absent in this
scenario.
For the rest usecases we're sticking with our new default to build
wheels.
Change-Id: Id643946edf4b4e21f8420d048ce8293fc40a61fc
This line was introduced by I0230f1a93d16243fc50df79b2d0780e744706c7b
and should already be covered by the distribution_major_version line
above.
Change-Id: Ibffaadb721796d6f657972633d19bdd36e411c52
Currently when ``tempest_router_create`` is enabled, playbook requires
``tempest_public_net_create`` to be set.
It's an incorrect behavior. Router creation should only require public
network to exist. It does not matter if that public network was created
by tempest or operator.
Change-Id: Icaa223ed03837a68e9e84a89560cc2df10e3ed3e
The newest openstacksdk is set to rename some of the field names of
return values. This also affects the openstack.cloud collection. This
patch checks for both field names to make sure the os_tempest role
doesn't break when the collections release.
Change-Id: I4b30650a6c78e76982e22746933be7c132490a43
Tempest currently has two different internal methods for providing
authentication to tests: dynamic credentials and pre-provisioned credentials.
Depending on which one is in use the configuration of Tempest is slightly
different.
We should provide a support for both of them.
https: //docs.openstack.org/tempest/latest/configuration.html#credential-provider-mechanisms
Change-Id: I26d69caa3f96a530bc0a4a21365404b1a84e489a
In most cases, many of tempest resources are not needed.
From the other hand, some of our contributors still need them so we
can't just drop this functionality from this role.
The best solution I see is to add more flexibility and let users
choose which resources should be created by tempest role.
- public network:
new variable: bool tempest_public_net_create (default: true)
if false: require tempest_neutron_public_network_id to be set
if true: require all other tempest_public_net_* variables to be set
explanation: it'd be useful to choose if user wants to use already
existing public net or create a new one/
- private network:
new variable: bool tempest_private_net_create (default: false)
if true: require all tempest_private_* variables to be set
explanation: by default tempest has use_dynamic_credentials &
create_isolated_networks enabled, so it spawns an usable network,
subnet, and router when needed for each project it creates, so in
most cases it doesn't make sense to create special 'private' net.
- router:
new variable: bool tempest_router_create (default: false)
if true: both tempest_public_net_create and
tempest_private_net_create should be enabled
explanation: same case as for private network
- image:
new variable: bool tempest_images_create (default: true)
if false: require tempest_glance_image_id_1,
tempest_glance_image_id_2 to be set
explanation: tempest needs public images, so it'd be useful to just
use already existing ones
- flavor:
new variable: bool tempest_flavors_create (default: true)
if false: require tempest_nova_flavor_id_1, tempest_nova_flavor_id_2
to be set
explanation: tempest needs public flavors, so it'd be useful to just
use already existing ones
- projects:
new variable: bool tempest_projects_create (default:
"{{ tempest_public_net_create or tempest_private_net_create or
tempest_public_router_create }}")
explanation: by default tempest has use_dynamic_credentials &
create_isolated_networks enabled, so we don't need to create any
'static' projects, but network resources spawned by tempest
playbook belong to this project, so it should exist if any of
these resources are going to be created
I don't see any reason why users and tempest role should be created
so i dropped this functionality.
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/825166
Change-Id: Icb46f5cb9e2dda6511cc49e30587f541aa7e399f
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.
This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.
Change-Id: I08dbacef3ef29548cce58cbaee79a3fa79086259
This add a aditional test in the tempest_test_includelist. This is
required right now as a workaround for tripleo jobs, while the
implementation of the includelist in openstack-tempest-skiplist tool.
Tripleo uses os_tempest to setup and run tempest, but it doesn't run all
tempest tests. Sometimes, the list of excluded tests matches the list of
included tests and so tempest fail with no tests to run. This
tempest_test_extra_test will ensure that it will execute at least one
keystone api test to avoid this.
Right now, the tempest_test_whitelist variable is parsed to ansible via
-e command line, and so it's hard to overwrite it on tripleo side, and
it's spreaded in several different jobs with several different set of
tests. So, this is the best/easy way to fix this problem, while we work
on a long term solution.
Change-Id: Ic5f5b44d81ed39b1fa622b5a1d76e482c2aa23aa
Add a file containing the list of failing tests is important to send
these to logstash and make it easy for people identify how often a
particular test is failing in a particular job.
This should not impact the time of the job or the size of the file, once
it's a small and very quickly command to run
Change-Id: Ib6c2dfc41ac48c3ca6822d6298e1cc55f5c28fbe
When we're in CI and not building wheels, we might appear missing
py3-dev inside utility container, which is required for netifaces. So we
add it as `tempest_devel_distro_packages` which will get package
installed on the required target.
Change-Id: Ie8e04a1635a32e368ec3906082f7773dcefd30d1
'--whitelist-file' option is deprecated, use '--include-list' instead which is functionally equivalent.
Right now Tempest still supports this option for backward compatibility, however, it will be removed soon.
This change addresses the occurences of whitelist and blacklist in the os_tempest OSA role.
Change-Id: Id021d084867ef2891c381c5863b82421e90ee2ca
Save the output of tempestconf to a file is good to debug what's
happening with tempestconf and debug the code
Change-Id: I34896c7ab3c0b75f2587a6bef3076366af67c592
All references to Gentoo, SUSE, Debian stretch and Centos-7 are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible
Change-Id: Ie84846f8590c3ae60afd671d973a4de3c644d526
os_ prefixed module names are deprecated for a while and will be removed
Current usage generates a warning for users.
Change-Id: I85b5666fabfd17d4731bfa085a2e89a17b184b3a
This is necessary to support the new pip resolver.
Depends-On: I9be6bbf4a29a4da2ddf96dc0336bc2a7d8ec9281
Depends-On: I49c75dd11d6c4e8d37fe013b7ffdfd56ff193fcd
Change-Id: If53aca6f16324d305b150466b94d3f18c8a1096a
ansible block w/ error handling was incorrect: the first block
failed when tempest executed, then the second one (which creates
stackviz) never got executed.
It also includes in the block assertion to check if tempest
failed (this is actually redundant check, not really needed).
Change-Id: Ie99060fce29f35ced77efb7b29b8f5f6e37abbcd
Closes-Bug: #1905460
If a user sets tempest_cleanup variable to true, tempest cleanup will be
executed prior tempest tests (to generate saved_state.json) and after the
tests in order to delete leaked resources if any.
Change-Id: Ief00b43237cb634ee25a18264461bfda8464bbc7
This patch is part of a set that aims to break out tempest
resource creation from the role, and introduces the
tempest_default_role_resources var. When true, default role
resources are created. When false, deployer-specific resources
must be created prior to executing os-tempest-install.yml or
including the os_tempest role in other playbooks.
Change-Id: I42cb8ffbe8aa8cfdcdcfcbbccf28117a27c519b1
OVN requires MTU to be set no more then 1442, so we need ability to
define non-default MTU for networks.
Change-Id: I486981f95cdfa5498f5e31222de4e58d8aa7a516
The tempest init was checking if the workspace/etc directory exists, and
were creating a new workspace without pass a name, the default is
workspace, but passing a --name ensure it won't break if tempest decides
to change it.
Also, the rename command only change the name in the
$HOME/.tempest/workspace.yml, it doesn't change the path for the
particular workspace. The same happens with the move command, it just
update the path on the workspace.yml file.
With this patch, the tempest workspace is being moved properly to a
workspace_$CURDATE, all the files are copied to the new workspace,
delete the old workspace directory, and call tempest init properly.
Also adding tripleo upgrade job as nv for now, since this issue only
happen in upgrade jobs.
Change-Id: I8a3b79352819f5e980eaea7482cd6b1f1bfc47be
Closes-Bug: #1896126
Do some role cleanup to path for not supported OS,
like gentoo or suse.
This includes bionic distro jobs, since this path is not supported
for bionic in Victoria
Fix ansible linter errors as a result of linter update.
Change-Id: I619dc6da251bd9d6f9d117e7b0cdedc2e59bf581
We need to set mode for copy operation otherwise ansible-2.9.12
can lead to too restrictive default permissions[1].
Setting mode for copy operations handles the warning.
[1.] https://github.com/ansible/ansible/issues/67794
Change-Id: Ieae36a1d85a7da84ee2cd982a20dcabe9e65511f
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
Setting this condition will make possible to only install tempest
without creating weird resources. We still will install them,
when deployer explicitly set to run tempest with the role.
Change-Id: I37bc266eebd3a8455acac179055b87810143dfc4
This patch fixes the warning:
[DEPRECATION WARNING]: The 'os_project_facts' module has been renamed to
'os_project_info', and the renamed one no longer returns ansible_facts.
Change-Id: I7fe4bda991b968530453c620e1ea56a187a26924
This patch add support to tempest run --worker-file option.
This add the possibility to manually schedule how tempest tests will be
executed in each worker
Change-Id: I9ea47452c430c6bf5ec0ac6332cecd5d3abc7792
Previously the tempest plugins were installed using pip independant
of the python_venv_build role, in the past OSA could support a mixed install
of a distro tempest package and source code plugins. The mixed mode has been
removed but the tempest & tempest plugins installation tasks remain seperate.
Tempest is installed using python_venv_build, and the plugins are installed
directly using the ansible pip module. Unfortunatly, these two approaches do
not handle openstack upper-constraints in the same way, particularly for a
package that is installed from source code.
The python_venv_build role will correctly install a version of tempest
corresponding to the specified git SHA even when u-c specifies an earlier version
of the package. Unfortunately, when installing the tempest plugins with
the pip module, the previously installed tempest packages gets downgraded to
match the version specified in u-c as the pip module is unaware of the combined
source + u-c constraints generated by python_venv_build.
Tempest is an unusual case, because it is perhaps the only "top level" openstack
projects which has its own constraint appear in u-c.
This patch also corrects the use use of the venv_wheel_build_enable variable.
As a role default the value of this variable is changed in the whole scope of
the role becasue it is overridden during the stackviz install. The approach
used should be reviewed and refined in a future patch.
This patch also marks bionic/distro jobs as non voting as there has not been
a release of tempest which passes keystone test_list_user_groups test.
Change-Id: I5e8c8540b30865aaccafe59c73fae6fdd6da80a8