ipatests: add test for group creation with GID and nonposix option

Add test to ensure group creation fails when passing the --nonposix
option and a GID number at the same time. Failure shows a message
to warn the user that this is not allowed.

Signed-off-by: Antonio Torres <antorres@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Antonio Torres authored and Alexander Bokovoy committed 2021-03-29 10:09:22 +03:00
1 parent c0216fb235
commit 5984f14426
1 file changed
+9
@@ -388,6 +388,15 @@ class TestNonexistentGroup(XMLRPC_test):
@pytest.mark.tier1
class TestNonposixGroup(XMLRPC_test):
def test_create_nonposix_with_gid(self, group):
""" Try to create non-posix group with GID """
command = group.make_create_command(**dict(nonposix=True,
gidnumber=10011))
with raises_exact(errors.ObjectclassViolation(
info=u'attribute "gidNumber" not allowed with --nonposix')):
command()
def test_create_nonposix(self, group):
""" Create a non-posix group """
group.track_create()