diff options
author | Martin Kosek <mkosek@redhat.com> | 2012-05-29 15:06:31 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-06-01 12:26:57 +0200 |
commit | 895203c47780033b010cd1e0e9ccb21db835ea16 (patch) | |
tree | d9efeed12b940bc50b0b54b38400bfa4546809e9 /tests | |
parent | 6ff5f28142c46bf5f08fef74c261f75e1baa9f66 (diff) | |
download | freeipa-895203c47780033b010cd1e0e9ccb21db835ea16.tar.gz freeipa-895203c47780033b010cd1e0e9ccb21db835ea16.tar.xz freeipa-895203c47780033b010cd1e0e9ccb21db835ea16.zip |
Allow relative DNS name in NS validator
Precallback validator was failing when a zone-relative name was
used as a NS record (for example record "ns" in a zone "example.com").
However, this is valid in BIND and we should allow it as well.
Imports in dns module had to be switched to absolute imports
(available from Python 2.5) to deal with a conflict of IPA dns
module and dnspython module.
https://fedorahosted.org/freeipa/ticket/2630
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_xmlrpc/test_dns_plugin.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py index b18ca9081..532961039 100644 --- a/tests/test_xmlrpc/test_dns_plugin.py +++ b/tests/test_xmlrpc/test_dns_plugin.py @@ -820,14 +820,20 @@ class test_dns(Declarative): ), dict( - desc='Try to add unresolvable NS record to %r using dnsrecord_add' % (dnsres1), + desc='Try to add unresolvable absolute NS record to %r using dnsrecord_add' % (dnsres1), + command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist.'}), + expected=errors.NotFound(reason=u"Nameserver 'does.not.exist.' does not have a corresponding A/AAAA record"), + ), + + dict( + desc='Try to add unresolvable relative NS record to %r using dnsrecord_add' % (dnsres1), command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist'}), - expected=errors.NotFound(reason=u"Nameserver 'does.not.exist' does not have a corresponding A/AAAA record"), + expected=errors.NotFound(reason=u"Nameserver 'does.not.exist.%s.' does not have a corresponding A/AAAA record" % dnszone1), ), dict( desc='Add unresolvable NS record with --force to %r using dnsrecord_add' % (dnsres1), - command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist', + command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist.', 'force' : True}), expected={ 'value': dnsres1, @@ -841,7 +847,7 @@ class test_dns(Declarative): 'kxrecord': [u'1 foo-1'], 'txtrecord': [u'foo bar'], 'nsecrecord': [dnszone1 + u' TXT A'], - 'nsrecord': [u'does.not.exist'], + 'nsrecord': [u'does.not.exist.'], }, }, ), @@ -866,7 +872,7 @@ class test_dns(Declarative): 'kxrecord': [u'1 foo-1'], 'txtrecord': [u'foo bar'], 'nsecrecord': [dnszone1 + u' TXT A'], - 'nsrecord': [u'does.not.exist'], + 'nsrecord': [u'does.not.exist.'], }, }, ), |