blob: 453abe7126e8cb0bbf35f55153c35a33543e8e55 [file] [log] [blame]
Peter Stachowski320f9c72014-04-21 16:13:23 -04001# 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.api.database import base
17from tempest import test
18
19
20class DatabaseVersionsTest(base.BaseDatabaseTest):
21 _interface = 'json'
22
23 @classmethod
24 def setUpClass(cls):
25 super(DatabaseVersionsTest, cls).setUpClass()
26 cls.client = cls.database_versions_client
27
28 @test.attr(type='smoke')
29 def test_list_db_versions(self):
Swapnil Kulkarni59c7f9b2014-08-20 14:55:23 +000030 _, versions = self.client.list_db_versions()
Peter Stachowski320f9c72014-04-21 16:13:23 -040031 self.assertTrue(len(versions) > 0, "No database versions found")
32 # List of all versions should contain the current version, and there
33 # should only be one 'current' version
34 current_versions = list()
35 for version in versions:
36 if 'CURRENT' == version['status']:
37 current_versions.append(version['id'])
38 self.assertEqual(1, len(current_versions))
39 self.assertIn(self.db_current_version, current_versions)