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 2021-03-03 18:39:31 +01:00 committed by Alexander Bokovoy
parent c0216fb235
commit 5984f14426

View File

@ -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()