summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-09-13 15:51:51 +0200
committerRob Crittenden <rcritten@redhat.com>2012-09-16 17:52:56 -0400
commitcd7a85c12cf6b5455e40fd5440205ff2c5785a62 (patch)
tree1e51b1b4a2eca03ff5b994fd2edddcb68e69400a /tests
parentd491ba028987b106b10f97ab93a106104a9c4eee (diff)
downloadfreeipa-cd7a85c12cf6b5455e40fd5440205ff2c5785a62.tar.gz
freeipa-cd7a85c12cf6b5455e40fd5440205ff2c5785a62.tar.xz
freeipa-cd7a85c12cf6b5455e40fd5440205ff2c5785a62.zip
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
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xmlrpc/test_attr.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_attr.py b/tests/test_xmlrpc/test_attr.py
index f5353e1b2..39320875b 100644
--- a/tests/test_xmlrpc/test_attr.py
+++ b/tests/test_xmlrpc/test_attr.py
@@ -37,6 +37,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=(
'user_add', [user1], dict(givenname=u'Test', sn=u'User1',