Re: [Freeipa-devel] [PATCH] 211 Fix internal error in the user-status command
On 12/05/2013 02:45 PM, Jan Cholasta wrote: Hi, the attached patch fixes https://fedorahosted.org/freeipa/ticket/4066. Honza Patch looks good, ACK. I've added a small regression test for this, does it look OK? -- Petr³ From bb333401aa551f84a16192d2d42de20bd5633f84 Mon Sep 17 00:00:00 2001 From: Petr Viktorin pvikt...@redhat.com Date: Tue, 10 Dec 2013 12:16:25 +0100 Subject: [PATCH] Regression test for user_status crash https://fedorahosted.org/freeipa/ticket/4066 --- ipatests/test_xmlrpc/test_user_plugin.py | 25 + 1 file changed, 25 insertions(+) diff --git a/ipatests/test_xmlrpc/test_user_plugin.py b/ipatests/test_xmlrpc/test_user_plugin.py index 2f07e1495ff31cac7ea4db2eb42453e065aec418..14a4b501d49537eb1ddcc6c593ad4b75c15da6da 100644 --- a/ipatests/test_xmlrpc/test_user_plugin.py +++ b/ipatests/test_xmlrpc/test_user_plugin.py @@ -23,6 +23,8 @@ Test the `ipalib/plugins/user.py` module. +import re + from ipalib import api, errors from ipatests.test_xmlrpc import objectclasses from ipatests.util import assert_equal, assert_not_equal @@ -45,6 +47,9 @@ sshpubkey = u'ssh-rsa B3NzaC1yc2EDAQABAAABAQDGAX3xAeLeaJggwTqMjxNwa6XHBUAikXPGMzEpVrlLDCZtv00djsFTBi38PkgxBJVkgRWMrcBsr/35lq7P6w8KGIwA8GI48Z0qBS2NBMJ2u9WQ2hjLN6GdMlo77O0uJY3251p12pCVIS/bHRSq8kHO2No8g7KA9fGGcagPfQH+ee3t7HUkpbQkFTmbPPN++r3V8oVUk5LxbryB3UIIVzNmcSIn3JrXynlvui4MixvrtX6zx+O/bBo68o8/eZD26QrahVbA09fivrn/4h3TM019Eu/c2jOdckfU3cHUV/3Tno5d6JicibyaoDDK7S/yjdn5jhaz8MSEayQvFkZkiF0L public key test' sshpubkeyfp = u'13:67:6B:BF:4E:A2:05:8E:AE:25:8B:A1:31:DE:6F:1B public key test (ssh-rsa)' +# Date in ISO format (2013-12-10T12:00:00) +isodate_re = re.compile('^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$') + def get_user_result(uid, givenname, sn, operation='show', omit=[], **overrides): @@ -1449,4 +1454,24 @@ class test_user(Declarative): ), ), +dict( +desc='Query status of %s' % user1, +command=('user_status', [user1], {}), +expected=dict( +count=1, +result=[ +dict( +dn=get_user_dn(user1), +krblastfailedauth=[u'N/A'], +krblastsuccessfulauth=[u'N/A'], +krbloginfailedcount=u'0', +now=isodate_re.match, +server=api.env.host, +), +], +summary=u'Account disabled: False', +truncated=False, +), +), + ] -- 1.8.3.1 ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH] 211 Fix internal error in the user-status command
On 10.12.2013 12:18, Petr Viktorin wrote: On 12/05/2013 02:45 PM, Jan Cholasta wrote: Hi, the attached patch fixes https://fedorahosted.org/freeipa/ticket/4066. Honza Patch looks good, ACK. I've added a small regression test for this, does it look OK? Thanks, it looks OK except I don't see dn in result and I would rename isodate_re to generalizedtime_re. -- Jan Cholasta ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH] 211 Fix internal error in the user-status command
On 12/10/2013 02:15 PM, Jan Cholasta wrote: On 10.12.2013 12:18, Petr Viktorin wrote: On 12/05/2013 02:45 PM, Jan Cholasta wrote: Hi, the attached patch fixes https://fedorahosted.org/freeipa/ticket/4066. Honza Patch looks good, ACK. I've added a small regression test for this, does it look OK? Thanks, it looks OK except I don't see dn in result and I would rename isodate_re to generalizedtime_re. Your patch adds dn. user_status without --raw will report time in ISO 8601 (%Y-%m-%dT%H:%M:%SZ). GeneralizedTime would be %Y%m%d%H%M%SZ. -- Petr³ ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH] 211 Fix internal error in the user-status command
On 10.12.2013 15:18, Petr Viktorin wrote: On 12/10/2013 02:15 PM, Jan Cholasta wrote: On 10.12.2013 12:18, Petr Viktorin wrote: On 12/05/2013 02:45 PM, Jan Cholasta wrote: Hi, the attached patch fixes https://fedorahosted.org/freeipa/ticket/4066. Honza Patch looks good, ACK. I've added a small regression test for this, does it look OK? Thanks, it looks OK except I don't see dn in result and I would rename isodate_re to generalizedtime_re. Your patch adds dn. Oh, right. user_status without --raw will report time in ISO 8601 (%Y-%m-%dT%H:%M:%SZ). GeneralizedTime would be %Y%m%d%H%M%SZ. Also right. Sorry for the fuss then, ACK. -- Jan Cholasta ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel
Re: [Freeipa-devel] [PATCH] 211 Fix internal error in the user-status command
On 12/10/2013 03:23 PM, Jan Cholasta wrote: On 10.12.2013 15:18, Petr Viktorin wrote: On 12/10/2013 02:15 PM, Jan Cholasta wrote: On 10.12.2013 12:18, Petr Viktorin wrote: On 12/05/2013 02:45 PM, Jan Cholasta wrote: Hi, the attached patch fixes https://fedorahosted.org/freeipa/ticket/4066. Honza Patch looks good, ACK. I've added a small regression test for this, does it look OK? Thanks, it looks OK except I don't see dn in result and I would rename isodate_re to generalizedtime_re. Your patch adds dn. Oh, right. user_status without --raw will report time in ISO 8601 (%Y-%m-%dT%H:%M:%SZ). GeneralizedTime would be %Y%m%d%H%M%SZ. Also right. Sorry for the fuss then, ACK. Thanks, pushed both to master: b6563984154e577cdf430f8f74f15f912ac0ee12 -- Petr³ ___ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel