]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (su) test GID argument in --group option
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Wed, 26 Nov 2025 03:29:03 +0000 (22:29 -0500)
committerChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Mon, 1 Dec 2025 07:58:13 +0000 (02:58 -0500)
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
tests/expected/su/group-group-id [new file with mode: 0644]
tests/ts/su/group

diff --git a/tests/expected/su/group-group-id b/tests/expected/su/group-group-id
new file mode 100644 (file)
index 0000000..b4b6910
--- /dev/null
@@ -0,0 +1 @@
+ts_grp
index 9bb4b14f0a3dba3c2993e7ad3e051c9972d471ed..d3294fd7293a282afdf373ccb34d0628a2d7c54e 100755 (executable)
@@ -73,6 +73,16 @@ grep -q 'Authentication failure' "$TS_ERRLOG"
 [ "$?" -eq 0 ] && ts_skip_subtest "authentication failure"
 ts_finalize_subtest
 
+ts_init_subtest "group-id"
+
+grp_id="$(cat /etc/group | grep -E "^$grp_name" | cut -d: -f 3)"
+"$TS_CMD_SU" --group "$grp_id" "$username" \
+                        -c "$TS_CMD_ID --groups --name" 2>> "$TS_ERRLOG" \
+                        | grep -o "$grp_name" \
+                        | uniq >> "$TS_OUTPUT"
+
+ts_finalize_subtest
+
 groupdel "$grp_name"
 
 ts_finalize
\ No newline at end of file