blob: 01e05dbd9fa4014aad9ce82bed0e716ec9fce31b [file] [log] [blame]
Nikhil Manchandadd6886f2014-03-03 01:58:45 -08001# Copyright 2014 OpenStack Foundation
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16from tempest import config
Nikhil Manchandadd6886f2014-03-03 01:58:45 -080017import tempest.test
18
19CONF = config.CONF
Nikhil Manchandadd6886f2014-03-03 01:58:45 -080020
21
22class BaseDatabaseTest(tempest.test.BaseTestCase):
23 """Base test case class for all Database API tests."""
24
Andrea Frittolib21de6c2015-02-06 20:12:38 +000025 credentials = ['primary']
26
Nikhil Manchandadd6886f2014-03-03 01:58:45 -080027 @classmethod
Rohan Kanade37497b42015-02-05 13:39:57 +053028 def skip_checks(cls):
29 super(BaseDatabaseTest, cls).skip_checks()
Nikhil Manchandadd6886f2014-03-03 01:58:45 -080030 if not CONF.service_available.trove:
31 skip_msg = ("%s skipped as trove is not available" % cls.__name__)
32 raise cls.skipException(skip_msg)
33
Rohan Kanade37497b42015-02-05 13:39:57 +053034 @classmethod
Rohan Kanade37497b42015-02-05 13:39:57 +053035 def setup_clients(cls):
36 super(BaseDatabaseTest, cls).setup_clients()
Nikhil Manchandadd6886f2014-03-03 01:58:45 -080037 cls.database_flavors_client = cls.os.database_flavors_client
Peter Stachowskide82ad72014-04-21 14:12:33 -040038 cls.os_flavors_client = cls.os.flavors_client
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +000039 cls.database_limits_client = cls.os.database_limits_client
Peter Stachowski320f9c72014-04-21 16:13:23 -040040 cls.database_versions_client = cls.os.database_versions_client
Rohan Kanade37497b42015-02-05 13:39:57 +053041
42 @classmethod
43 def resource_setup(cls):
44 super(BaseDatabaseTest, cls).resource_setup()
45
46 cls.catalog_type = CONF.database.catalog_type
47 cls.db_flavor_ref = CONF.database.db_flavor_ref
48 cls.db_current_version = CONF.database.db_current_version