diff options
author | Dan Smith <dansmith@redhat.com> | 2023-05-04 09:06:41 -0700 |
---|---|---|
committer | Dan Smith <dansmith@redhat.com> | 2023-05-04 14:52:51 -0700 |
commit | 6574469293645c492c8d951a0ef81174287663ee (patch) | |
tree | 4059757baa1035883a98842d0791638a01a03138 | |
parent | 8f9c77b368285a732f59594abbe3cadd5f7f52f6 (diff) | |
download | tempest-6574469293645c492c8d951a0ef81174287663ee.tar.gz |
Allow passing validation_resources in scenario
In the scenario manager, we need to pass through validation parameters
if they are passed to us. If not, we need to do the needful for
SSHABLE targets, but some tests need to pass in their own. Note that
the scenario manager create_server() already has a validatable
parameter, but it does *not* pass that through to create_test_server(),
so we also need to fix that up for those cases to avoid tripping
over the assertion requirement that it be provided.
Change-Id: I44b3deba70e3f33f1287a6b3f28c21da5492cc04
-rw-r--r-- | tempest/scenario/manager.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index 22c053088..20495eeaf 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -195,7 +195,7 @@ class ScenarioTest(tempest.test.BaseTestCase): return body['keypair'] def create_server(self, name=None, image_id=None, flavor=None, - validatable=False, wait_until='ACTIVE', + validatable=None, wait_until='ACTIVE', clients=None, **kwargs): """Wrapper utility that returns a test server. @@ -320,8 +320,10 @@ class ScenarioTest(tempest.test.BaseTestCase): kwargs.setdefault('availability_zone', CONF.compute.compute_volume_common_az) + kwargs['validatable'] = bool(validatable) keypair = kwargs.pop('keypair', None) - if wait_until == 'SSHABLE': + if wait_until == 'SSHABLE' and ( + kwargs.get('validation_resources') is None): # NOTE(danms): We should do this whether valdiation is enabled or # not to consistently provide the resources to the # create_test_server() function. If validation is disabled, then @@ -333,8 +335,10 @@ class ScenarioTest(tempest.test.BaseTestCase): validation_resources = copy.deepcopy(validation_resources) validation_resources.update( keypair=keypair) - kwargs.update({'validatable': True, - 'validation_resources': validation_resources}) + kwargs.update({ + 'validatable': (validatable if validatable is not None + else True), + 'validation_resources': validation_resources}) if keypair: kwargs.update({'key_name': keypair['name']}) |