summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc/test_dns_plugin.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-02-03 10:41:21 +0100
committerMartin Kosek <mkosek@redhat.com>2012-02-03 16:25:26 +0100
commitcb4b2e6facea8fd786384ceb751e6dbedac2be5c (patch)
tree92aa56fa3896a5756db75aefbcc1a0d8a06f83c9 /tests/test_xmlrpc/test_dns_plugin.py
parente41282fbc693e24535956c8822786e9e0bc3e8b4 (diff)
downloadfreeipa-cb4b2e6facea8fd786384ceb751e6dbedac2be5c.tar.gz
freeipa-cb4b2e6facea8fd786384ceb751e6dbedac2be5c.tar.xz
freeipa-cb4b2e6facea8fd786384ceb751e6dbedac2be5c.zip
Fix NSEC record conversion
NSEC record needs special treatment as it is not composed from a fixed set of DNS parts divided by space, but it contains a multivalued DNS part "types" containing a list of RR types it covers. There was already a special method for parsing raw NSEC record to DNS parts, but the other direction was missing. This patch adds special NSEC convertor to fix this issue. https://fedorahosted.org/freeipa/ticket/2307
Diffstat (limited to 'tests/test_xmlrpc/test_dns_plugin.py')
-rw-r--r--tests/test_xmlrpc/test_dns_plugin.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py
index f65fe5635..b177b9d01 100644
--- a/tests/test_xmlrpc/test_dns_plugin.py
+++ b/tests/test_xmlrpc/test_dns_plugin.py
@@ -667,6 +667,26 @@ class test_dns(Declarative):
),
dict(
+ desc='Add NSEC record to %r using dnsrecord_add' % (dnsres1),
+ command=('dnsrecord_add', [dnszone1, dnsres1], {'nsec_part_next': dnszone1,
+ 'nsec_part_types' : ['TXT', 'A']}),
+ 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'],
+ },
+ },
+ ),
+
+ dict(
desc='Delete record %r in zone %r' % (dnsres1, dnszone1),
command=('dnsrecord_del', [dnszone1, dnsres1], {'del_all': True }),
expected={