summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc
diff options
context:
space:
mode:
authorLenka Doudova <ldoudova@redhat.com>2016-05-13 12:56:03 +0200
committerMartin Basti <mbasti@redhat.com>2016-05-24 10:39:14 +0200
commitd71de186cc4d942b2a1bb7fcd9677bfcedd86b26 (patch)
tree9cb436f9c95e06bf9c26cbb2ddadbe810d999c16 /ipatests/test_xmlrpc
parent9079d2f9c8a948702f1234e8337d8bf0dc291756 (diff)
downloadfreeipa-d71de186cc4d942b2a1bb7fcd9677bfcedd86b26.tar.gz
freeipa-d71de186cc4d942b2a1bb7fcd9677bfcedd86b26.tar.xz
freeipa-d71de186cc4d942b2a1bb7fcd9677bfcedd86b26.zip
Test: Maximum username length higher than 255 cannot be set
https://fedorahosted.org/freeipa/ticket/5774 Reviewed-By: Ganna Kaihorodova <gkaihoro@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc')
-rw-r--r--ipatests/test_xmlrpc/test_config_plugin.py31
1 files changed, 30 insertions, 1 deletions
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 <pviktori@redhat.com>
+# Lenka Doudova <ldoudova@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,
+ ),
+ ),
]