Patches attached.
From 982954b2d4b4105d7fafb9b57aa8f5f974679785 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Thu, 12 Nov 2015 17:06:34 +0100
Subject: [PATCH 1/2] Tests: DNS replace 192.0.2.0/24 with 198.18.0.0/15 range

192.0.2.0/24 is IANA reserved address that should not be used. netaddr
module check implemented for this address and IPA reject this address as
invalid.
198.18.0.0/15 is IANA reserved address for benchmark testing purpose, so
we can safely use this network.

http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
---
 ipatests/test_xmlrpc/test_dns_plugin.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index 4d3117f17f5f0355ef3f2e05a851717cfd0249a7..3de44e472286034d35ffe98ba07d2623ebff3363 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -273,8 +273,9 @@ arec3 = u'172.16.250.123'
 fwd_ip = u'172.16.31.80'
 allowtransfer_tofwd = u'%s;' % fwd_ip
 
-allowquery_restricted_in = u'!192.0.2/24;any;'
-allowquery_restricted_out = u'!192.0.2.0/24;any;'
+# 198.18.0.0/15 testing range reserved by RFC2544
+allowquery_restricted_in = u'!198.18.2.0/24;any;'
+allowquery_restricted_out = u'!198.18.2.0/24;any;'
 
 idnzone1 = u'\u010d.test.'
 idnzone1_punycoded = u'xn--bea.test.'
@@ -2958,7 +2959,7 @@ class test_dns(Declarative):
                     'idnssoaexpire': [fuzzy_digits],
                     'idnssoaminimum': [fuzzy_digits],
                     'idnsallowtransfer': [u'172.16.31.80;'],
-                    'idnsallowquery': [u'!192.0.2.0/24;any;'],
+                    'idnsallowquery': [allowquery_restricted_out],
                     'mxrecord': [u'0 ns1.dnszone.test.'],
                     'locrecord': [u"49 11 42.400 N 16 36 29.600 E 227.64 10.00 10.00 0.10"],
                 },
@@ -2996,7 +2997,7 @@ class test_dns(Declarative):
                     'idnssoaexpire': [fuzzy_digits],
                     'idnssoaminimum': [fuzzy_digits],
                     'idnsallowtransfer': [u'172.16.31.80;'],
-                    'idnsallowquery': [u'!192.0.2.0/24;any;'],
+                    'idnsallowquery': [allowquery_restricted_out],
                     'mxrecord': [u'0 ns1.dnszone.test.'],
                     'locrecord': [u"49 11 42.400 N 16 36 29.600 E 227.64 10.00 10.00 0.10"],
                 },
-- 
2.4.3

From c9e4d580f0e31e231d78976d91c751ac9f8f532f Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Thu, 12 Nov 2015 17:17:13 +0100
Subject: [PATCH 2/2] Tests: DNS various exceptions can be raised in test

Test 'Try to add SRV record to zone %r both via parts and a raw value'
can raise various exceptions which are all valid. Due to internal
representation IPA may raise exception for any of target, port,
priority, weight part.

This commit handles all of them.
---
 ipatests/test_xmlrpc/test_dns_plugin.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py
index 3de44e472286034d35ffe98ba07d2623ebff3363..5f692528eb9a5ae0dc488c663ab43cc47ffd29b3 100644
--- a/ipatests/test_xmlrpc/test_dns_plugin.py
+++ b/ipatests/test_xmlrpc/test_dns_plugin.py
@@ -1148,9 +1148,11 @@ class test_dns(Declarative):
                                                                  'srv_part_target' : u'foo.bar.',
                                                                  'srvrecord': [u"1 100 1234 %s" \
                                                                      % zone1_ns]}),
-            expected=errors.ValidationError(name='srv_target',
-                error=u'Raw value of a DNS record was already set by ' +
-                    u'"srv_rec" option'),
+            expected=lambda x, output: (
+                type(x) == errors.ValidationError and
+                x.message.endswith(u'Raw value of a DNS record was already '
+                                   u'set by "srv_rec" option'),
+            ),
         ),
 
         dict(
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to