summaryrefslogtreecommitdiffstats
path: root/testsuite/test6.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 05:55:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 05:55:27 +0000
commit32e0ba8ebdadc47ac1a0da8d9a9668ff21909e4f (patch)
treeebaa5eacafe874b431d69e52f0f73c013c3017ae /testsuite/test6.pl
parentInitial commit. (diff)
downloadadduser-32e0ba8ebdadc47ac1a0da8d9a9668ff21909e4f.tar.xz
adduser-32e0ba8ebdadc47ac1a0da8d9a9668ff21909e4f.zip
Adding upstream version 3.118+deb11u1.upstream/3.118+deb11u1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite/test6.pl')
-rw-r--r--testsuite/test6.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/test6.pl b/testsuite/test6.pl
new file mode 100644
index 0000000..08a333b
--- /dev/null
+++ b/testsuite/test6.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl -w
+
+# expect:
+# - a new user $USER with uid $want_uid and gid 0
+# - added to group nogroup
+# - no home directory /home/$USER
+
+use strict;
+use lib_test;
+
+my $username = find_unused_name();
+my $want_uid = find_unused_uid("system");
+my $want_gid = 0;
+
+my $cmd = "adduser --system --uid $want_uid --gid $want_gid $username";
+
+if (!defined (getpwnam($username))) {
+ print "Testing $cmd... ";
+ `$cmd`;
+ my $error = ($?>>8);
+ if ($error) {
+ print "failed\n adduser returned an errorcode != 0 ($error)\n";
+ exit $error;
+ }
+
+ assert(check_user_exist ($username, $want_uid));
+ assert(check_homedir_exist ($username));
+ assert(check_user_has_gid($username,$want_gid));
+ print "ok\n";
+}
+