diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-05-18 09:42:56 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-05-25 16:06:26 +0200 |
commit | e0275abe6f5192e68b7f57acf37b01aaa89003ea (patch) | |
tree | 3023bbb3db7e3369e865eabfe6b878e09cf7d38c /ipatests/test_xmlrpc/test_dns_plugin.py | |
parent | 861294c0d62891dc9977e7203cc07496e35ec939 (diff) | |
download | freeipa-e0275abe6f5192e68b7f57acf37b01aaa89003ea.tar.gz freeipa-e0275abe6f5192e68b7f57acf37b01aaa89003ea.tar.xz freeipa-e0275abe6f5192e68b7f57acf37b01aaa89003ea.zip |
rpc: include structured error information in responses
Include keyword arguments of exceptions in RPC responses. This is limited
to JSON-RPC, as XML-RPC does not support additional data in error
responses.
Include keyword arguments of messages in RPC responses.
Include keyword arguments of exceptions in batch command result.
https://fedorahosted.org/freeipa/ticket/4739
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc/test_dns_plugin.py')
-rw-r--r-- | ipatests/test_xmlrpc/test_dns_plugin.py | 161 |
1 files changed, 145 insertions, 16 deletions
diff --git a/ipatests/test_xmlrpc/test_dns_plugin.py b/ipatests/test_xmlrpc/test_dns_plugin.py index eed816048..fb98d0e6f 100644 --- a/ipatests/test_xmlrpc/test_dns_plugin.py +++ b/ipatests/test_xmlrpc/test_dns_plugin.py @@ -592,7 +592,14 @@ class test_dns(Declarative): u"apex - '@'. ", 'code': 13005, 'type': u'warning', - 'name': u'OptionSemanticChangedWarning'}, + 'name': u'OptionSemanticChangedWarning', + 'data': { + 'current_behavior': u"It is used only for setting the " + u"SOA MNAME attribute.", + 'hint': u"NS record(s) can be edited in zone apex - " + u"'@'. ", + 'label': u"setting Authoritative nameserver" + }}, ) }, ), @@ -1759,7 +1766,11 @@ class test_dns(Declarative): u"DNS server %s: query '. SOA':" % fwd_ip), u'code': 13006, u'type':u'warning', - u'name': u'DNSServerValidationWarning'}, + u'name': u'DNSServerValidationWarning', + u'data': { + u'error': lambda x: x.startswith(u"query '. SOA':"), + u'server': u"%s" % fwd_ip + }}, ), 'result': { 'idnsforwarders': [fwd_ip], @@ -2898,7 +2909,15 @@ class test_dns(Declarative): u"on a randomly chosen IPA server.", 'code': 13015, 'type': u'warning', - 'name': u'CommandDeprecatedWarning' + 'name': u'CommandDeprecatedWarning', + 'data': { + 'command': u"dns-resolve", + 'additional_info': u"The command may return an " + u"unexpected result, the " + u"resolution of the DNS domain " + u"is done on a randomly chosen " + u"IPA server." + } },) }, ), @@ -2918,7 +2937,15 @@ class test_dns(Declarative): u"on a randomly chosen IPA server.", 'code': 13015, 'type': u'warning', - 'name': u'CommandDeprecatedWarning' + 'name': u'CommandDeprecatedWarning', + 'data': { + 'command': u"dns-resolve", + 'additional_info': u"The command may return an " + u"unexpected result, the " + u"resolution of the DNS domain " + u"is done on a randomly chosen " + u"IPA server." + } },) }, ), @@ -3415,7 +3442,12 @@ class test_forward_zones(Declarative): (forwarder1, fwzone2)), u'code': 13006, u'type':u'warning', - u'name': u'DNSServerValidationWarning'}, + u'name': u'DNSServerValidationWarning', + u'data': { + u'error': lambda x: x.startswith( + u"query '%s SOA':" % forwarder1), + u'server': u"%s" % fwzone2 + }}, ), 'result': { 'dn': fwzone2_dn, @@ -4871,7 +4903,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw.sub" to parent zone "dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_absolute, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_absolute) - 1] + }}, ), }, ), @@ -4912,7 +4949,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw" to parent zone "sub.dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_sub, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_sub) - 1] + }}, ), }, ), @@ -4936,7 +4978,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw.sub" to parent zone "dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_absolute, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_absolute) - 1] + }}, ), }, ), @@ -4960,7 +5007,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw" to parent zone "sub.dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_sub, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_sub) - 1] + }}, ), }, ), @@ -4997,7 +5049,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw" to parent zone "sub.dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_sub, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_sub) - 1] + }}, ), }, ), @@ -5039,7 +5096,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw.sub" to parent zone "dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_absolute, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_absolute) - 1] + }}, ), }, ), @@ -5078,7 +5140,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw" to parent zone "sub.dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_sub, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_sub) - 1] + }}, ), }, ), @@ -5110,7 +5177,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"sub.dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_sub, + 'fwzone': zone1_sub2_fw, + 'ns_rec': zone1_sub2_fw[:-len(zone1_sub) - 1] + }}, ), }, ), @@ -5176,7 +5248,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"fw.sub" to parent zone "dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_absolute, + 'fwzone': zone1_sub_fw, + 'ns_rec': zone1_sub_fw[:-len(zone1_absolute) - 1] + }}, {'message': u'forward zone "fw.sub2.sub.dnszone.test." ' u'is not effective because of missing proper ' u'NS delegation in authoritative zone ' @@ -5185,7 +5262,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'} + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_absolute, + 'fwzone': zone1_sub2_fw, + 'ns_rec': zone1_sub2_fw[:-len(zone1_absolute) - 1] + }} ), }, ), @@ -5230,7 +5312,12 @@ class test_forwardzone_delegation_warnings(Declarative): u'"dnszone.test.".', 'code': 13008, 'type': u'warning', - 'name': u'ForwardzoneIsNotEffectiveWarning'}, + 'name': u'ForwardzoneIsNotEffectiveWarning', + 'data': { + 'authzone': zone1_absolute, + 'fwzone': zone1_sub2_fw, + 'ns_rec': zone1_sub2_fw[:-len(zone1_absolute) - 1] + }}, ), }, ), @@ -5478,6 +5565,13 @@ class test_dns_soa(Declarative): 'code': 13005, 'type': u'warning', 'name': u'OptionSemanticChangedWarning', + 'data': { + 'current_behavior': u"It is used only for setting the " + u"SOA MNAME attribute.", + 'hint': u"NS record(s) can be edited in zone apex - " + u"'@'. ", + 'label': u"setting Authoritative nameserver", + }, }], }, ), @@ -5533,6 +5627,13 @@ class test_dns_soa(Declarative): 'code': 13005, 'type': u'warning', 'name': u'OptionSemanticChangedWarning', + 'data': { + 'current_behavior': u"It is used only for setting the " + u"SOA MNAME attribute.", + 'hint': u"NS record(s) can be edited in zone apex - " + u"'@'. ", + 'label': u"setting Authoritative nameserver", + }, }], }, ), @@ -5574,6 +5675,13 @@ class test_dns_soa(Declarative): 'code': 13005, 'type': u'warning', 'name': u'OptionSemanticChangedWarning', + 'data': { + 'current_behavior': u"It is used only for setting the " + u"SOA MNAME attribute.", + 'hint': u"NS record(s) can be edited in zone apex - " + u"'@'. ", + 'label': u"setting Authoritative nameserver", + }, }], }, ), @@ -5615,6 +5723,13 @@ class test_dns_soa(Declarative): 'code': 13005, 'type': u'warning', 'name': u'OptionSemanticChangedWarning', + 'data': { + 'current_behavior': u"It is used only for setting the " + u"SOA MNAME attribute.", + 'hint': u"NS record(s) can be edited in zone apex - " + u"'@'. ", + 'label': u"setting Authoritative nameserver", + }, }], }, ), @@ -5818,6 +5933,13 @@ class test_dns_soa(Declarative): 'code': 13005, 'type': u'warning', 'name': u'OptionSemanticChangedWarning', + 'data': { + 'current_behavior': u"It is used only for setting the " + u"SOA MNAME attribute.", + 'hint': u"NS record(s) can be edited in zone apex - " + u"'@'. ", + 'label': u"setting Authoritative nameserver", + }, }], }, ), dict( @@ -5874,6 +5996,13 @@ class test_dns_soa(Declarative): 'code': 13005, 'type': u'warning', 'name': u'OptionSemanticChangedWarning', + 'data': { + 'current_behavior': u"It is used only for setting the " + u"SOA MNAME attribute.", + 'hint': u"NS record(s) can be edited in zone apex - " + u"'@'. ", + 'label': u"setting Authoritative nameserver", + }, }], }, ), |