diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/base.py b/whitebox_neutron_tempest_plugin/tests/scenario/base.py index 61fa5d5..b844b27 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/base.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/base.py @@ -397,6 +397,13 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase): cls.OC, pod, os.path.split( cls.neutron_conf)[0])).split('\n') + @classmethod + def wait_res_rollout(cls, res='deploy/neutron'): + res_wait = "{} rollout status {}".format(cls.OC, res) + + rollout_status = cls.run_on_master_controller(res_wait) + LOG.debug("Rollout status:\n%s", rollout_status) + # TODO(mblue): next gen computes configuration set should be done too, # 'oc patch' for data plane would need more steps and triggers deployment @classmethod @@ -406,7 +413,8 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase): file: str = '', service: str = 'neutron', config_list: list[ConfigOption] = None, - cfg_change: bool = True + cfg_change: bool = True, + wait_res: str = '' ) -> None: """Set configuration for service @@ -420,6 +428,7 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase): :param cfg_change: by default, it is always expected that the configuration will change; in a podified environment, that implies a pod replacement. + :param wait_res: Resource to wait for rollout """ assert config_list, ("At least one configuration parameter must be " "supplied") @@ -471,6 +480,8 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase): # wait until old service pod is fully replaced def _service_pod_replaced(): + if wait_res: + cls.wait_res_rollout(res=wait_res) _service_pods = cls.get_pods_of_service( service=service, pod_state='') diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/test_api_server.py b/whitebox_neutron_tempest_plugin/tests/scenario/test_api_server.py index 2ac0a9d..312b123 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/test_api_server.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/test_api_server.py @@ -47,7 +47,8 @@ class NeutronAPIServerTest(wb_base.BaseTempestTestCaseOvn): _config = wb_base.ConfigOption('ovn', 'fdb_age_threshold', random.randint(10000, 90000)) self.set_service_setting(file=wb_utils.get_ml2_conf_file(), - config_list=[_config]) + config_list=[_config], + wait_res='deploy/neutron') # 3) Restart Neutron API on all controllers simultaneously. if not WB_CONF.openstack_type == 'podified':