From cd7a85c12cf6b5455e40fd5440205ff2c5785a62 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Thu, 13 Sep 2012 15:51:51 +0200 Subject: Fix addattr internal error When ADD command is being executed and a single-value object attribute is being set with both option and addattr IPA ends up in an internal error. Make better value sanitizing job in this case and let IPA throw a user-friendly error. Unit test exercising this situation is added. https://fedorahosted.org/freeipa/ticket/2429 --- tests/test_xmlrpc/test_attr.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/test_xmlrpc/test_attr.py b/tests/test_xmlrpc/test_attr.py index f5353e1b..39320875 100644 --- a/tests/test_xmlrpc/test_attr.py +++ b/tests/test_xmlrpc/test_attr.py @@ -36,6 +36,16 @@ class test_attr(Declarative): tests = [ + dict( + desc='Try to add user %r with single-value attribute set via ' + 'option and --addattr' % user1, + command=( + 'user_add', [user1], dict(givenname=u'Test', sn=u'User1', + addattr=u'sn=User2') + ), + expected=errors.OnlyOneValueAllowed(attr='sn'), + ), + dict( desc='Create %r' % user1, command=( -- cgit