blob: e594b3eeff05a0fba63edb925b76b344162d9896 [file] [log] [blame]
Roman Prykhodchenko62b1ed12013-10-16 21:51:47 +03001# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from tempest.api.baremetal import base
14from tempest import test
15
16
17class TestApiDiscovery(base.BaseBaremetalTest):
18 """Tests for API discovery features."""
19
20 @test.attr(type='smoke')
21 def test_api_versions(self):
22 resp, descr = self.client.get_api_description()
23 expected_versions = ('v1',)
24
25 versions = [version['id'] for version in descr['versions']]
26
27 for v in expected_versions:
28 self.assertIn(v, versions)
29
30 @test.attr(type='smoke')
31 def test_default_version(self):
32 resp, descr = self.client.get_api_description()
33 default_version = descr['default_version']
34
35 self.assertEqual(default_version['id'], 'v1')
36
37 @test.attr(type='smoke')
38 def test_version_1_resources(self):
39 resp, descr = self.client.get_version_description(version='v1')
40 expected_resources = ('nodes', 'chassis',
41 'ports', 'links', 'media_types')
42
43 for res in expected_resources:
44 self.assertIn(res, descr)