Add missing argument to _discover_or_create_flavor

Sorry, I missed this in:

https://review.opendev.org/#/c/678901/

Co-Authored-By: dlutton <eyedea32@gmail.com>

Change-Id: I90df1999fd4b96c7b8dbaa707c50111b3728f2e7
Closes-Bug: #1862220
This commit is contained in:
Will Szumski 2020-02-06 18:06:47 +00:00 committed by Andrey Kurilin
parent 539404212c
commit 0ff4590b97
3 changed files with 33 additions and 26 deletions

View File

@ -79,5 +79,10 @@ OPTS = {"openstack": [
cfg.IntOpt("heat_instance_type_ram",
default="64",
deprecated_group="tempest",
help="RAM size flavor used for orchestration test cases")
help="RAM size flavor used for orchestration test cases"),
cfg.IntOpt("heat_instance_type_disk",
default="5",
deprecated_group="tempest",
help="Disk size requirement in GiB flavor used for "
"orchestration test cases"),
]}

View File

@ -102,7 +102,8 @@ class TempestContext(context.VerifierContext):
self._configure_option(
"orchestration", "instance_type",
helper_method=self._discover_or_create_flavor,
flv_ram=conf.CONF.openstack.heat_instance_type_ram)
flv_ram=conf.CONF.openstack.heat_instance_type_ram,
flv_disk=conf.CONF.openstack.heat_instance_type_disk)
with open(self.conf_path, "w") as configfile:
self.conf.write(configfile)

View File

@ -418,27 +418,28 @@ class TempestContextTestCase(test.TestCase):
mock__create_tempest_roles.assert_called_once_with()
mock_open.assert_called_once_with(verifier.manager.configfile, "w")
ctx.conf.write(mock_open.side_effect())
self.assertEqual(
[mock.call("DEFAULT", "log_file", "/p/a/t/h/tempest.log"),
mock.call("oslo_concurrency", "lock_path", "/p/a/t/h/lock_files"),
mock.call("scenario", "img_dir", "/p/a/t/h"),
mock.call("scenario", "img_file", ctx.image_name,
helper_method=ctx._download_image),
mock.call("compute", "image_ref",
helper_method=ctx._discover_or_create_image),
mock.call("compute", "image_ref_alt",
helper_method=ctx._discover_or_create_image),
mock.call("compute", "flavor_ref",
helper_method=ctx._discover_or_create_flavor,
flv_ram=config.CONF.openstack.flavor_ref_ram,
flv_disk=config.CONF.openstack.flavor_ref_disk),
mock.call("compute", "flavor_ref_alt",
helper_method=ctx._discover_or_create_flavor,
flv_ram=config.CONF.openstack.flavor_ref_alt_ram,
flv_disk=config.CONF.openstack.flavor_ref_alt_disk),
mock.call("compute", "fixed_network_name",
helper_method=ctx._create_network_resources),
mock.call("orchestration", "instance_type",
helper_method=ctx._discover_or_create_flavor,
flv_ram=config.CONF.openstack.heat_instance_type_ram)],
mock__configure_option.call_args_list)
self.assertEqual([
mock.call("DEFAULT", "log_file", "/p/a/t/h/tempest.log"),
mock.call("oslo_concurrency", "lock_path", "/p/a/t/h/lock_files"),
mock.call("scenario", "img_dir", "/p/a/t/h"),
mock.call("scenario", "img_file", ctx.image_name,
helper_method=ctx._download_image),
mock.call("compute", "image_ref",
helper_method=ctx._discover_or_create_image),
mock.call("compute", "image_ref_alt",
helper_method=ctx._discover_or_create_image),
mock.call("compute", "flavor_ref",
helper_method=ctx._discover_or_create_flavor,
flv_ram=config.CONF.openstack.flavor_ref_ram,
flv_disk=config.CONF.openstack.flavor_ref_disk),
mock.call("compute", "flavor_ref_alt",
helper_method=ctx._discover_or_create_flavor,
flv_ram=config.CONF.openstack.flavor_ref_alt_ram,
flv_disk=config.CONF.openstack.flavor_ref_alt_disk),
mock.call("compute", "fixed_network_name",
helper_method=ctx._create_network_resources),
mock.call("orchestration", "instance_type",
helper_method=ctx._discover_or_create_flavor,
flv_ram=config.CONF.openstack.heat_instance_type_ram,
flv_disk=config.CONF.openstack.heat_instance_type_disk)
], mock__configure_option.call_args_list)