From cfa700b903d57bea5c9fd42be88ad47d5bd40c0b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:03:34 +0200 Subject: Adding upstream version 3.118. Signed-off-by: Daniel Baumann --- testsuite/test3.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 testsuite/test3.pl (limited to 'testsuite/test3.pl') diff --git a/testsuite/test3.pl b/testsuite/test3.pl new file mode 100644 index 0000000..b627f91 --- /dev/null +++ b/testsuite/test3.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +# expect: +# - a new user $USER +# - added to group nogroup +# - no home directory /home/$USER + +use strict; +use lib_test; + +my $groupname = "nogroup"; +my $username = find_unused_name(); +my $cmd = "adduser --system --no-create-home $username"; + +my $homedir = "/home/$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)); + assert(check_group_exist($groupname)); + assert(check_user_in_group($username,$groupname)); + assert(check_homedir_not_exist($homedir)); + print "ok\n"; +} + -- cgit v1.2.3