summaryrefslogtreecommitdiff
path: root/tempest
diff options
context:
space:
mode:
Diffstat (limited to 'tempest')
-rw-r--r--tempest/api/volume/base.py8
-rw-r--r--tempest/api/volume/test_volumes_extend.py5
-rw-r--r--tempest/common/compute.py5
-rw-r--r--tempest/test.py2
-rw-r--r--tempest/tests/test_test.py2
5 files changed, 16 insertions, 6 deletions
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index ae1dc8ade..a31390a98 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -225,6 +225,14 @@ class BaseVolumeTest(api_version_utils.BaseMicroversionTest,
'name',
data_utils.rand_name(self.__class__.__name__ + '-instance'))
+ if wait_until == 'SSHABLE' and not kwargs.get('validation_resources'):
+ # If we were asked for SSHABLE but were not provided with the
+ # required validation_resources and validatable flag, ensure we
+ # pass them to create_test_server() so that it will actually wait.
+ kwargs['validation_resources'] = (
+ self.get_test_validation_resources(self.os_primary))
+ kwargs['validatable'] = True
+
tenant_network = self.get_tenant_network()
body, _ = compute.create_test_server(
self.os_primary,
diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py
index 51405b881..906697999 100644
--- a/tempest/api/volume/test_volumes_extend.py
+++ b/tempest/api/volume/test_volumes_extend.py
@@ -114,10 +114,7 @@ class BaseVolumesExtendAttachedTest(base.BaseVolumeTest):
if the action on the server fails.
"""
# Create a test server. Will be automatically cleaned up on teardown.
- validation_resources = self.get_test_validation_resources(
- self.os_primary)
- server = self.create_server(wait_until='SSHABLE', validatable=True,
- validation_resources=validation_resources)
+ server = self.create_server(wait_until='SSHABLE')
# Attach the volume to the server and wait for the volume status to be
# "in-use".
self.attach_volume(server['id'], volume['id'])
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index be8766dc9..7fa82478d 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -299,6 +299,11 @@ def create_test_server(clients, validatable=False, validation_resources=None,
if wait_until:
+ if wait_until == 'SSHABLE' and not (
+ validatable and validation_resources is not None):
+ raise RuntimeError('SSHABLE requires validatable=True and '
+ 'validation_resources to be passed')
+
# NOTE(lyarwood): PINGABLE and SSHABLE both require the instance to
# go ACTIVE initially before we can setup the fip(s) etc so stash
# this additional wait state for later use.
diff --git a/tempest/test.py b/tempest/test.py
index d49458e72..33602214a 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -809,7 +809,7 @@ class BaseTestCase(testtools.testcase.WithAttributes,
@param os_clients: Clients to be used to provision the resources.
"""
if not CONF.validation.run_validation:
- return
+ return {}
if os_clients in cls._validation_resources:
return cls._validation_resources[os_clients]
diff --git a/tempest/tests/test_test.py b/tempest/tests/test_test.py
index 26e80796f..80825a489 100644
--- a/tempest/tests/test_test.py
+++ b/tempest/tests/test_test.py
@@ -69,7 +69,7 @@ class TestValidationResources(base.TestCase):
creds = fake_credentials.FakeKeystoneV3Credentials()
osclients = clients.Manager(creds)
vr = self.test_test_class.get_class_validation_resources(osclients)
- self.assertIsNone(vr)
+ self.assertEqual({}, vr)
def test_validation_resources_exists(self):
cfg.CONF.set_default('run_validation', True, 'validation')