summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc/test_dns_plugin.py
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2016-09-28 15:20:43 +0200
committerMartin Basti <mbasti@redhat.com>2016-10-11 16:48:47 +0200
commitf363dfbeed7aeba51d694a60b29389d94c7bda44 (patch)
tree7e636ec84978041d17da1ed3809fcffa46c6497e /ipatests/test_xmlrpc/test_dns_plugin.py
parenteb75578cbb2447fc2fafb8a79d8500b27e3edff0 (diff)
downloadfreeipa-f363dfbeed7aeba51d694a60b29389d94c7bda44.tar.gz
freeipa-f363dfbeed7aeba51d694a60b29389d94c7bda44.tar.xz
freeipa-f363dfbeed7aeba51d694a60b29389d94c7bda44.zip
DNS: Support URI resource record type
https://fedorahosted.org/freeipa/ticket/6344 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc/test_dns_plugin.py')
-rw-r--r--ipatests/test_xmlrpc/test_dns_plugin.py89
1 files changed, 89 insertions, 0 deletions
diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index a02b4a918..487e7920d 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -6085,3 +6085,92 @@ class test_dns_soa(Declarative):
zone6_unresolvable_ns_dnsname,),
),
]
+
+
+@pytest.mark.tier1
+class test_dns_type_uri(test_dns):
+ """Test behavior specific for URI RR type."""
+
+ @classmethod
+ def setup_class(cls):
+ super(test_dns_type_uri, cls).setup_class()
+ try:
+ api.Command['dnszone_add'](zone1, idnssoarname=zone1_rname)
+ except errors.DuplicateEntry:
+ pass
+
+ cleanup_commands = [
+ ('dnszone_del', [zone1], {'continue': True}),
+ ]
+
+ uri_priority = 1
+ uri_weight = 2
+ uri_target = 'http://example.com/'
+ uri_raw_value = u'{0} {1} "{2}"'.format(
+ uri_priority, uri_weight, uri_target)
+ tests = [
+ dict(
+ desc='Create URI record under %s zone %r' % (name1_dnsname, zone1),
+ command=('dnsrecord_add', [zone1, name1_dnsname],
+ {'urirecord': uri_raw_value}),
+ expected={
+ 'value': name1_dnsname,
+ 'summary': None,
+ 'result': {
+ 'dn': name1_dn,
+ 'idnsname': [name1_dnsname],
+ 'objectclass': objectclasses.dnsrecord,
+ 'urirecord': [uri_raw_value],
+ },
+ },
+ ),
+ dict(
+ desc='URI record is case sensitive on delete (one record)',
+ command=('dnsrecord_del', [zone1, name1_dnsname],
+ {'urirecord': uri_raw_value.upper()}),
+ expected=errors.AttrValueNotFound(attr='URI record',
+ value=uri_raw_value.upper()),
+ ),
+ dict(
+ desc='URI record is case sensitive on add',
+ command=('dnsrecord_add', [zone1, name1_dnsname],
+ {'urirecord': uri_raw_value.upper()}),
+ expected={
+ 'value': name1_dnsname,
+ 'summary': None,
+ 'result': {
+ 'dn': name1_dn,
+ 'idnsname': [name1_dnsname],
+ 'objectclass': objectclasses.dnsrecord,
+ 'urirecord': [uri_raw_value, uri_raw_value.upper()],
+ },
+ },
+ ),
+ dict(
+ desc='URI record is case sensitive on delete (two records)',
+ command=('dnsrecord_del', [zone1, name1_dnsname],
+ {'urirecord': [uri_raw_value, uri_raw_value.upper()]}),
+ expected={
+ 'value': [name1_dnsname],
+ 'summary': u'Deleted record "%s"' % name1_dnsname,
+ 'result': {'failed': []},
+ },
+ ),
+ dict(
+ desc='URI record normalization does not double "" around target',
+ command=('dnsrecord_add', [zone1, name1_dnsname],
+ {'uri_part_target': u'"{0}"'.format(uri_target),
+ 'uri_part_priority': uri_priority,
+ 'uri_part_weight': uri_weight}),
+ expected={
+ 'value': name1_dnsname,
+ 'summary': None,
+ 'result': {
+ 'dn': name1_dn,
+ 'idnsname': [name1_dnsname],
+ 'objectclass': objectclasses.dnsrecord,
+ 'urirecord': [uri_raw_value],
+ },
+ },
+ ),
+ ]