From d71de186cc4d942b2a1bb7fcd9677bfcedd86b26 Mon Sep 17 00:00:00 2001 From: Lenka Doudova Date: Fri, 13 May 2016 12:56:03 +0200 Subject: Test: Maximum username length higher than 255 cannot be set https://fedorahosted.org/freeipa/ticket/5774 Reviewed-By: Ganna Kaihorodova --- 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 2a9086f25..2f57fd236 100644 --- a/ipatests/test_xmlrpc/test_config_plugin.py +++ b/ipatests/test_xmlrpc/test_config_plugin.py @@ -1,7 +1,8 @@ # Authors: # Petr Viktorin +# Lenka Doudova # -# 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, + ), + ), ] -- cgit