fix: cleanup api tests

- delete a service, created in a test to execute a patch

- assign timeouts from conf file, rather than use defaults

- add Error message, to make sure we log the amount of time spent by the
  test awaiting service state transitions.

Change-Id: Ib3bbc4480ad8afa386cd46ba40d65b0781917af5
This commit is contained in:
Sriram Madapusi Vasudevan 2015-09-22 10:29:52 -04:00
parent 7082481797
commit 72a0d26d01
3 changed files with 11 additions and 3 deletions

View File

@ -304,6 +304,8 @@ class TestServicePatch(base.TestBase):
request_body=add_duplicate_domain)
self.assertEqual(resp.status_code, 400)
self.client.delete_service(location=service_url)
def tearDown(self):
self.client.delete_service(location=self.service_url)
if self.test_config.generate_flavors:

View File

@ -369,7 +369,9 @@ class TestServiceActions(base.TestBase):
self.client.wait_for_service_status(
location=self.service_url,
status='deployed',
abort_on_status='failed')
abort_on_status='failed',
retry_interval=self.test_config.status_check_retry_interval,
retry_timeout=self.test_config.status_check_retry_timeout)
@attrib.attr('smoke')
def test_delete_service(self):

View File

@ -371,7 +371,9 @@ class PoppyClient(client.AutoMarshallingHTTPClient):
current_time = int(time.time())
if current_time > stop_time:
assert False, ('Timed out waiting for service status change'
' to {0}').format(status)
' to {0} after '
'waiting {1} seconds').format(status,
retry_timeout)
def wait_for_service_delete(self, location,
abort_on_status=None,
@ -399,4 +401,6 @@ class PoppyClient(client.AutoMarshallingHTTPClient):
current_time = int(time.time())
if current_time > stop_time:
assert False, ('Timed out waiting for service to be deleted')
assert False, ('Timed out waiting for service '
'to be deleted, after '
'waiting {0} seconds'.format(retry_timeout))