]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
tests/: extend basic groupmod test
authorIker Pedrosa <ipedrosa@redhat.com>
Wed, 12 Mar 2025 08:18:57 +0000 (09:18 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Wed, 21 May 2025 08:04:42 +0000 (10:04 +0200)
Add additional check for gshadow entry.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Dan Lavu <dlavu@redhat.com>
tests/system/tests/test_groupmod.py

index 5088831e906e628c33f522ab87c1a37e8d044446..37f334f589007ae0433abba8b9d5a3d09c2c0df6 100644 (file)
@@ -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"