Felipe Reyes acaeb62a4d Stop retrying if LB provisioning status reached ERROR (#682)
* Stop retrying if LB provisioning status reached ERROR

The method `wait_for_lb_resource()` retries for 15m while the load
balancer could have reached to ERROR during the provisioning in the
first few minutes, this approach makes the testing take longer for no
reason.

This change makes the ERROR state in provisioning_status final and
abort raising a ValueError() exception.

More details of the provisioning_status possible states can be found at:
https://docs.openstack.org/api-ref/load-balancer/v2/#provisioning-status-codes

* Use LoadBalancerUnexpectedState and LoadBalancerUnrecoverableError.

Drop the (re-)use of AssertionError and ValueError to identify when a
load balancer status is in a state where the test needs to retry or
break and fail respectively.

This change introduces 2 new exceptions to be explicit of what the code
is trying to do.

- LoadBalancerUnexpectedState is raised when the status of the load
  balancer is in a state different from the one requested by the caller,
  but said state can be considered as transitory.
- LoadBalancerUnrecoverableError is raised when the status of the load
  balancer is in ERROR state and said state is final for the
  proviniong_status property, hence retrying only delays the failure.
2022-03-08 13:11:51 +00:00
2022-01-14 15:40:41 +00:00
2020-06-11 15:53:51 +00:00
2021-07-29 09:56:23 +01:00
2020-04-02 15:44:17 +02:00
2021-07-28 16:53:01 +02:00

Zaza OpenStack Tests

This is a test library designed to be shared between the OpenStack Charms to improve code-reuse among the various components.

Usage

This example is taken from the pacemaker-remote charm's tests.yaml:

charm_name: pacemaker-remote
tests:
  - zaza.openstack.charm_tests.pacemaker_remote.tests.PacemakerRemoteTest
configure:
  - zaza.charm_tests.noop.setup.basic_setup
gate_bundles:
  - basic
smoke_bundles:
  - basic

test-requirements.txt:

git+https://github.com/openstack-charmers/zaza.git#egg=zaza
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
Description
No description provided
Readme Apache-2.0 3.8 MiB
Languages
Python 99.6%
Jinja 0.4%