From ab585352977688d5433704fc5869b1dc8a3f93d0 Mon Sep 17 00:00:00 2001 From: Pavel Boldin Date: Sat, 3 Oct 2015 02:37:11 +0300 Subject: [PATCH] config: fix missing benchmark opts Fix missing benchmark opts for Ironic, Murano and VM workload. Fix configuration variable names for Murano and Sahara. Change-Id: I161f0218e94c1b6d2e2aa9cf085cb1be991a8e9e Closes-Bug: #1502846 Doc-Impact --- etc/rally/rally.conf.sample | 58 ++++++++++++++----- rally/common/opts.py | 10 +++- .../context/sahara/sahara_cluster.py | 4 +- .../openstack/scenarios/murano/utils.py | 28 +++++---- .../openstack/scenarios/sahara/utils.py | 35 ++++++----- .../context/sahara/test_sahara_cluster.py | 2 +- .../openstack/scenarios/murano/test_utils.py | 10 ++-- .../openstack/scenarios/sahara/test_jobs.py | 4 +- .../openstack/scenarios/sahara/test_utils.py | 4 +- 9 files changed, 104 insertions(+), 51 deletions(-) diff --git a/etc/rally/rally.conf.sample b/etc/rally/rally.conf.sample index 676911e9e4..b072fd4601 100644 --- a/etc/rally/rally.conf.sample +++ b/etc/rally/rally.conf.sample @@ -138,6 +138,16 @@ # point value) #cinder_volume_delete_poll_interval = 2.0 +# Time to sleep after boot before polling for status (floating point +# value) +#ec2_server_boot_prepoll_delay = 1.0 + +# Server boot timeout (floating point value) +#ec2_server_boot_timeout = 300.0 + +# Server boot poll interval (floating point value) +#ec2_server_boot_poll_interval = 1.0 + # Time to sleep after creating a resource before polling for it status # (floating point value) #glance_image_create_prepoll_delay = 2.0 @@ -233,6 +243,10 @@ # scale up or down. (floating point value) #heat_stack_scale_poll_interval = 1.0 +# Interval(in sec) between checks when waiting for node creation. +# (floating point value) +#ironic_node_create_poll_interval = 1.0 + # Delay between creating Manila share and polling for its status. # (floating point value) #manila_share_create_prepoll_delay = 2.0 @@ -251,6 +265,22 @@ # (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 + # Time to sleep after start before polling for status (floating point # value) #nova_server_start_prepoll_delay = 0.0 @@ -468,29 +498,31 @@ #nova_detach_volume_poll_interval = 2.0 # A timeout in seconds for a cluster create operation (integer value) -#cluster_create_timeout = 1800 +# Deprecated group/name - [DEFAULT]/cluster_create_timeout +#sahara_cluster_create_timeout = 1800 # A timeout in seconds for a cluster delete operation (integer value) -#cluster_delete_timeout = 900 +# Deprecated group/name - [DEFAULT]/cluster_delete_timeout +#sahara_cluster_delete_timeout = 900 # Cluster status polling interval in seconds (integer value) -#cluster_check_interval = 5 +# Deprecated group/name - [DEFAULT]/cluster_check_interval +#sahara_cluster_check_interval = 5 # A timeout in seconds for a Job Execution to complete (integer value) -#job_execution_timeout = 600 +# Deprecated group/name - [DEFAULT]/job_execution_timeout +#sahara_job_execution_timeout = 600 # Job Execution status polling interval in seconds (integer value) -#job_check_interval = 5 +# Deprecated group/name - [DEFAULT]/job_check_interval +#sahara_job_check_interval = 5 -# Time to sleep after boot before polling for status (floating point -# value) -#ec2_server_boot_prepoll_delay = 1.0 +# Interval between checks when waiting for a VM to become pingable +# (floating point value) +#vm_ping_poll_interval = 1.0 -# Server boot timeout (floating point value) -#ec2_server_boot_timeout = 300.0 - -# Server boot poll interval (floating point value) -#ec2_server_boot_poll_interval = 1.0 +# Time to wait for a VM to become pingable (floating point value) +#vm_ping_timeout = 120.0 [cleanup] diff --git a/rally/common/opts.py b/rally/common/opts.py index fc5ad25f1f..fab3d85c3d 100644 --- a/rally/common/opts.py +++ b/rally/common/opts.py @@ -22,9 +22,12 @@ from rally.plugins.openstack.scenarios.cinder import utils as cinder_utils from rally.plugins.openstack.scenarios.ec2 import utils as ec2_utils from rally.plugins.openstack.scenarios.glance import utils as glance_utils from rally.plugins.openstack.scenarios.heat import utils as heat_utils +from rally.plugins.openstack.scenarios.ironic import utils as ironic_utils from rally.plugins.openstack.scenarios.manila import utils as manila_utils +from rally.plugins.openstack.scenarios.murano import utils as murano_utils from rally.plugins.openstack.scenarios.nova import utils as nova_utils from rally.plugins.openstack.scenarios.sahara import utils as sahara_utils +from rally.plugins.openstack.scenarios.vm import utils as vm_utils from rally.verification.tempest import config as tempest_conf @@ -35,12 +38,15 @@ def list_opts(): osclients.OSCLIENTS_OPTS)), ("benchmark", itertools.chain(cinder_utils.CINDER_BENCHMARK_OPTS, + ec2_utils.EC2_BENCHMARK_OPTS, glance_utils.GLANCE_BENCHMARK_OPTS, heat_utils.HEAT_BENCHMARK_OPTS, + ironic_utils.IRONIC_BENCHMARK_OPTS, manila_utils.MANILA_BENCHMARK_OPTS, + murano_utils.MURANO_BENCHMARK_OPTS, nova_utils.NOVA_BENCHMARK_OPTS, - sahara_utils.SAHARA_TIMEOUT_OPTS, - ec2_utils.EC2_BENCHMARK_OPTS)), + sahara_utils.SAHARA_BENCHMARK_OPTS, + vm_utils.VM_BENCHMARK_OPTS)), ("image", itertools.chain(tempest_conf.IMAGE_OPTS)), ("role", itertools.chain(tempest_conf.ROLE_OPTS)), diff --git a/rally/plugins/openstack/context/sahara/sahara_cluster.py b/rally/plugins/openstack/context/sahara/sahara_cluster.py index caeceebada..7c134e9b33 100644 --- a/rally/plugins/openstack/context/sahara/sahara_cluster.py +++ b/rally/plugins/openstack/context/sahara/sahara_cluster.py @@ -133,8 +133,8 @@ class SaharaCluster(context.Context): resource=wait_dict, update_resource=self.update_clusters_dict, is_ready=self.all_clusters_active, - timeout=CONF.benchmark.cluster_create_timeout, - check_interval=CONF.benchmark.cluster_check_interval) + timeout=CONF.benchmark.sahara_cluster_create_timeout, + check_interval=CONF.benchmark.sahara_cluster_check_interval) def update_clusters_dict(self, dct): new_dct = {} diff --git a/rally/plugins/openstack/scenarios/murano/utils.py b/rally/plugins/openstack/scenarios/murano/utils.py index 41b85bf8da..2ffb6fb27c 100644 --- a/rally/plugins/openstack/scenarios/murano/utils.py +++ b/rally/plugins/openstack/scenarios/murano/utils.py @@ -30,19 +30,23 @@ from rally.task import utils CONF = cfg.CONF -MURANO_TIMEOUT_OPTS = [ - cfg.IntOpt("delete_environment_timeout", default=180, +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("deploy_environment_timeout", default=1200, + cfg.IntOpt("murano_deploy_environment_timeout", default=1200, + deprecated_name="deploy_environment_timeout", help="A timeout in seconds for an environment deploy"), - cfg.IntOpt("delete_environment_check_interval", default=2, + cfg.IntOpt("murano_delete_environment_check_interval", default=2, + deprecated_name="delete_environment_check_interval", help="Delete environment check interval in seconds"), - cfg.IntOpt("deploy_environment_check_interval", default=5, + cfg.IntOpt("murano_deploy_environment_check_interval", default=5, + deprecated_name="deploy_environment_check_interval", help="Deploy environment check interval in seconds"), ] benchmark_group = cfg.OptGroup(name="benchmark", title="benchmark options") -CONF.register_opts(MURANO_TIMEOUT_OPTS, group=benchmark_group) +CONF.register_opts(MURANO_BENCHMARK_OPTS, group=benchmark_group) class MuranoScenario(scenario.OpenStackScenario): @@ -73,11 +77,13 @@ class MuranoScenario(scenario.OpenStackScenario): :param environment: Environment instance """ self.clients("murano").environments.delete(environment.id) + + config = CONF.benchmark utils.wait_for_delete( environment, update_resource=utils.get_from_manager(), - timeout=CONF.benchmark.delete_environment_timeout, - check_interval=CONF.benchmark.delete_environment_check_interval + timeout=config.murano_delete_environment_timeout, + check_interval=config.murano_delete_environment_check_interval ) @atomic.action_timer("murano.create_session") @@ -126,11 +132,13 @@ class MuranoScenario(scenario.OpenStackScenario): """ self.clients("murano").sessions.deploy(environment.id, session.id) + + config = CONF.benchmark utils.wait_for( environment, is_ready=utils.resource_is("READY"), update_resource=utils.get_from_manager(["DEPLOY FAILURE"]), - timeout=CONF.benchmark.deploy_environment_timeout, - check_interval=CONF.benchmark.deploy_environment_check_interval + timeout=config.murano_deploy_environment_timeout, + check_interval=config.murano_deploy_environment_check_interval ) @atomic.action_timer("murano.list_packages") diff --git a/rally/plugins/openstack/scenarios/sahara/utils.py b/rally/plugins/openstack/scenarios/sahara/utils.py index 77fa99b7d8..922e8eaf96 100644 --- a/rally/plugins/openstack/scenarios/sahara/utils.py +++ b/rally/plugins/openstack/scenarios/sahara/utils.py @@ -31,21 +31,26 @@ from rally.task import utils LOG = logging.getLogger(__name__) CONF = cfg.CONF -SAHARA_TIMEOUT_OPTS = [ - cfg.IntOpt("cluster_create_timeout", default=1800, +SAHARA_BENCHMARK_OPTS = [ + cfg.IntOpt("sahara_cluster_create_timeout", default=1800, + deprecated_name="cluster_create_timeout", help="A timeout in seconds for a cluster create operation"), - cfg.IntOpt("cluster_delete_timeout", default=900, + cfg.IntOpt("sahara_cluster_delete_timeout", default=900, + deprecated_name="cluster_delete_timeout", help="A timeout in seconds for a cluster delete operation"), - cfg.IntOpt("cluster_check_interval", default=5, + cfg.IntOpt("sahara_cluster_check_interval", default=5, + deprecated_name="cluster_check_interval", help="Cluster status polling interval in seconds"), - cfg.IntOpt("job_execution_timeout", default=600, + cfg.IntOpt("sahara_job_execution_timeout", default=600, + deprecated_name="job_execution_timeout", help="A timeout in seconds for a Job Execution to complete"), - cfg.IntOpt("job_check_interval", default=5, + cfg.IntOpt("sahara_job_check_interval", default=5, + deprecated_name="job_check_interval", help="Job Execution status polling interval in seconds") ] benchmark_group = cfg.OptGroup(name="benchmark", title="benchmark options") -CONF.register_opts(SAHARA_TIMEOUT_OPTS, group=benchmark_group) +CONF.register_opts(SAHARA_BENCHMARK_OPTS, group=benchmark_group) class SaharaScenario(scenario.OpenStackScenario): @@ -112,8 +117,8 @@ class SaharaScenario(scenario.OpenStackScenario): utils.wait_for( resource=cluster_object, ready_statuses=["active"], failure_statuses=["error"], update_resource=self._update_cluster, - timeout=CONF.benchmark.cluster_create_timeout, - check_interval=CONF.benchmark.cluster_check_interval) + timeout=CONF.benchmark.sahara_cluster_create_timeout, + check_interval=CONF.benchmark.sahara_cluster_check_interval) def _setup_neutron_floating_ip_pool(self, name_or_id): if name_or_id: @@ -395,8 +400,8 @@ class SaharaScenario(scenario.OpenStackScenario): utils.wait_for( resource=cluster, - timeout=CONF.benchmark.cluster_delete_timeout, - check_interval=CONF.benchmark.cluster_check_interval, + timeout=CONF.benchmark.sahara_cluster_delete_timeout, + check_interval=CONF.benchmark.sahara_cluster_check_interval, is_ready=self._is_cluster_deleted) def _is_cluster_deleted(self, cluster): @@ -438,8 +443,8 @@ class SaharaScenario(scenario.OpenStackScenario): "killed". The timeout and the polling interval may be configured through - "job_execution_timeout" and "job_check_interval" parameters under the - "benchmark" section. + "sahara_job_execution_timeout" and "sahara_job_check_interval" + parameters under the "benchmark" section. :param job_id: The Job id that will be executed :param cluster_id: The Cluster id which will execute the Job @@ -462,8 +467,8 @@ class SaharaScenario(scenario.OpenStackScenario): utils.wait_for( resource=job_execution.id, is_ready=self._job_execution_is_finished, - timeout=CONF.benchmark.job_execution_timeout, - check_interval=CONF.benchmark.job_check_interval) + timeout=CONF.benchmark.sahara_job_execution_timeout, + check_interval=CONF.benchmark.sahara_job_check_interval) run(self) diff --git a/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py b/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py index 5f7c32c220..c4cb3a40a0 100644 --- a/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py +++ b/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py @@ -45,7 +45,7 @@ class SaharaClusterTestCase(test.ScenarioTestCase): "tenant_id": str(i), "endpoint": mock.MagicMock()}) - CONF.set_override("cluster_check_interval", 0, "benchmark") + CONF.set_override("sahara_cluster_check_interval", 0, "benchmark") self.context.update({ "config": { diff --git a/tests/unit/plugins/openstack/scenarios/murano/test_utils.py b/tests/unit/plugins/openstack/scenarios/murano/test_utils.py index 1d4590af5b..2883313d77 100644 --- a/tests/unit/plugins/openstack/scenarios/murano/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/murano/test_utils.py @@ -52,11 +52,12 @@ class MuranoScenarioTestCase(test.ScenarioTestCase): environment.id ) + config = CONF.benchmark self.mock_wait_for_delete.mock.assert_called_once_with( environment, update_resource=self.mock_get_from_manager.mock.return_value, - timeout=CONF.benchmark.delete_environment_timeout, - check_interval=CONF.benchmark.delete_environment_check_interval) + 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") @@ -94,12 +95,13 @@ class MuranoScenarioTestCase(test.ScenarioTestCase): environment.id, session.id ) + config = CONF.benchmark self.mock_wait_for.mock.assert_called_once_with( environment, update_resource=self.mock_get_from_manager.mock.return_value, is_ready=self.mock_resource_is.mock.return_value, - check_interval=CONF.benchmark.deploy_environment_check_interval, - timeout=CONF.benchmark.deploy_environment_timeout) + check_interval=config.murano_deploy_environment_check_interval, + timeout=config.murano_deploy_environment_timeout) self.mock_get_from_manager.mock.assert_called_once_with( ["DEPLOY FAILURE"]) self.mock_resource_is.mock.assert_called_once_with("READY") diff --git a/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py b/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py index 650917dcf1..fb7ee9f538 100644 --- a/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py +++ b/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py @@ -31,8 +31,8 @@ class SaharaJobTestCase(test.ScenarioTestCase): super(SaharaJobTestCase, self).setUp() self.context = test.get_test_context() - CONF.set_override("cluster_check_interval", 0, "benchmark") - CONF.set_override("job_check_interval", 0, "benchmark") + CONF.set_override("sahara_cluster_check_interval", 0, "benchmark") + CONF.set_override("sahara_job_check_interval", 0, "benchmark") @mock.patch("rally.common.utils.generate_random_name", return_value="job_42") diff --git a/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py b/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py index 92432c603f..c332294e40 100644 --- a/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py @@ -41,8 +41,8 @@ class SaharaScenarioTestCase(test.ScenarioTestCase): def setUp(self): super(SaharaScenarioTestCase, self).setUp() - CONF.set_override("cluster_check_interval", 0, "benchmark") - CONF.set_override("job_check_interval", 0, "benchmark") + CONF.set_override("sahara_cluster_check_interval", 0, "benchmark") + CONF.set_override("sahara_job_check_interval", 0, "benchmark") def test_list_node_group_templates(self): ngts = []