From d3e9e35ef73729956c649f2ee0d0ff3963f99e4e Mon Sep 17 00:00:00 2001 From: David Hanina Date: Fri, 28 Mar 2025 10:33:15 +0100 Subject: [PATCH] Correct dnsrecord_* tests for --raw --structured Fixes typo in the tests, --raw --structured is only checked if rest of the command is correct as well, therefore test changes were required. Fixes: https://pagure.io/freeipa/issue/9768 Signed-off-by: David Hanina Reviewed-By: Michal Polovka Reviewed-By: Florence Blanc-Renaud --- ipatests/test_xmlrpc/test_dns_plugin.py | 32 ++++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py index 803b0a9571c2888dd02c4595c68403f37be7fed7..864d5287f8317a5154aec4c792f56deab7ff0120 100644 --- a/ipatests/test_xmlrpc/test_dns_plugin.py +++ b/ipatests/test_xmlrpc/test_dns_plugin.py @@ -3416,20 +3416,11 @@ class test_dns(Declarative): }, ), - dict( - desc='Delete zone %r' % zone1, - command=('dnszone_del', [zone1], {}), - expected={ - 'value': [zone1_absolute_dnsname], - 'summary': u'Deleted DNS zone "%s"' % zone1_absolute, - 'result': {'failed': []}, - }, - ), - dict( desc="Ensure --raw and --structure does not work " "for ipa dnsrecord-add", - command=('dnrecord_add', [], {u'raw': True, u'structured': True}), + command=('dnsrecord_add', [zone1, name1], + {'arecord': arec2, u'raw': True, u'structured': True}), expected=errors.MutuallyExclusiveError( reason=u"cannot use structured together with raw" ), @@ -3438,7 +3429,8 @@ class test_dns(Declarative): dict( desc="Ensure --raw and --structure does not work " "for ipa dnsrecord-mod", - command=('dnrecord_add', [], {u'raw': True, u'structured': True}), + command=('dnsrecord_mod', [zone1, name1], + {'arecord': arec1, u'raw': True, u'structured': True}), expected=errors.MutuallyExclusiveError( reason=u"cannot use structured together with raw" ), @@ -3447,7 +3439,8 @@ class test_dns(Declarative): dict( desc="Ensure --raw and --structure does not work " "for ipa dnsrecord-show", - command=('dnrecord_add', [], {u'raw': True, u'structured': True}), + command=('dnsrecord_show', [zone1, name1], + {u'raw': True, u'structured': True}), expected=errors.MutuallyExclusiveError( reason=u"cannot use structured together with raw" ), @@ -3456,11 +3449,22 @@ class test_dns(Declarative): dict( desc="Ensure --raw and --structure does not work " "for ipa dnsrecord-find", - command=('dnrecord_add', [], {u'raw': True, u'structured': True}), + command=('dnsrecord_find', [zone1], + {u'raw': True, u'structured': True}), expected=errors.MutuallyExclusiveError( reason=u"cannot use structured together with raw" ), ), + + dict( + desc='Delete zone %r' % zone1, + command=('dnszone_del', [zone1], {}), + expected={ + 'value': [zone1_absolute_dnsname], + 'summary': u'Deleted DNS zone "%s"' % zone1_absolute, + 'result': {'failed': []}, + }, + ), ] -- 2.49.0