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