blob: 6519a4f655142ef8db4998c313cebbcbc61e6ee8 [file] [log] [blame]
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +01001# 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.kumard8471de2016-04-14 19:20:17 +090014import six
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010015from tempest import test
16
17from designate_tempest_plugin import clients
18
19
20class BaseDnsTest(test.BaseTestCase):
Kiall Mac Innes560c89b2016-04-13 11:21:56 +010021 """Base class for DNS tests."""
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010022
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 Innes560c89b2016-04-13 11:21:56 +010032 # NOTE(kiall) We should default to only primary, and request additional
33 # credentials in the tests that require them.
34 credentials = ['primary']
sonu.kumard8471de2016-04-14 19:20:17 +090035
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)