From: Iker Pedrosa Date: Wed, 12 Mar 2025 08:16:36 +0000 (+0100) Subject: tests/: extend basic groupadd test X-Git-Tag: 4.18.0-rc1~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72c42f662716b070629537410b68a35af3f7df92;p=thirdparty%2Fshadow.git tests/: extend basic groupadd test Add additional check for gshadow entry. Signed-off-by: Iker Pedrosa Reviewed-by: Dan Lavu --- diff --git a/tests/system/tests/test_groupadd.py b/tests/system/tests/test_groupadd.py index 2573b0d7e..5e4bea532 100644 --- a/tests/system/tests/test_groupadd.py +++ b/tests/system/tests/test_groupadd.py @@ -17,9 +17,11 @@ def test_groupadd__add_group(shadow: Shadow): :setup: 1. Create group :steps: - 1. Group exists and GID is 1000 + 1. Check group entry + 2. Check gshadow entry :expectedresults: - 1. Group is found and GID matches + 1. group entry for the user exists and the attributes are correct + 2. gshadow entry for the user exists and the attributes are correct :customerscenario: False """ shadow.groupadd("tgroup") @@ -28,3 +30,9 @@ def test_groupadd__add_group(shadow: Shadow): assert result is not None, "Group should be found" assert result.name == "tgroup", "Incorrect groupname" assert result.gid == 1000, "Incorrect GID" + + if shadow.host.features["gshadow"]: + result = shadow.tools.getent.gshadow("tgroup") + assert result is not None, "Group should be found" + assert result.name == "tgroup", "Incorrect groupname" + assert result.password == "!", "Incorrect password"