Split resource_setup for database tests
Split up the resource_setup method for all the database tests, as per the
latest spec.
Partially-implements bp:resource-cleanup
Change-Id: I37278495084e6474ee85ff293f18358b307986aa
diff --git a/tempest/api/database/base.py b/tempest/api/database/base.py
index dd4c684..e67df24 100644
--- a/tempest/api/database/base.py
+++ b/tempest/api/database/base.py
@@ -27,19 +27,29 @@
_interface = 'json'
@classmethod
- def resource_setup(cls):
- super(BaseDatabaseTest, cls).resource_setup()
+ def skip_checks(cls):
+ super(BaseDatabaseTest, cls).skip_checks()
if not CONF.service_available.trove:
skip_msg = ("%s skipped as trove is not available" % cls.__name__)
raise cls.skipException(skip_msg)
- cls.catalog_type = CONF.database.catalog_type
- cls.db_flavor_ref = CONF.database.db_flavor_ref
- cls.db_current_version = CONF.database.db_current_version
+ @classmethod
+ def setup_credentials(cls):
+ super(BaseDatabaseTest, cls).setup_credentials()
+ cls.os = cls.get_client_manager()
- os = cls.get_client_manager()
- cls.os = os
+ @classmethod
+ def setup_clients(cls):
+ super(BaseDatabaseTest, cls).setup_clients()
cls.database_flavors_client = cls.os.database_flavors_client
cls.os_flavors_client = cls.os.flavors_client
cls.database_limits_client = cls.os.database_limits_client
cls.database_versions_client = cls.os.database_versions_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(BaseDatabaseTest, cls).resource_setup()
+
+ cls.catalog_type = CONF.database.catalog_type
+ cls.db_flavor_ref = CONF.database.db_flavor_ref
+ cls.db_current_version = CONF.database.db_current_version
diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py
index ed172e9..bb7035b 100644
--- a/tempest/api/database/flavors/test_flavors.py
+++ b/tempest/api/database/flavors/test_flavors.py
@@ -20,8 +20,8 @@
class DatabaseFlavorsTest(base.BaseDatabaseTest):
@classmethod
- def resource_setup(cls):
- super(DatabaseFlavorsTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(DatabaseFlavorsTest, cls).setup_clients()
cls.client = cls.database_flavors_client
@test.attr(type='smoke')
diff --git a/tempest/api/database/flavors/test_flavors_negative.py b/tempest/api/database/flavors/test_flavors_negative.py
index 9f14cce..f8c7b83 100644
--- a/tempest/api/database/flavors/test_flavors_negative.py
+++ b/tempest/api/database/flavors/test_flavors_negative.py
@@ -21,8 +21,8 @@
class DatabaseFlavorsNegativeTest(base.BaseDatabaseTest):
@classmethod
- def resource_setup(cls):
- super(DatabaseFlavorsNegativeTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(DatabaseFlavorsNegativeTest, cls).setup_clients()
cls.client = cls.database_flavors_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/database/versions/test_versions.py b/tempest/api/database/versions/test_versions.py
index 80fcecf..26d5cb2 100644
--- a/tempest/api/database/versions/test_versions.py
+++ b/tempest/api/database/versions/test_versions.py
@@ -21,8 +21,8 @@
_interface = 'json'
@classmethod
- def resource_setup(cls):
- super(DatabaseVersionsTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(DatabaseVersionsTest, cls).setup_clients()
cls.client = cls.database_versions_client
@test.attr(type='smoke')