[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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 <pviktori 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 AAAAB3NzaC1yc2EAAAADAQABAAABAQDGAX3xAeLeaJggwTqMjxNwa6XHBUAikXPGMzEpVrlLDCZtv00djsFTBi38PkgxBJVkgRWMrcBsr/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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]