diff options
Diffstat (limited to 'testsuite/test5.pl')
-rw-r--r-- | testsuite/test5.pl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/test5.pl b/testsuite/test5.pl new file mode 100644 index 0000000..5695bb7 --- /dev/null +++ b/testsuite/test5.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl -w + +# expect: +# - a new user $USER with uid $want_uid +# - added to group nogroup +# - a home directory /home/$USER + +use strict; +use lib_test; + +my $groupname = "nogroup"; +my $username = find_unused_name(); +my $want_uid = find_unused_uid("system"); + +my $cmd = "adduser --system --uid $want_uid $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_group_exist($groupname)); + assert(check_user_in_group($username,$groupname)); + print "ok\n"; +} + |