Add more information for tests
Change-Id: Id0b1056398e1b186a336eec4244c446b5767e1a0
This commit is contained in:
parent
3b05f784a8
commit
6fe5230a34
@ -164,9 +164,15 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
|||||||
self.keypair = self.create_keypair()
|
self.keypair = self.create_keypair()
|
||||||
self.keypair_name = self.keypair.id
|
self.keypair_name = self.keypair.id
|
||||||
|
|
||||||
@classmethod
|
def _stack_rand_name(self):
|
||||||
def _stack_rand_name(cls):
|
test_name = self.id()
|
||||||
return rand_name(cls.__name__)
|
if test_name and '.' in test_name:
|
||||||
|
name = '-'.join(test_name.split('.')[-2:])
|
||||||
|
# remove 'testname(...)' cases
|
||||||
|
name = name.split('(')[0]
|
||||||
|
else:
|
||||||
|
name = self.__name__
|
||||||
|
return rand_name(name)
|
||||||
|
|
||||||
def _get_network(self, net_name=None):
|
def _get_network(self, net_name=None):
|
||||||
if net_name is None:
|
if net_name is None:
|
||||||
@ -228,7 +234,7 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
|||||||
fail_regexp = re.compile(failure_pattern)
|
fail_regexp = re.compile(failure_pattern)
|
||||||
build_timeout = self.conf.build_timeout
|
build_timeout = self.conf.build_timeout
|
||||||
build_interval = self.conf.build_interval
|
build_interval = self.conf.build_interval
|
||||||
|
res = None
|
||||||
start = timeutils.utcnow()
|
start = timeutils.utcnow()
|
||||||
while timeutils.delta_seconds(start,
|
while timeutils.delta_seconds(start,
|
||||||
timeutils.utcnow()) < build_timeout:
|
timeutils.utcnow()) < build_timeout:
|
||||||
@ -254,9 +260,11 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
|||||||
resource_status_reason=res.resource_status_reason)
|
resource_status_reason=res.resource_status_reason)
|
||||||
time.sleep(build_interval)
|
time.sleep(build_interval)
|
||||||
|
|
||||||
message = ('Resource %s failed to reach %s status within '
|
message = ('Resource %s from stack %s failed to reach %s status '
|
||||||
'the required time (%s s).' %
|
'within the required time (%s s). Current resource '
|
||||||
(resource_name, status, build_timeout))
|
'status: %s.' %
|
||||||
|
(resource_name, stack_identifier, status, build_timeout,
|
||||||
|
res.resource_status))
|
||||||
raise exceptions.TimeoutException(message)
|
raise exceptions.TimeoutException(message)
|
||||||
|
|
||||||
def verify_resource_status(self, stack_identifier, resource_name,
|
def verify_resource_status(self, stack_identifier, resource_name,
|
||||||
@ -352,8 +360,9 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
|||||||
time.sleep(build_interval)
|
time.sleep(build_interval)
|
||||||
|
|
||||||
message = ('Stack %s failed to reach %s status within '
|
message = ('Stack %s failed to reach %s status within '
|
||||||
'the required time (%s s).' %
|
'the required time (%s s). Current stack state: %s.' %
|
||||||
(stack_identifier, status, build_timeout))
|
(stack_identifier, status, build_timeout,
|
||||||
|
stack.stack_status))
|
||||||
raise exceptions.TimeoutException(message)
|
raise exceptions.TimeoutException(message)
|
||||||
|
|
||||||
def _stack_delete(self, stack_identifier):
|
def _stack_delete(self, stack_identifier):
|
||||||
|
Loading…
Reference in New Issue
Block a user