blob: 9cf93f6d2eaf0fedfbbb0b241f7f1ca320e2a309 [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
16from tempest import test
17
18
19class NetworksApiDiscovery(base.BaseNetworkTest):
20 @test.attr(type='smoke')
21 @test.idempotent_id('cac8a836-c2e0-4304-b556-cd299c7281d1')
22 def test_api_version_resources(self):
23 """Test that GET / returns expected resources.
24
25 The versions document returned by Neutron returns a few other
26 resources other than just available API versions: it also
27 states the status of each API version and provides links to
28 schema.
29 """
30
31 result = self.network_versions_client.list_versions()
32 expected_versions = ('v2.0')
33 expected_resources = ('id', 'links', 'status')
34 received_list = result.values()
35
36 for item in received_list:
37 for version in item:
38 for resource in expected_resources:
39 self.assertIn(resource, version)
40 self.assertIn(version['id'], expected_versions)