Commit Graph

2992 Commits

Author SHA1 Message Date
Zuul 46a1868f6f Merge "Lock external network stack creation between workers" 2024-03-22 11:07:09 +00:00
Eduardo Olivares 7228988b67 Simplify BaseResourceFixture.setup_client
This avoids the following error on some branches:
TypeError: Subscripted generics cannot be used with class and instance checks

The method keystone.keystone_client already checks whether the keystone
client was created before or not.

Change-Id: Ic5f8a9908f07be894b41017b121e03068348c8b4
2024-03-21 15:10:45 +00:00
Eduardo Olivares f650d7adcb Apply retries when ping execution fails due to ssh issues
When tobiko executes remote ping commands, they could fail due to:
- command error
- error connecting to the remove server to run ping
In the second case, the exception raised is a RetryLimitError. If that
exception is not captured, retries cannot be applied.

Change-Id: I00a76bb16de14440b25aeda00ee25b8d196992dd
2024-03-21 15:10:39 +00:00
Eduardo Olivares b9af2588b8 Lock external network stack creation between workers
In order to avoid concurrency issues when the
ExternalNetworkStackFixture stack or any of its child classes
(RouterStackFixture) are created, the interworker_synched decorator
is added to its setup_fixture method.

Change-Id: I94a2e86838020b6ca9faf77b9f5fd4f2f45b9167
2024-03-20 11:49:35 +01:00
Eduardo Olivares ff9c70dbc4 Upgrade sphinx version
sphinx version upgraded to 5.0
sphinx_rtd_theme version upgraded to 2.0

Depends-On: I80ae1fc69d5e8e2a31ac52c02a1604225eefba3c

Change-Id: Ib80988f8b11af93fc4e8bd3affa69795470787fc
2024-03-20 08:30:12 +00:00
Zuul 5b3db3d96b Merge "[Stateless SG] Add test for SG and Loadbalancer together" 2024-03-20 08:11:26 +00:00
Zuul 33596a954d Merge "Introduce new BaseResourceFixture class" 2024-03-19 22:13:00 +00:00
Slawek Kaplonski 564cc31c21 [Stateless SG] Add test for SG and Loadbalancer together
It is related to the bug [1] where there was a problem where VM with
stateless SG were connected to the same network as members of the OVN
loadbalancer.
Bug is now fixed but to avoid regressions in this, this patch adds
simple scenario test to cover such use case.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2214303

Depends-On: https://review.opendev.org/c/x/devstack-plugin-tobiko/+/912588

Closes-bug: #2024502
Change-Id: I8e45f6137dcc993575ca76a29a08a558ade0d448
2024-03-19 13:44:49 +00:00
Slawek Kaplonski 26b6909ceb Introduce new BaseResourceFixture class
This new class is base for both: HeatStackFixture and ResourceFixture
classes. It contains some common pieces of code like e.g. ensuring
that quota is set as required by the fixture.

This is done because fixture StatelessSecurityGroup, which don't use
HeatStackFixture needs to set quota for security groups in Neutron but
ensuring neutron (and nova) quotas are set correctly were done only in
the HeatStackFixture class so far.

Change-Id: Id3d3207f098853469bef87020fc017bec5aaba93
2024-03-19 14:43:41 +01:00
Zuul 205b496e37 Merge "Use upper-constraints in the Tobiko ansible roles" 2024-03-18 16:21:38 +00:00
Slawek Kaplonski 2005446dc6 Use upper-constraints in the Tobiko ansible roles
In Tobiko we have roles to e.g. ensure that tox is installed. It uses
pip but it didn't use upper-constraints.txt file from the OpenStack
requirements and that could cause some issues, especially on e.g. older
operating systems, see related bug for example.

With this patch those ansible roles which uses pip to install some
python packages will use upper-constraints file if it exists in the file
system (in the u/s CI it will exist).

This patch also lowers min tox version for stable/2023.1 and stable/zed
branches are those should still use tox 3.28

Closes-Bug: #2057492
Change-Id: I147770a7949c59ba61b8dcca23d5c6fbbacb2606
2024-03-18 14:02:22 +01:00
Eduardo Olivares 459a954ce1 Add retries to ovn_overcloud_processes_validations
This patch also includes a small refactoring of
OvercloudProcessesStatus.basic_overcloud_processes_running and
OvercloudProcessesStatus.ovn_overcloud_processes_validations methods.

Change-Id: I0761afdb6e8292ebc70ba479a8eaab84353a25b4
2024-03-13 18:00:28 +01:00
Eduardo Olivares 7733488f00 Refactoring tobiko lockers
Tobiko has used the oslo_concurrency.lockutils.synchronized to lock
execution of functions inter-process/worker.
The synchronized decorator does not support to disable intra-worker
locks. This is a problem for tobiko because there are some functions
that need to be locked between different workers, but not inside
a worker.
Why?
- Tobiko execution (based on pytest) is multi-worker, but not
  multi-thread.
- The creation of Tobiko resources (which is what we need to lock
  to avoid concurrency issues between workers) sometimes depends on the
  creation of other Tobiko resources that are defined in either parent
  or child classes from the first ones, getting blocked due to the
  locks applied.

Change-Id: I0b1c2d707b585fd4e45cad9968c88cedf2932eed
2024-03-08 12:50:51 +00:00
Eduardo Olivares cdd66eff32 Fix two issues that broke tobiko gates
1. mypy version needs to be bumbed to avoid [1]
2. due to a change in neutron [2], tobiko heat templates need to be
   updated: when an OVN router is created, its ha value is omitted

[1] https://github.com/python/mypy/issues/13627
[2] https://review.opendev.org/c/openstack/neutron/+/910889

Change-Id: I6c7fb32c6fa4fe6cd892a32cfeb1780d8d8be091
2024-03-08 13:50:08 +01:00
Zuul 14f1297c60 Merge "Fix tobiko.fail called from assert_equal_containers_state" 2024-03-06 18:22:22 +00:00
Eduardo Olivares 0bc0eeb336 Remove dependency with vulnerable library py - upgrade to tox>=4.13
All existing version from the py library are affected by the
following vulnerability:
https://github.com/advisories/GHSA-w596-4wvx-j9j6

In order to stop using py, its reference has been removed from tobiko
requirements. Besides, tox and pytest libraries versions have been
upgraded for this.

Change-Id: I2c61e753e55340b19ab941fd532de0cab875d51c
2024-03-06 12:41:03 +01:00
Eduardo Olivares e4b44952b0 Fix tobiko.fail called from assert_equal_containers_state
Two strings were wrongly passed to tobiko.fail.

Change-Id: I65c97c94c67b40ae39185b04095df2def9702d7f
2024-03-06 12:19:12 +01:00
Zuul f728814347 Merge "Skip tests using heat when heat service is not deployed" 2024-03-04 14:17:52 +00:00
Eduardo Olivares 7275483e01 Skip tests using heat when heat service is not deployed
This patch includes a hack to avoid skipping unit tests that mock the
heat client.

Change-Id: Id0fd820abc2e8d0c62cdb69206aaf8e0a426f7e0
2024-03-04 11:09:37 +01:00
Eduardo Olivares a712a7c2ca Add 'nova-custom-ceph' to COMPUTE_DP_SERVICE_NAMES list
With this patch, the list includes the following values:
- nova
- nova-custom
- nova-custom-ceph

Change-Id: I3a52603d90505909368421033c533955788057c6
2024-03-01 17:53:41 +01:00
Eduardo Olivares 6fb2680a18 Fix test_hostnames test
This test should not try to obtain the node hostnames via ssh when there
is no ssh_client available for the node.

Change-Id: I999ceac724ccbbedf305f5b0550a49798952d627
2024-03-01 17:48:58 +01:00
Eduardo Olivares a0ca923161 Fix link to Red Hat Openstack Platform reference
Change-Id: I65be4464240dfd547f6c0babba3371c9af20e506
2024-02-29 13:19:12 +01:00
Eduardo Olivares 49512d2499 Update latest stable tag to 0.7.2
Change-Id: I72e9997b070f8dc1e1c7db824df9a4a54bc57da0
2024-02-26 11:23:39 +01:00
Zuul c1c001e323 Merge "Fix retries on get_pcs_resources_table method" 2024-02-26 09:48:43 +00:00
Eduardo Olivares c6126e194c Fix retries on get_pcs_resources_table method
That method used retries wrongly:
- it did not use the tobiko retries mechanism
- its try/except did not catch all the relevant exceptions

Change-Id: I59c3d6e3db3294f135621e739d7582aa4977305e
2024-02-21 09:58:26 +01:00
Takashi Kajinami bf1d2b6a26 Remove unused "deprecated" method
The method is not actually used. Also we currently have a common
implementation in debtcollector and that can be used instead.

Change-Id: If9eb1f8b035a55163573f54ad8fd4c85b876e3fe
2024-02-21 10:59:46 +09:00
Eduardo Olivares c54cf94c76 Execute virt-customize with LIBGUESTFS_BACKEND=direct
When tobiko is executed from some virtual machines, the customization of
ubuntu images fails unless LIBGUESTFS_BACKEND=direct is used.

Change-Id: Ib5f8eca1f9107ee6c2f412a1948eeffc56d5aa45
2024-02-16 11:52:32 +01:00
Eduardo Olivares 197da7188d class OvnUnsupportedDhcpOptionReader skipped with Podified setups
The implementation of OvnUnsupportedDhcpOptionReader requires to connect
to controller nodes and access neutron logs, which is not supported yet

The module tobiko.openstack.topology._neutron has been moved to
tobiko.openstack.neutron.neutron_log_reader because it only includes
neutron-related operations.

Change-Id: I56f222da145399ddfa8096bb92fde500b1b8c6d1
2024-02-12 11:24:22 +01:00
Zuul 26dbe89b9d Merge "Fix security-group tests on Podified environments" 2024-02-12 09:32:34 +00:00
Zuul 3e02c53933 Merge "[Podified] Run test_list_nodes_processes only on compute nodes" 2024-02-12 09:26:56 +00:00
Eduardo Olivares 8776813c4f [Podified] Run test_list_nodes_processes only on compute nodes
When the test test_list_nodes_processes is executed on a Podified
topology, it should only be run on compute nodes (Tobiko is unable to
connect to controllers yet).

Change-Id: I93249cb892a53ef72d49f7c50297cbe6292c81a4
2024-02-09 16:46:45 +01:00
Slawek Kaplonski 76c5cbb78a Implement power off and on EDPM nodes in the podified topology
It can be done using OCP APIs if nodes are provisioned using BareMetal
operator. Otherwise (e.g. in the default deployment done with
install_yamls) powering on/off nodes is not possible through Tobiko.

Change-Id: I18d3f35bbd03b7346b31302fd715b9bb0e9ac531
2024-02-09 11:07:32 +01:00
Eduardo Olivares 07d9170eba Fix security-group tests on Podified environments
- in podified setups, the container runtime on the compute nodes is
  podman
- for the moment, tobiko can only ssh access to EDPM nodes when tests
  are executed on a Podified environment.
- the OVN NB DB address (FQDN) is different from the SB DB address (apart from
  the port, which was always different): ovsdbserver-sb -> ovsdbserver-nb

Change-Id: I243b5bf468337a6e04a9625b15eac7e3a7209de8
2024-02-09 09:53:58 +01:00
Slawek Kaplonski 5460bfd6b2 Fix discoverability of the EDPM nodes IP addresses
It seems that when BareMetal operator is used to provision EDPM nodes,
there is no IP address in the OpenStackDataplaneNodeset's spec given.
In such case we need to look into the 'Status' field and look for the
Ctlplane IP address for the node.

Change-Id: Idc3b741a3c783c0e04fb786d0aea24dc970b32d6
2024-02-08 10:15:56 +01:00
Slawek Kaplonski 18a4fb96d7 [Podified] Add containers sanity tests for Podified topology
This patch adds some basic sanity tests for the containers on the
edpm nodes in the podified topology.

Change-Id: Id2e79ae24c33c45abdf7f7bb410a821ba21c87ca
2024-02-07 14:16:00 +01:00
Slawek Kaplonski 7d08603c1d [Podified] Make Topology class to decide about container runtime
Previously it was only used in the Tripleo Topology class and containers
module decided about runtime (docker or podman) which should be used.
Now we have also Podified deployments and we can't rely on checks like
"has_overcloud()" to decide about it.

This patch moves some containers related things to the rhosp and/or
podified modules and let topology class to decide what containers
runtime should be used.

Related-Jira: #OSP-22166
Change-Id: I7187de8884e44eaefcdda6fae160e89242761f39
2024-02-06 13:07:27 +01:00
Zuul 1d845ed565 Merge "Fix importing openshift module" 2024-02-05 20:41:11 +00:00
Eduardo Olivares 0f217942a5 Fix importing openshift module
With openshift-client-python version 2.0.1, `import openshift` does not
work anymore and needs to be replaced by `import openshift_client`.
https://github.com/openshift/openshift-client-python/releases/tag/2.0.1

Change-Id: Ie1a614fee59d64c7cc9a88e655611234ae89fb7e
2024-02-05 18:18:03 +01:00
Eduardo Olivares cfbf0ddb27 Fix exceptions catched during check_overcloud_node_uptime
The sh.get_uptime function only raises the exception UptimeError.

Change-Id: Ic6386add86ae7723cd12f95c529ea60f1761e928
2024-02-05 10:56:26 +01:00
Zuul 9c247d565d Merge "Use configured process timeout when closing a process" 2024-02-03 13:59:55 +00:00
Eduardo Olivares b6d63c401e Ignore image_dir when image_file is a path
Change-Id: I50539a50cfa2053a01837012a725baaea8aa20cb
2024-02-02 14:12:15 +01:00
Eduardo Olivares be26dd6b78 Use configured process timeout when closing a process
Some processes get blocked waiting while they cannot read from either
stdout or stderr. The command timeout was not applied when tobiko tried
to close those processes.
With this patch, those processes will be closed due to timeout and the
tobiko retries mechanism would be able to retry the command.

Change-Id: I1836de50cbbe029f7c474598ec57ea2e52822dd1
2024-02-01 18:16:12 +01:00
Eduardo Olivares 652c9696a8 Added HOME env variable to tox testenv
This is necessary because some openhift modules search for the
$HOME/.kube/config file and fail because they cannot find it.

Change-Id: I9ab53ffdc0ac86dd903aa1c5f2b0b52f521c3097
2024-01-25 16:47:37 +01:00
Eduardo Olivares d1ed7ca901 [openstackclient-cli] Use certificate when TLS-e is configured
When the Openstack auth-url is based on https, the openstack CLI
commands should include `--os-cacert <path-to-cert-file>`, which can be
extracted from the tobiko configuration.

Change-Id: Ib62bd52ac2dfe1296bc9dfedb6450c2213bc2c7c
2024-01-23 17:45:37 +01:00
Slawek Kaplonski cf666804ef [Podified] Implement way to discover OCP workers
In podified topology OCP workers are actually OpenStack control plane
nodes. Currently we don't do ssh to those nodes in Tobiko but in some
cases, like e.g. in some tests from the
tobiko.tests.faults.neutron.test_agents module we need to filter such
nodes out as Tobiko tries to ssh to every node which it founds in the
"neutron agent-list" output and there is at least one ovn-controller
running on the controller node (OCP workers).

To workaround that issue this patch adds discoverability of the OCP
workers but without trying to create ssh_client for those nodes.

Related-Jira: #OSP-22166
Change-Id: Ib52d6b1a88046017081db30ece8969a20ead73c1
2024-01-12 12:49:32 +01:00
Slawek Kaplonski d85945a608 [Podified] Recognition of the compute/networker/other edpm nodes
With this patch Tobiko can recognize edpm nodes and put it in one of the
following groups:
- edpm-compute - nodes which have "nova" or "nova-custom" service
  defined in OpenStackDataplaneNodeset,
- edpm-networker - nodes which have "ovn" but don't have "nova" nor
  "nova-custom" service defined in OpenStackDataplaneNodeset,
- edpm-other - every node which don't fit into any of the groups above.

All edpm nodes discovered in the environment are also placed in "legacy"
group called "compute".

Related-Jira: #OSP-22166
Change-Id: I64c4099e3e04df49b090f93a14f95e5fa6b74189
2024-01-12 12:49:32 +01:00
Fiorella Yanac 5583f7de53 Change name of controller_galera_main_vip test
Change name from
test_z99_reboot_controller_galera_main_vip to
test_z999_reboot_controller_galera_main_vip
It makes it run last

Change-Id: Id9a72c60d9066910cbb16b9664885b2e93a8fbba
2024-01-11 14:24:40 +00:00
Slawek Kaplonski 155a7d355e Add RHOSP topology config options
This patch adds "rhosp" config option group and moves some
overcloud related config options to that new group.
Those options can be used in both overcloud nodes in the Tripleo
based deployments as well as in the EDPM nodes in the "NextGen"
OSP deployments.

This patch deprecates old, "overcloud_* options names and "tripleo"
group for those options.

Additionally it also removes "podified" group as there are no config
options only for the "podified" deployments for now.
There is no need to deprecate this group or option which was there as
those were introduced just now and not released yet at all.

Related-Jira: #OSP-22166
Change-Id: I0587f85f6f5c86cf547c04c339b314720606fb74
2023-12-14 13:11:48 +01:00
Zuul d6327733d8 Merge "Add topology which represents Podified RHOSP deployment" 2023-12-13 17:04:54 +00:00
Zuul ede2f736e4 Merge "Fix Manila shares cleanup" 2023-12-12 17:38:50 +00:00