diff --git a/ipatests/test_xmlrpc/test_user_plugin.py b/ipatests/test_xmlrpc/test_user_plugin.py index 08d73f4b8..06a67cfb6 100644 --- a/ipatests/test_xmlrpc/test_user_plugin.py +++ b/ipatests/test_xmlrpc/test_user_plugin.py @@ -138,6 +138,19 @@ def user_npg2(request, group): return tracker.make_fixture(request) +@pytest.fixture(scope='class') +def user_radius(request): + """ User tracker fixture for testing users with radius user name """ + tracker = UserTracker(name=u'radiususer', givenname=u'radiususer', + sn=u'radiususer1', + ipatokenradiususername=u'radiususer') + tracker.track_create() + tracker.attrs.update( + objectclass=objectclasses.user + [u'ipatokenradiusproxyuser'] + ) + return tracker.make_fixture(request) + + @pytest.fixture(scope='class') def group(request): tracker = GroupTracker(name=u'group1') @@ -448,6 +461,15 @@ class TestUpdate(XMLRPC_test): error=u'may only include letters, numbers, _, -, . and $')): command() + def test_add_radius_username(self, user): + """ Test for ticket 7569: Try to add --radius-username """ + user.ensure_exists() + command = user.make_update_command( + updates=dict(ipatokenradiususername=u'radiususer') + ) + command() + user.delete() + @pytest.mark.tier1 class TestCreate(XMLRPC_test): @@ -663,6 +685,13 @@ class TestCreate(XMLRPC_test): )): testuser.create() + def test_create_with_radius_username(self, user_radius): + """Test for issue 7569: try to create a user with --radius-username""" + command = user_radius.make_create_command() + result = command() + user_radius.check_create(result) + user_radius.delete() + @pytest.mark.tier1 class TestUserWithGroup(XMLRPC_test):