Merge "Make recreate_server() wait until SSHABLE"

This commit is contained in:
Zuul 2022-05-17 11:24:02 +00:00 committed by Gerrit Code Review
commit 569c7a89f5
2 changed files with 5 additions and 4 deletions

View File

@ -412,7 +412,8 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest,
return image return image
@classmethod @classmethod
def recreate_server(cls, server_id, validatable=False, **kwargs): def recreate_server(cls, server_id, validatable=False, wait_until='ACTIVE',
**kwargs):
"""Destroy an existing class level server and creates a new one """Destroy an existing class level server and creates a new one
Some test classes use a test server that can be used by multiple Some test classes use a test server that can be used by multiple
@ -440,7 +441,7 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest,
validatable, validatable,
validation_resources=cls.get_class_validation_resources( validation_resources=cls.get_class_validation_resources(
cls.os_primary), cls.os_primary),
wait_until='ACTIVE', wait_until=wait_until,
adminPass=cls.password, adminPass=cls.password,
**kwargs) **kwargs)
return server['id'] return server['id']

View File

@ -65,12 +65,12 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
server = self.create_test_server( server = self.create_test_server(
validatable=True, validatable=True,
validation_resources=validation_resources, validation_resources=validation_resources,
wait_until='ACTIVE') wait_until='SSHABLE')
self.__class__.server_id = server['id'] self.__class__.server_id = server['id']
except Exception: except Exception:
# Rebuild server if something happened to it during a test # Rebuild server if something happened to it during a test
self.__class__.server_id = self.recreate_server( self.__class__.server_id = self.recreate_server(
self.server_id, validatable=True) self.server_id, validatable=True, wait_until='SSHABLE')
def tearDown(self): def tearDown(self):
super(ServerActionsTestJSON, self).tearDown() super(ServerActionsTestJSON, self).tearDown()