diff options
author | Martin Kosek <mkosek@redhat.com> | 2012-03-21 13:25:42 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-03-22 17:27:09 +0100 |
commit | 19b2af8e52d772aaba190beb747fc2e87821fdbe (patch) | |
tree | 7fcbcab9da2479345b379c194f09cc03a3a60071 /tests/test_xmlrpc | |
parent | a58cbb985ec007c0ef83010b32408efb2f4784d2 (diff) | |
download | freeipa.git-19b2af8e52d772aaba190beb747fc2e87821fdbe.tar.gz freeipa.git-19b2af8e52d772aaba190beb747fc2e87821fdbe.tar.xz freeipa.git-19b2af8e52d772aaba190beb747fc2e87821fdbe.zip |
Fix precallback validators in DNS plugin
DNS plugin contains several RR type record validators run in
pre_callback which cannot be used as standard param validator
as it needs more data and resources that standard validators
provide. However, the precallback validators are not run for
DNS records created by new structured options and thus an invalid
value may slip in.
This patch moves the execution of these precallback validators
_after_ the processing of structured DNS options. It also cleans
them up a little and makes them more robust.
https://fedorahosted.org/freeipa/ticket/2550
Diffstat (limited to 'tests/test_xmlrpc')
-rw-r--r-- | tests/test_xmlrpc/test_dns_plugin.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py index ec656519..93093ec8 100644 --- a/tests/test_xmlrpc/test_dns_plugin.py +++ b/tests/test_xmlrpc/test_dns_plugin.py @@ -744,6 +744,33 @@ class test_dns(Declarative): ), dict( + desc='Try to add unresolvable 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='Add unresolvable NS record with --force to %r using dnsrecord_add' % (dnsres1), + command=('dnsrecord_add', [dnszone1, dnsres1], {'nsrecord': u'does.not.exist', + 'force' : True}), + expected={ + 'value': dnsres1, + 'summary': None, + 'result': { + 'objectclass': [u'top', u'idnsrecord'], + 'dn': unicode(dnsres1_dn), + 'idnsname': [dnsres1], + 'arecord': [u'10.10.0.1'], + 'cnamerecord': [u'foo-1.example.com.'], + 'kxrecord': [u'1 foo-1'], + 'txtrecord': [u'foo bar'], + 'nsecrecord': [dnszone1 + u' TXT A'], + 'nsrecord': [u'does.not.exist'], + }, + }, + ), + + dict( desc='Delete record %r in zone %r' % (dnsres1, dnszone1), command=('dnsrecord_del', [dnszone1, dnsres1], {'del_all': True }), expected={ |