Merge "Prepare for enabling H302 rule (api/object_storage)"
diff --git a/tempest/api/object_storage/base.py b/tempest/api/object_storage/base.py
index ef36c3d..d08dc34 100644
--- a/tempest/api/object_storage/base.py
+++ b/tempest/api/object_storage/base.py
@@ -14,7 +14,7 @@
 #    under the License.
 
 
-from tempest.api.identity.base import DataGenerator
+from tempest.api.identity import base
 from tempest import clients
 from tempest.common import custom_matchers
 from tempest.common import isolated_creds
@@ -83,7 +83,7 @@
         cls.object_client_alt.auth_provider.clear_auth()
         cls.container_client_alt.auth_provider.clear_auth()
 
-        cls.data = DataGenerator(cls.identity_admin_client)
+        cls.data = base.DataGenerator(cls.identity_admin_client)
 
     @classmethod
     def tearDownClass(cls):
diff --git a/tempest/api/object_storage/test_account_services.py b/tempest/api/object_storage/test_account_services.py
index 79fd99d..5456768 100644
--- a/tempest/api/object_storage/test_account_services.py
+++ b/tempest/api/object_storage/test_account_services.py
@@ -18,8 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class AccountTest(base.BaseObjectTest):
@@ -38,7 +37,7 @@
         cls.delete_containers(cls.containers)
         super(AccountTest, cls).tearDownClass()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers(self):
         # list of all containers should not be empty
         params = {'format': 'json'}
@@ -51,14 +50,14 @@
         for container_name in self.containers:
             self.assertIn(container_name, container_names)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_extensions(self):
         resp, extensions = self.account_client.list_extensions()
 
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertThat(resp, custom_matchers.AreAllWellFormatted())
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_limit(self):
         # list containers one of them, half of them then all of them
         for limit in (1, self.containers_count / 2, self.containers_count):
@@ -69,7 +68,7 @@
 
             self.assertEqual(len(container_list), limit)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_marker(self):
         # list containers using marker param
         # first expect to get 0 container as we specified last
@@ -89,7 +88,7 @@
 
         self.assertEqual(len(container_list), self.containers_count / 2 - 1)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_end_marker(self):
         # list containers using end_marker param
         # first expect to get 0 container as we specified first container as
@@ -107,7 +106,7 @@
         self.assertHeaders(resp, 'Account', 'GET')
         self.assertEqual(len(container_list), self.containers_count / 2)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_containers_with_limit_and_marker(self):
         # list containers combining marker and limit param
         # result are always limitated by the limit whatever the marker
@@ -121,21 +120,21 @@
 
             self.assertTrue(len(container_list) <= limit, str(container_list))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_account_metadata(self):
         # list all account metadata
         resp, metadata = self.account_client.list_account_metadata()
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'HEAD')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_and_delete_account_metadata(self):
         header = 'test-account-meta'
         data = 'Meta!'
         # add metadata to account
         resp, _ = self.account_client.create_account_metadata(
             metadata={header: data})
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'POST')
 
         resp, _ = self.account_client.list_account_metadata()
@@ -147,7 +146,7 @@
         # delete metadata from account
         resp, _ = \
             self.account_client.delete_account_metadata(metadata=[header])
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Account', 'POST')
 
         resp, _ = self.account_client.list_account_metadata()
diff --git a/tempest/api/object_storage/test_container_acl.py b/tempest/api/object_storage/test_container_acl.py
index aae6b4d..085ef51 100644
--- a/tempest/api/object_storage/test_container_acl.py
+++ b/tempest/api/object_storage/test_container_acl.py
@@ -16,8 +16,7 @@
 from tempest.api.object_storage import base
 from tempest import clients
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectTestACLs(base.BaseObjectTest):
@@ -44,7 +43,7 @@
         self.delete_containers([self.container_name])
         super(ObjectTestACLs, self).tearDown()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_read_object_with_rights(self):
         # attempt to read object using authorized user
         # update X-Container-Read metadata ACL
@@ -53,7 +52,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -68,10 +67,10 @@
         )
         resp, _ = self.custom_object_client.get_object(
             self.container_name, object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_write_object_with_rights(self):
         # attempt to write object using authorized user
         # update X-Container-Write metadata ACL
@@ -80,7 +79,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object with rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -91,5 +90,5 @@
         resp, _ = self.custom_object_client.create_object(
             self.container_name,
             object_name, 'data')
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'PUT')
diff --git a/tempest/api/object_storage/test_container_acl_negative.py b/tempest/api/object_storage/test_container_acl_negative.py
index 1dc9bb5..a5a0950 100644
--- a/tempest/api/object_storage/test_container_acl_negative.py
+++ b/tempest/api/object_storage/test_container_acl_negative.py
@@ -18,8 +18,7 @@
 from tempest import clients
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectACLsNegativeTest(base.BaseObjectTest):
@@ -46,7 +45,7 @@
         self.delete_containers([self.container_name])
         super(ObjectACLsNegativeTest, self).tearDown()
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_write_object_without_using_creds(self):
         # trying to create object with empty headers
         # X-Auth-Token is not provided
@@ -59,7 +58,7 @@
                           self.custom_object_client.create_object,
                           self.container_name, object_name, 'data')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_object_without_using_creds(self):
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -75,7 +74,7 @@
                           self.custom_object_client.delete_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_write_object_with_non_authorized_user(self):
         # attempt to upload another file using non-authorized user
         # User provided token is forbidden. ACL are not set
@@ -89,7 +88,7 @@
                           self.custom_object_client.create_object,
                           self.container_name, object_name, 'data')
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_read_object_with_non_authorized_user(self):
         # attempt to read object using non-authorized user
         # User provided token is forbidden. ACL are not set
@@ -107,7 +106,7 @@
                           self.custom_object_client.get_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'gate'])
+    @test.attr(type=['negative', 'gate'])
     def test_delete_object_with_non_authorized_user(self):
         # attempt to delete object using non-authorized user
         # User provided token is forbidden. ACL are not set
@@ -125,7 +124,7 @@
                           self.custom_object_client.delete_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_read_object_without_rights(self):
         # attempt to read object using non-authorized user
         # update X-Container-Read metadata ACL
@@ -133,7 +132,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
@@ -150,7 +149,7 @@
                           self.custom_object_client.get_object,
                           self.container_name, object_name)
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_write_object_without_rights(self):
         # attempt to write object using non-authorized user
         # update X-Container-Write metadata ACL
@@ -158,7 +157,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object without rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -171,7 +170,7 @@
                           self.container_name,
                           object_name, 'data')
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_write_object_without_write_rights(self):
         # attempt to write object using non-authorized user
         # update X-Container-Read and X-Container-Write metadata ACL
@@ -181,7 +180,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # Trying to write the object without write rights
         self.custom_object_client.auth_provider.set_alt_auth_data(
@@ -194,7 +193,7 @@
                           self.container_name,
                           object_name, 'data')
 
-    @attr(type=['negative', 'smoke'])
+    @test.attr(type=['negative', 'smoke'])
     def test_delete_object_without_write_rights(self):
         # attempt to delete object using non-authorized user
         # update X-Container-Read and X-Container-Write metadata ACL
@@ -204,7 +203,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
         # create object
         object_name = data_utils.rand_name(name='Object')
diff --git a/tempest/api/object_storage/test_container_services.py b/tempest/api/object_storage/test_container_services.py
index 84cc91e..8689d10 100644
--- a/tempest/api/object_storage/test_container_services.py
+++ b/tempest/api/object_storage/test_container_services.py
@@ -15,8 +15,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ContainerTest(base.BaseObjectTest):
@@ -47,7 +46,7 @@
 
         return object_name
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container(self):
         container_name = data_utils.rand_name(name='TestContainer')
         resp, body = self.container_client.create_container(container_name)
@@ -55,7 +54,7 @@
         self.assertIn(resp['status'], ('202', '201'))
         self.assertHeaders(resp, 'Container', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_overwrite(self):
         # overwrite container with the same name
         container_name = data_utils.rand_name(name='TestContainer')
@@ -66,7 +65,7 @@
         self.assertIn(resp['status'], ('202', '201'))
         self.assertHeaders(resp, 'Container', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_metadata_key(self):
         # create container with the blank value of metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -84,7 +83,7 @@
         # in the server
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_metadata_value(self):
         # create container with metadata value
         container_name = data_utils.rand_name(name='TestContainer')
@@ -103,7 +102,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta'],
                          metadata['test-container-meta'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_remove_metadata_key(self):
         # create container with the blank value of remove metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -124,7 +123,7 @@
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_container_with_remove_metadata_value(self):
         # create container with remove metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -143,18 +142,18 @@
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_container(self):
         # create a container
         container_name = self._create_container()
         # delete container
         resp, _ = self.container_client.delete_container(container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'DELETE')
 
         self.containers.remove(container_name)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents(self):
         # get container contents list
         container_name = self._create_container()
@@ -162,22 +161,22 @@
 
         resp, object_list = self.container_client.list_container_contents(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_no_object(self):
         # get empty container contents list
         container_name = self._create_container()
 
         resp, object_list = self.container_client.list_container_contents(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual('', object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_delimiter(self):
         # get container contents list using delimiter param
         container_name = self._create_container()
@@ -188,11 +187,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name.split('/')[0], object_list.strip('/\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_end_marker(self):
         # get container contents list using end_marker param
         container_name = self._create_container()
@@ -202,11 +201,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_format_json(self):
         # get container contents list using format_json param
         container_name = self._create_container()
@@ -216,7 +215,7 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
 
         self.assertIsNotNone(object_list)
@@ -226,7 +225,7 @@
         self.assertTrue([c['content_type'] for c in object_list])
         self.assertTrue([c['last_modified'] for c in object_list])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_format_xml(self):
         # get container contents list using format_xml param
         container_name = self._create_container()
@@ -236,7 +235,7 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
 
         self.assertIsNotNone(object_list)
@@ -251,7 +250,7 @@
         self.assertEqual(object_list.find(".//last_modified").tag,
                          'last_modified')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_limit(self):
         # get container contents list using limit param
         container_name = self._create_container()
@@ -261,11 +260,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_marker(self):
         # get container contents list using marker param
         container_name = self._create_container()
@@ -275,11 +274,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_path(self):
         # get container contents list using path param
         container_name = self._create_container()
@@ -290,11 +289,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_contents_with_prefix(self):
         # get container contents list using prefix param
         container_name = self._create_container()
@@ -305,11 +304,11 @@
         resp, object_list = self.container_client.list_container_contents(
             container_name,
             params=params)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'GET')
         self.assertEqual(object_name, object_list.strip('\n'))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_container_metadata(self):
         # List container metadata
         container_name = self._create_container()
@@ -321,23 +320,23 @@
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
         self.assertIn('x-container-meta-name', resp)
         self.assertEqual(resp['x-container-meta-name'], metadata['name'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_list_no_container_metadata(self):
         # HEAD container without metadata
         container_name = self._create_container()
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
         self.assertNotIn('x-container-meta-', str(resp))
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_and_delete_matadata(self):
         # Send one request of adding and deleting metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -351,7 +350,7 @@
             container_name,
             metadata=metadata_2,
             remove_metadata=metadata_1)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
@@ -361,7 +360,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta2'],
                          metadata_2['test-container-meta2'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_metadata(self):
         # update container metadata using add metadata
         container_name = self._create_container()
@@ -370,7 +369,7 @@
         resp, _ = self.container_client.update_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
@@ -379,7 +378,7 @@
         self.assertEqual(resp['x-container-meta-test-container-meta1'],
                          metadata['test-container-meta1'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_delete_metadata(self):
         # update container metadata using delete metadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -391,14 +390,14 @@
         resp, _ = self.container_client.delete_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta1', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_create_matadata_key(self):
         # update container metadata with a blenk value of metadata
         container_name = self._create_container()
@@ -407,14 +406,14 @@
         resp, _ = self.container_client.update_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(
             container_name)
         self.assertNotIn('x-container-meta-test-container-meta1', resp)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_update_container_metadata_with_delete_metadata_key(self):
         # update container metadata with a blank value of matadata
         container_name = data_utils.rand_name(name='TestContainer')
@@ -427,7 +426,7 @@
         resp, _ = self.container_client.delete_container_metadata(
             container_name,
             metadata=metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'POST')
 
         resp, _ = self.container_client.list_container_metadata(container_name)
diff --git a/tempest/api/object_storage/test_container_sync.py b/tempest/api/object_storage/test_container_sync.py
index 207fced..9bd986f 100644
--- a/tempest/api/object_storage/test_container_sync.py
+++ b/tempest/api/object_storage/test_container_sync.py
@@ -19,8 +19,7 @@
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
 from tempest import config
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 CONF = config.CONF
 
@@ -66,7 +65,7 @@
             cls.delete_containers(cls.containers, client[0], client[1])
         super(ContainerSyncTest, cls).tearDownClass()
 
-    @attr(type='slow')
+    @test.attr(type='slow')
     def test_container_synchronization(self):
         # container to container synchronization
         # to allow/accept sync requests to/from other accounts
@@ -86,12 +85,12 @@
                        (client_base_url, str(cont[1]))}
             resp, body = \
                 cont_client[0].put(str(cont[0]), body=None, headers=headers)
-            self.assertIn(int(resp['status']), HTTP_SUCCESS)
+            self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
             # create object in container
             object_name = data_utils.rand_name(name='TestSyncObject')
             data = object_name[::-1]  # data_utils.arbitrary_string()
             resp, _ = obj_client[0].create_object(cont[0], object_name, data)
-            self.assertIn(int(resp['status']), HTTP_SUCCESS)
+            self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
             self.objects.append(object_name)
 
         # wait until container contents list is not empty
@@ -104,7 +103,7 @@
                     cont_client[client_index].\
                     list_container_contents(self.containers[client_index],
                                             params=params)
-                self.assertIn(int(resp['status']), HTTP_SUCCESS)
+                self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
                 object_lists.append(dict(
                     (obj['name'], obj) for obj in object_list))
             # check that containers are not empty and have equal keys()
@@ -124,5 +123,5 @@
         for obj_client, cont in obj_clients:
             for obj_name in object_lists[0]:
                 resp, object_content = obj_client.get_object(cont, obj_name)
-                self.assertIn(int(resp['status']), HTTP_SUCCESS)
+                self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
                 self.assertEqual(object_content, obj_name[::-1])
diff --git a/tempest/api/object_storage/test_healthcheck.py b/tempest/api/object_storage/test_healthcheck.py
index 35aee2a..e27c7ef 100644
--- a/tempest/api/object_storage/test_healthcheck.py
+++ b/tempest/api/object_storage/test_healthcheck.py
@@ -17,8 +17,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class HealthcheckTest(base.BaseObjectTest):
@@ -32,13 +31,13 @@
         # Turning http://.../v1/foobar into http://.../
         self.account_client.skip_path()
 
-    @attr('gate')
+    @test.attr('gate')
     def test_get_healthcheck(self):
 
         resp, _ = self.account_client.get("healthcheck", {})
 
         # The status is expected to be 200
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
 
         # The target of the request is not any Swift resource. Therefore, the
         # existence of response header is checked without a custom matcher.
diff --git a/tempest/api/object_storage/test_object_expiry.py b/tempest/api/object_storage/test_object_expiry.py
index 3aae0a1..53ca20d 100644
--- a/tempest/api/object_storage/test_object_expiry.py
+++ b/tempest/api/object_storage/test_object_expiry.py
@@ -18,7 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
 from tempest import exceptions
-from tempest.test import attr
+from tempest import test
 
 
 class ObjectExpiryTest(base.BaseObjectTest):
@@ -67,12 +67,12 @@
         self.assertRaises(exceptions.NotFound, self.object_client.get_object,
                           self.container_name, self.object_name)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_after_expiry_time(self):
         metadata = {'X-Delete-After': '3'}
         self._test_object_expiry(metadata)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_at_expiry_time(self):
         metadata = {'X-Delete-At': str(int(time.time()) + 3)}
         self._test_object_expiry(metadata)
diff --git a/tempest/api/object_storage/test_object_formpost.py b/tempest/api/object_storage/test_object_formpost.py
index 6f46ec9..98e36b5 100644
--- a/tempest/api/object_storage/test_object_formpost.py
+++ b/tempest/api/object_storage/test_object_formpost.py
@@ -21,8 +21,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectFormPostTest(base.BaseObjectTest):
@@ -93,7 +92,7 @@
         content_type = 'multipart/form-data; boundary=%s' % boundary
         return body, content_type
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_post_object_using_form(self):
         body, content_type = self.get_multipart_form()
 
@@ -107,12 +106,12 @@
         # Use a raw request, otherwise authentication headers are used
         resp, body = self.object_client.http_obj.request(url, "POST",
                                                          body, headers=headers)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, "Object", "POST")
 
         # Ensure object is available
         resp, body = self.object_client.get("%s/%s%s" % (
             self.container_name, self.object_name, "testfile"))
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, "Object", "GET")
         self.assertEqual(body, "hello world")
diff --git a/tempest/api/object_storage/test_object_services.py b/tempest/api/object_storage/test_object_services.py
index 6f349b6..33f3299 100644
--- a/tempest/api/object_storage/test_object_services.py
+++ b/tempest/api/object_storage/test_object_services.py
@@ -18,8 +18,7 @@
 from tempest.api.object_storage import base
 from tempest.common import custom_matchers
 from tempest.common.utils import data_utils
-from tempest.test import attr
-from tempest.test import HTTP_SUCCESS
+from tempest import test
 
 
 class ObjectTest(base.BaseObjectTest):
@@ -35,7 +34,7 @@
         cls.delete_containers(cls.containers)
         super(ObjectTest, cls).tearDownClass()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_create_object(self):
         # create object
         object_name = data_utils.rand_name(name='TestObject')
@@ -50,7 +49,7 @@
         self.assertEqual(resp['status'], '201')
         self.assertHeaders(resp, 'Object', 'PUT')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_delete_object(self):
         # create object
         object_name = data_utils.rand_name(name='TestObject')
@@ -60,10 +59,10 @@
         # delete object
         resp, _ = self.object_client.delete_object(self.container_name,
                                                    object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'DELETE')
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_object_metadata(self):
         # add metadata to storage object, test if metadata is retrievable
 
@@ -78,20 +77,20 @@
         orig_metadata = {meta_key: meta_value}
         resp, _ = self.object_client.update_object_metadata(
             self.container_name, object_name, orig_metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'POST')
 
         # get object metadata
         resp, resp_metadata = self.object_client.list_object_metadata(
             self.container_name, object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'HEAD')
 
         actual_meta_key = 'x-object-meta-' + meta_key
         self.assertIn(actual_meta_key, resp)
         self.assertEqual(resp[actual_meta_key], meta_value)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_get_object(self):
         # retrieve object's data (in response body)
 
@@ -103,12 +102,12 @@
         # get object
         resp, body = self.object_client.get_object(self.container_name,
                                                    object_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
         self.assertEqual(body, data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_in_same_container(self):
         # create source object
         src_object_name = data_utils.rand_name(name='SrcObject')
@@ -135,7 +134,7 @@
                                                    dst_object_name)
         self.assertEqual(body, src_data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_to_itself(self):
         # change the content type of an existing object
 
@@ -160,7 +159,7 @@
                                                           object_name)
         self.assertEqual(resp['content-type'], metadata['content-type'])
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_2d_way(self):
         # create source object
         src_object_name = data_utils.rand_name(name='SrcObject')
@@ -195,7 +194,7 @@
                                                    dst_object_name)
         self.assertEqual(body, src_data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_copy_object_across_containers(self):
         # create a container to use as  asource container
         src_container_name = data_utils.rand_name(name='TestSourceContainer')
@@ -219,7 +218,7 @@
         resp, _ = self.object_client.update_object_metadata(src_container_name,
                                                             object_name,
                                                             orig_metadata)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'POST')
 
         # copy object from source container to destination container
@@ -237,7 +236,7 @@
         self.assertIn(actual_meta_key, resp)
         self.assertEqual(resp[actual_meta_key], meta_value)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_object_upload_in_segments(self):
         # create object
         object_name = data_utils.rand_name(name='LObject')
@@ -280,7 +279,7 @@
             self.container_name, object_name)
         self.assertEqual(''.join(data_segments), body)
 
-    @attr(type='gate')
+    @test.attr(type='gate')
     def test_get_object_if_different(self):
         # http://en.wikipedia.org/wiki/HTTP_ETag
         # Make a conditional request for an object using the If-None-Match
@@ -312,7 +311,7 @@
         md5 = hashlib.md5(local_data).hexdigest()
         headers = {'If-None-Match': md5}
         resp, body = self.object_client.get(url, headers=headers)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Object', 'GET')
 
 
@@ -326,7 +325,7 @@
         self.delete_containers([self.container_name])
         super(PublicObjectTest, self).tearDown()
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_access_public_container_object_without_using_creds(self):
         # make container public-readable and access an object in it object
         # anonymously, without using credentials
@@ -335,7 +334,7 @@
         cont_headers = {'X-Container-Read': '.r:*,.rlistings'}
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers, metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
 
         # create object
@@ -350,7 +349,7 @@
         # list container metadata
         resp_meta, _ = self.container_client.list_container_metadata(
             self.container_name)
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'HEAD')
 
         self.assertIn('x-container-read', resp_meta)
@@ -367,7 +366,7 @@
 
         self.assertEqual(body, data)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_access_public_object_with_another_user_creds(self):
         # make container public-readable and access an object in it using
         # another user's credentials
@@ -375,7 +374,7 @@
         resp_meta, body = self.container_client.update_container_metadata(
             self.container_name, metadata=cont_headers,
             metadata_prefix='')
-        self.assertIn(int(resp_meta['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp_meta['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp_meta, 'Container', 'POST')
 
         # create object
@@ -390,7 +389,7 @@
         # list container metadata
         resp, _ = self.container_client.list_container_metadata(
             self.container_name)
-        self.assertIn(int(resp['status']), HTTP_SUCCESS)
+        self.assertIn(int(resp['status']), test.HTTP_SUCCESS)
         self.assertHeaders(resp, 'Container', 'HEAD')
 
         self.assertIn('x-container-read', resp)
diff --git a/tempest/api/object_storage/test_object_version.py b/tempest/api/object_storage/test_object_version.py
index 75293d2..8d2ff9b 100644
--- a/tempest/api/object_storage/test_object_version.py
+++ b/tempest/api/object_storage/test_object_version.py
@@ -15,7 +15,7 @@
 
 from tempest.api.object_storage import base
 from tempest.common.utils import data_utils
-from tempest.test import attr
+from tempest import test
 
 
 class ContainerTest(base.BaseObjectTest):
@@ -40,7 +40,7 @@
         header_value = resp.get('x-versions-location', 'Missing Header')
         self.assertEqual(header_value, versioned)
 
-    @attr(type='smoke')
+    @test.attr(type='smoke')
     def test_versioned_container(self):
         # create container
         vers_container_name = data_utils.rand_name(name='TestVersionContainer')