From a7aa59075b49a29e5e6b14c232f8fac2a9cfe448 Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Wed, 12 Mar 2025 09:18:57 +0100 Subject: [PATCH] tests/: extend basic groupmod test Add additional check for gshadow entry. Signed-off-by: Iker Pedrosa Reviewed-by: Dan Lavu --- tests/system/tests/test_groupmod.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/system/tests/test_groupmod.py b/tests/system/tests/test_groupmod.py index 5088831e9..37f334f58 100644 --- a/tests/system/tests/test_groupmod.py +++ b/tests/system/tests/test_groupmod.py @@ -18,9 +18,11 @@ def test_groupmod__change_gid(shadow: Shadow): 1. Create group 2. Change GID :steps: - 1. Group exists and GID is 1001 + 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") @@ -30,3 +32,9 @@ def test_groupmod__change_gid(shadow: Shadow): assert result is not None, "Group should be found" assert result.name == "tgroup", "Incorrect groupname" assert result.gid == 1001, "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" -- 2.47.2