summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2014-08-21 18:09:22 +0200
committerMartin Kosek <mkosek@redhat.com>2014-09-05 12:11:39 +0200
commit2b3be21b2565ecd46a6f037f3291aee0dbc24c4f (patch)
treef8af5c59749f40ccdb1462ed89199f788500a2d1
parentd0130195a91eae5734be5438d997c8e2918eaebd (diff)
downloadfreeipa-2b3be21b2565ecd46a6f037f3291aee0dbc24c4f.tar.gz
freeipa-2b3be21b2565ecd46a6f037f3291aee0dbc24c4f.tar.xz
freeipa-2b3be21b2565ecd46a6f037f3291aee0dbc24c4f.zip
Test: DNS NS validation
Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Martin Kosek <mkosek@redhat.com>
-rw-r--r--ipatests/test_xmlrpc/test_dns_plugin.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index ea67f774a..0435f57a4 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -123,6 +123,10 @@ name1_dn = DN(('idnsname',name1), zone1_dn)
name1_renamed = u'testdnsres-renamed'
name1_renamed_dnsname = DNSName(name1_renamed)
+name_ns = u'testdnsres-ns'
+name_ns_dnsname = DNSName(name_ns)
+name_ns_dn = DN(('idnsname',name_ns), zone1_dn)
+
revname1 = u'80'
revname1_dnsname = DNSName(revname1)
revname1_ip = revzone1_ipprefix + revname1
@@ -1166,9 +1170,10 @@ class test_dns(Declarative):
desc='Try to add NS record to %r using dnsrecord_add' % (dname),
command=('dnsrecord_add', [zone1, dname],
{'nsrecord': u'%s.%s.' % (name1, zone1)}),
- expected=errors.ValidationError(name='dnamerecord',
- error=u'DNAME record is not allowed to coexist with an NS '
- u'record except when located in a zone root record (RFC 6672, section 2.3)'),
+ expected=errors.ValidationError(name='nsrecord',
+ error=u'NS record is not allowed to coexist with an DNAME '
+ u'record except when located in a zone root record '
+ '(RFC 2181, section 6.1'),
),
dict(
@@ -1243,32 +1248,29 @@ class test_dns(Declarative):
dict(
- desc='Try to add unresolvable absolute NS record to %r using dnsrecord_add' % (name1),
- command=('dnsrecord_add', [zone1, name1], {'nsrecord': absnxname}),
+ desc='Try to add unresolvable absolute NS record to %r using dnsrecord_add' % (name_ns),
+ command=('dnsrecord_add', [zone1, name_ns], {'nsrecord': absnxname}),
expected=errors.NotFound(reason=u"Nameserver '%s' does not have a corresponding A/AAAA record" % absnxname),
),
dict(
- desc='Try to add unresolvable relative NS record to %r using dnsrecord_add' % (name1),
- command=('dnsrecord_add', [zone1, name1], {'nsrecord': relnxname}),
+ desc='Try to add unresolvable relative NS record to %r using dnsrecord_add' % (name_ns),
+ command=('dnsrecord_add', [zone1, name_ns], {'nsrecord': relnxname}),
expected=errors.NotFound(reason=u"Nameserver '%s.%s.' does not "
"have a corresponding A/AAAA record" % (relnxname, zone1)),
),
dict(
- desc='Add unresolvable NS record with --force to %r using dnsrecord_add' % (name1),
- command=('dnsrecord_add', [zone1, name1], {'nsrecord': absnxname,
+ desc='Add unresolvable NS record with --force to %r using dnsrecord_add' % (name_ns),
+ command=('dnsrecord_add', [zone1, name_ns], {'nsrecord': absnxname,
'force' : True}),
expected={
- 'value': name1_dnsname,
+ 'value': name_ns_dnsname,
'summary': None,
'result': {
'objectclass': objectclasses.dnsrecord,
- 'dn': name1_dn,
- 'idnsname': [name1_dnsname],
- 'arecord': [arec3],
- 'kxrecord': [u'1 foo-1'],
- 'txtrecord': [u'foo bar'],
+ 'dn': name_ns_dn,
+ 'idnsname': [name_ns_dnsname],
'nsrecord': [absnxname],
},
},
@@ -1292,7 +1294,6 @@ class test_dns(Declarative):
'arecord': [arec3],
'kxrecord': [u'1 foo-1'],
'txtrecord': [u'foo bar'],
- 'nsrecord': [absnxname],
},
},
),