Changes to ensure delete_containers is done at class level tear down
Invoking delete containers at test level tearDown caused: 1) unnecessary requests are being sent again in the tearDown for the subsequent methods, 2) possible race condition can happen between methods during the tearDown. Closes-Bug: #1938593 Change-Id: I24087607a9f0129b7b3d21473196fab1b5f08cd4
This commit is contained in:
parent
027a27c65d
commit
3c7159d2e3
|
@ -31,9 +31,10 @@ class ObjectTestACLs(base.BaseObjectTest):
|
||||||
super(ObjectTestACLs, self).setUp()
|
super(ObjectTestACLs, self).setUp()
|
||||||
self.container_name = self.create_container()
|
self.container_name = self.create_container()
|
||||||
|
|
||||||
def tearDown(self):
|
@classmethod
|
||||||
self.delete_containers()
|
def resource_cleanup(cls):
|
||||||
super(ObjectTestACLs, self).tearDown()
|
cls.delete_containers()
|
||||||
|
super(ObjectTestACLs, cls).resource_cleanup()
|
||||||
|
|
||||||
@decorators.idempotent_id('a3270f3f-7640-4944-8448-c7ea783ea5b6')
|
@decorators.idempotent_id('a3270f3f-7640-4944-8448-c7ea783ea5b6')
|
||||||
def test_read_object_with_rights(self):
|
def test_read_object_with_rights(self):
|
||||||
|
|
|
@ -42,9 +42,10 @@ class ObjectACLsNegativeTest(base.BaseObjectTest):
|
||||||
self.container_name = data_utils.rand_name(name='TestContainer')
|
self.container_name = data_utils.rand_name(name='TestContainer')
|
||||||
self.container_client.update_container(self.container_name)
|
self.container_client.update_container(self.container_name)
|
||||||
|
|
||||||
def tearDown(self):
|
@classmethod
|
||||||
self.delete_containers([self.container_name])
|
def resource_cleanup(cls):
|
||||||
super(ObjectACLsNegativeTest, self).tearDown()
|
cls.delete_containers()
|
||||||
|
super(ObjectACLsNegativeTest, cls).resource_cleanup()
|
||||||
|
|
||||||
@decorators.attr(type=['negative'])
|
@decorators.attr(type=['negative'])
|
||||||
@decorators.idempotent_id('af587587-0c24-4e15-9822-8352ce711013')
|
@decorators.idempotent_id('af587587-0c24-4e15-9822-8352ce711013')
|
||||||
|
|
|
@ -44,10 +44,10 @@ class ContainerQuotasTest(base.BaseObjectTest):
|
||||||
self.container_client.create_update_or_delete_container_metadata(
|
self.container_client.create_update_or_delete_container_metadata(
|
||||||
self.container_name, create_update_metadata=metadata)
|
self.container_name, create_update_metadata=metadata)
|
||||||
|
|
||||||
def tearDown(self):
|
@classmethod
|
||||||
"""Cleans the container of any object after each test."""
|
def resource_cleanup(cls):
|
||||||
self.delete_containers()
|
cls.delete_containers()
|
||||||
super(ContainerQuotasTest, self).tearDown()
|
super(ContainerQuotasTest, cls).resource_cleanup()
|
||||||
|
|
||||||
@decorators.idempotent_id('9a0fb034-86af-4df0-86fa-f8bd7db21ae0')
|
@decorators.idempotent_id('9a0fb034-86af-4df0-86fa-f8bd7db21ae0')
|
||||||
@utils.requires_ext(extension='container_quotas', service='object')
|
@utils.requires_ext(extension='container_quotas', service='object')
|
||||||
|
|
|
@ -21,9 +21,10 @@ from tempest.lib import decorators
|
||||||
class ContainerTest(base.BaseObjectTest):
|
class ContainerTest(base.BaseObjectTest):
|
||||||
"""Test containers"""
|
"""Test containers"""
|
||||||
|
|
||||||
def tearDown(self):
|
@classmethod
|
||||||
self.delete_containers()
|
def resource_cleanup(cls):
|
||||||
super(ContainerTest, self).tearDown()
|
cls.delete_containers()
|
||||||
|
super(ContainerTest, cls).resource_cleanup()
|
||||||
|
|
||||||
@decorators.attr(type='smoke')
|
@decorators.attr(type='smoke')
|
||||||
@decorators.idempotent_id('92139d73-7819-4db1-85f8-3f2f22a8d91f')
|
@decorators.idempotent_id('92139d73-7819-4db1-85f8-3f2f22a8d91f')
|
||||||
|
|
Loading…
Reference in New Issue