From acd179374179261e2675d8fc9e1f8e6efcf191f4 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Mon, 5 Jul 2021 11:41:45 +0200 Subject: [PATCH] Fix neutron-api-plugin-ovn's num-expected-units After zaza#451 Zaza's application readiness detection has been improved, which now exposes issues from the past that were hidden. In other words, we were relying on a bug on Zaza's side and need to get this straight. --- zaza/openstack/charm_tests/ovn/tests.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/ovn/tests.py b/zaza/openstack/charm_tests/ovn/tests.py index bfa0f21..de8e938 100644 --- a/zaza/openstack/charm_tests/ovn/tests.py +++ b/zaza/openstack/charm_tests/ovn/tests.py @@ -263,8 +263,27 @@ class OVSOVNMigrationTest(test_utils.BaseCharmTest): 'neutron-api-plugin-ovn', 'neutron-plugin', 'neutron-api:neutron-plugin-api-subordinate') zaza.model.wait_for_agent_status() + + # NOTE(lourot): usually in this scenario, the test bundle has been + # originally deployed with a non-related neutron-api-plugin-ovn + # subordinate application, and thus Zaza has been taught to expect + # initially no unit from this application. We are now relating it + # to a principal neutron-api application with one unit. Thus we now + # need to make sure we wait for one unit from this subordinate + # before proceeding: + target_deploy_status = self.test_config.get('target_deploy_status', + {}) + try: + target_deploy_status['neutron-api-plugin-ovn'][ + 'num-expected-units'] = 1 + except KeyError: + # num-expected-units wasn't set to 0, no expectation to be + # fixed, let's move on. + pass + zaza.model.wait_for_application_states( - states=self.test_config.get('target_deploy_status', {})) + states=target_deploy_status) + except juju.errors.JujuAPIError: # we were not able to add the relation, let's make sure it's # because it's already there