Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 1 | # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. |
| 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. |
sonu.kumar | d8471de | 2016-04-14 19:20:17 +0900 | [diff] [blame] | 14 | import six |
Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 15 | from tempest import test |
| 16 | |
| 17 | from designate_tempest_plugin import clients |
| 18 | |
| 19 | |
| 20 | class BaseDnsTest(test.BaseTestCase): |
Kiall Mac Innes | 560c89b | 2016-04-13 11:21:56 +0100 | [diff] [blame] | 21 | """Base class for DNS tests.""" |
Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 22 | |
| 23 | # Use the Designate Client Manager |
| 24 | client_manager = clients.Manager |
| 25 | |
| 26 | # NOTE(andreaf) credentials holds a list of the credentials to be allocated |
| 27 | # at class setup time. Credential types can be 'primary', 'alt', 'admin' or |
| 28 | # a list of roles - the first element of the list being a label, and the |
| 29 | # rest the actual roles. |
| 30 | # NOTE(kiall) primary will result in a manager @ cls.os, alt will have |
| 31 | # cls.os_alt, and admin will have cls.os_adm. |
Kiall Mac Innes | 560c89b | 2016-04-13 11:21:56 +0100 | [diff] [blame] | 32 | # NOTE(kiall) We should default to only primary, and request additional |
| 33 | # credentials in the tests that require them. |
| 34 | credentials = ['primary'] |
sonu.kumar | d8471de | 2016-04-14 19:20:17 +0900 | [diff] [blame] | 35 | |
| 36 | def assertExpected(self, expected, actual, excluded_keys): |
| 37 | for key, value in six.iteritems(expected): |
| 38 | if key not in excluded_keys: |
| 39 | self.assertIn(key, actual) |
| 40 | self.assertEqual(value, actual[key], key) |