On 05/18/2016 01:51 PM, Ganna Kaihorodova wrote:

----- Original Message -----
From: "Lenka Doudova" <ldoud...@redhat.com>
To: "Ganna Kaihorodova" <gkaih...@redhat.com>
Sent: Wednesday, May 18, 2016 10:37:49 AM
Subject: Fwd: [Freeipa-devel] [TESTS]{PATCH 0013] Maximum username length 
higher than 255 cannot be set



-------- Forwarded Message --------
Subject:        [Freeipa-devel] [TESTS]{PATCH 0013] Maximum username length
higher than 255 cannot be set
Date:   Fri, 13 May 2016 13:08:29 +0200
From:   Lenka Doudova <ldoud...@redhat.com>
To:     freeipa-devel <freeipa-devel@redhat.com>



Patch attached.

Lenka


Hello,

sorry, nack, because:
1. Tests doesn't clean up after performing. Max user name isn't returned 
original value.

2. pep8 errors:
./ipatests/test_xmlrpc/test_config_plugin.py:167:21: E126 continuation line 
over-indented for hanging indent
./ipatests/test_xmlrpc/test_config_plugin.py:170:17: E121 continuation line 
under-indented for hanging indent


Best regards,
Ganna Kaihorodova
Associate Software Quality Engineer

Hi,

thanks for review, fixed patch attached.

Lenka
From 13a103bf40197d15058a32d61dc2ac3f38fec779 Mon Sep 17 00:00:00 2001
From: Lenka Doudova <ldoud...@redhat.com>
Date: Fri, 13 May 2016 12:56:03 +0200
Subject: [PATCH] Test: Maximum username length higher than 255 cannot be set

https://fedorahosted.org/freeipa/ticket/5774
---
 ipatests/test_xmlrpc/test_config_plugin.py | 31 +++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/ipatests/test_xmlrpc/test_config_plugin.py b/ipatests/test_xmlrpc/test_config_plugin.py
index 2a9086f258149198a2df91562d1a972b848d92fa..2f57fd236c521a33f08a0a7fc5f955f85efa0dbb 100644
--- a/ipatests/test_xmlrpc/test_config_plugin.py
+++ b/ipatests/test_xmlrpc/test_config_plugin.py
@@ -1,7 +1,8 @@
 # Authors:
 #   Petr Viktorin <pvikt...@redhat.com>
+#   Lenka Doudova <ldoud...@redhat.com>
 #
-# Copyright (C) 2010  Red Hat
+# Copyright (C) 2010, 2016  Red Hat
 # see file 'COPYING' for use and warranty information
 #
 # This program is free software; you can redistribute it and/or modify
@@ -151,4 +152,32 @@ class test_config(Declarative):
                 ),
         ),
 
+        dict(
+            desc='Set maximum username length higher than limit of 255',
+            command=('config_mod', [], dict(ipamaxusernamelength=256)),
+            expected=errors.ValidationError(
+                name='maxusername',
+                error='can be at most 255'),
+        ),
+
+        dict(
+            desc='Set maximum username length equal to limit 255',
+            command=('config_mod', [], dict(ipamaxusernamelength=255)),
+            expected=dict(
+                result=lambda d: d['ipamaxusernamelength'] == (u'255',),
+                value=None,
+                summary=None,
+                ),
+        ),
+
+        # Cleanup after previous test - returns max username length to 32
+        dict(
+            desc='Return maximum username length to default value',
+            command=('config_mod', [], dict(ipamaxusernamelength=32)),
+            expected=dict(
+                result=lambda d: d['ipamaxusernamelength'] == (u'32',),
+                value=None,
+                summary=None,
+                ),
+        ),
     ]
-- 
2.5.5

-- 
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