blob: 4f6d5ac70272ac7230a6b7d84cf1fa2fcc3bf885 [file] [log] [blame]
Mark T. Voelkerabd4cbd2016-04-29 12:03:04 -05001# Copyright 2016 VMware, Inc.
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.network import base
Ken'ichi Ohmichi53b9a632017-01-27 18:04:39 -080016from tempest.lib import decorators
Mark T. Voelkerabd4cbd2016-04-29 12:03:04 -050017from tempest import test
18
19
20class NetworksApiDiscovery(base.BaseNetworkTest):
21 @test.attr(type='smoke')
Ken'ichi Ohmichi53b9a632017-01-27 18:04:39 -080022 @decorators.idempotent_id('cac8a836-c2e0-4304-b556-cd299c7281d1')
Mark T. Voelkerabd4cbd2016-04-29 12:03:04 -050023 def test_api_version_resources(self):
24 """Test that GET / returns expected resources.
25
26 The versions document returned by Neutron returns a few other
27 resources other than just available API versions: it also
28 states the status of each API version and provides links to
29 schema.
30 """
31
32 result = self.network_versions_client.list_versions()
33 expected_versions = ('v2.0')
34 expected_resources = ('id', 'links', 'status')
35 received_list = result.values()
36
37 for item in received_list:
38 for version in item:
39 for resource in expected_resources:
40 self.assertIn(resource, version)
41 self.assertIn(version['id'], expected_versions)