From e29eb8a8e457cffea827ee6761d7a5286f9a5535 Mon Sep 17 00:00:00 2001 From: Boris Pavlovic Date: Tue, 20 Oct 2015 13:54:52 -0700 Subject: [PATCH] Fix Murano delete environment Environment is deleted instatly from murano DB after delete API request is finished: https://github.com/openstack/murano/blob/0ced0071095248283ec4f95aadeaea962e096fa9/murano/api/v1/environments.py#L158-L173 It means next thing: * We shouldn't use wait_for in this case * We should use SynchronizedDeletion in resource cleanup * We shouldn't make hacks in get_status() to make this work This patch cleans up conf options as well Change-Id: Ib495afc79229ab0bb9f9eb40388c00a618b84cb1 --- etc/rally/rally.conf.sample | 8 -------- .../plugins/openstack/scenarios/murano/utils.py | 16 ---------------- .../openstack/scenarios/murano/test_utils.py | 12 ------------ 3 files changed, 36 deletions(-) diff --git a/etc/rally/rally.conf.sample b/etc/rally/rally.conf.sample index b072fd46..b587cb6b 100644 --- a/etc/rally/rally.conf.sample +++ b/etc/rally/rally.conf.sample @@ -265,18 +265,10 @@ # (floating point value) #manila_share_delete_poll_interval = 2.0 -# A timeout in seconds for an environment delete (integer value) -# Deprecated group/name - [DEFAULT]/delete_environment_timeout -#murano_delete_environment_timeout = 180 - # A timeout in seconds for an environment deploy (integer value) # Deprecated group/name - [DEFAULT]/deploy_environment_timeout #murano_deploy_environment_timeout = 1200 -# Delete environment check interval in seconds (integer value) -# Deprecated group/name - [DEFAULT]/delete_environment_check_interval -#murano_delete_environment_check_interval = 2 - # Deploy environment check interval in seconds (integer value) # Deprecated group/name - [DEFAULT]/deploy_environment_check_interval #murano_deploy_environment_check_interval = 5 diff --git a/rally/plugins/openstack/scenarios/murano/utils.py b/rally/plugins/openstack/scenarios/murano/utils.py index 1e13f15a..e09fc989 100644 --- a/rally/plugins/openstack/scenarios/murano/utils.py +++ b/rally/plugins/openstack/scenarios/murano/utils.py @@ -31,15 +31,9 @@ from rally.task import utils CONF = cfg.CONF MURANO_BENCHMARK_OPTS = [ - cfg.IntOpt("murano_delete_environment_timeout", default=180, - deprecated_name="delete_environment_timeout", - help="A timeout in seconds for an environment delete"), cfg.IntOpt("murano_deploy_environment_timeout", default=1200, deprecated_name="deploy_environment_timeout", help="A timeout in seconds for an environment deploy"), - cfg.IntOpt("murano_delete_environment_check_interval", default=2, - deprecated_name="delete_environment_check_interval", - help="Delete environment check interval in seconds"), cfg.IntOpt("murano_deploy_environment_check_interval", default=5, deprecated_name="deploy_environment_check_interval", help="Deploy environment check interval in seconds"), @@ -78,16 +72,6 @@ class MuranoScenario(scenario.OpenStackScenario): """ self.clients("murano").environments.delete(environment.id) - config = CONF.benchmark - utils.wait_for_status( - environment, - ready_statuses=["deleted"], - check_deletion=True, - update_resource=utils.get_from_manager(), - timeout=config.murano_delete_environment_timeout, - check_interval=config.murano_delete_environment_check_interval - ) - @atomic.action_timer("murano.create_session") def _create_session(self, environment_id): """Create session for environment with specific id diff --git a/tests/unit/plugins/openstack/scenarios/murano/test_utils.py b/tests/unit/plugins/openstack/scenarios/murano/test_utils.py index 631482c6..1a4e5041 100644 --- a/tests/unit/plugins/openstack/scenarios/murano/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/murano/test_utils.py @@ -52,18 +52,6 @@ class MuranoScenarioTestCase(test.ScenarioTestCase): environment.id ) - config = CONF.benchmark - self.mock_wait_for_status.mock.assert_called_once_with( - environment, - ready_statuses=["deleted"], - check_deletion=True, - update_resource=self.mock_get_from_manager.mock.return_value, - timeout=config.murano_delete_environment_timeout, - check_interval=config.murano_delete_environment_check_interval) - self.mock_get_from_manager.mock.assert_called_once_with() - self._test_atomic_action_timer(scenario.atomic_actions(), - "murano.delete_environment") - def test_create_session(self): self.clients("murano").sessions.configure.return_value = "sess" scenario = utils.MuranoScenario(context=self.context)