blob: 3809a9345bdf0b0848f80f1ace10fa9be4081b96 [file] [log] [blame]
Ihar Hrachyshka34feb5b2016-06-14 16:16:06 +02001# 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
Sławek Kapłońskic0caa2e2017-02-25 10:11:32 +000013from tempest.lib import decorators
Ihar Hrachyshka34feb5b2016-06-14 16:16:06 +020014from tempest import test
15
16from neutron.tests.tempest.api import base
Ihar Hrachyshka34feb5b2016-06-14 16:16:06 +020017
18
19class ExtensionsTest(base.BaseNetworkTest):
20
21 def _test_list_extensions_includes(self, ext):
22 body = self.client.list_extensions()
23 extensions = {ext_['alias'] for ext_ in body['extensions']}
24 self.assertNotEmpty(extensions, "Extension list returned is empty")
25 ext_enabled = test.is_extension_enabled(ext, "network")
26 if ext_enabled:
27 self.assertIn(ext, extensions)
28 else:
29 self.assertNotIn(ext, extensions)
30
Sławek Kapłońskic0caa2e2017-02-25 10:11:32 +000031 @decorators.idempotent_id('262420b7-a4bb-4a3e-b4b5-e73bad18df8c')
Ihar Hrachyshka34feb5b2016-06-14 16:16:06 +020032 def test_list_extensions_sorting(self):
33 self._test_list_extensions_includes('sorting')
34
Sławek Kapłońskic0caa2e2017-02-25 10:11:32 +000035 @decorators.idempotent_id('19db409e-a23f-445d-8bc8-ca3d64c84706')
Ihar Hrachyshka34feb5b2016-06-14 16:16:06 +020036 def test_list_extensions_pagination(self):
37 self._test_list_extensions_includes('pagination')
Dariusz Smigielf5fb4c62016-08-19 15:41:17 +000038
Sławek Kapłońskic0caa2e2017-02-25 10:11:32 +000039 @decorators.idempotent_id('155b7bc2-e358-4dd8-bf3e-1774c084567f')
Dariusz Smigielf5fb4c62016-08-19 15:41:17 +000040 def test_list_extensions_project_id(self):
41 self._test_list_extensions_includes('project-id')