svn commit: r316257 - in stable/10: . usr.bin/col/tests usr.sbin/pw/tests
Ngie Cooper
ngie at FreeBSD.org
Thu Mar 30 06:21:01 UTC 2017
Author: ngie
Date: Thu Mar 30 06:20:58 2017
New Revision: 316257
URL: https://svnweb.freebsd.org/changeset/base/316257
Log:
MFC r315776:
Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme
usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.
Added:
stable/10/usr.bin/col/tests/col_test.sh
- copied unchanged from r315776, head/usr.bin/col/tests/col_test.sh
stable/10/usr.sbin/pw/tests/pw_config_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_config_test.sh
stable/10/usr.sbin/pw/tests/pw_etcdir_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh
stable/10/usr.sbin/pw/tests/pw_groupadd_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh
stable/10/usr.sbin/pw/tests/pw_groupdel_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh
stable/10/usr.sbin/pw/tests/pw_groupmod_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh
stable/10/usr.sbin/pw/tests/pw_lock_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_lock_test.sh
stable/10/usr.sbin/pw/tests/pw_useradd_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh
stable/10/usr.sbin/pw/tests/pw_userdel_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_userdel_test.sh
stable/10/usr.sbin/pw/tests/pw_usermod_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_usermod_test.sh
stable/10/usr.sbin/pw/tests/pw_usernext_test.sh
- copied unchanged from r315776, head/usr.sbin/pw/tests/pw_usernext_test.sh
Deleted:
stable/10/usr.bin/col/tests/col.sh
stable/10/usr.sbin/pw/tests/pw_config.sh
stable/10/usr.sbin/pw/tests/pw_etcdir.sh
stable/10/usr.sbin/pw/tests/pw_groupadd.sh
stable/10/usr.sbin/pw/tests/pw_groupdel.sh
stable/10/usr.sbin/pw/tests/pw_groupmod.sh
stable/10/usr.sbin/pw/tests/pw_lock.sh
stable/10/usr.sbin/pw/tests/pw_useradd.sh
stable/10/usr.sbin/pw/tests/pw_userdel.sh
stable/10/usr.sbin/pw/tests/pw_usermod.sh
stable/10/usr.sbin/pw/tests/pw_usernext.sh
Modified:
stable/10/ObsoleteFiles.inc
stable/10/usr.bin/col/tests/Makefile
stable/10/usr.sbin/pw/tests/Makefile
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/ObsoleteFiles.inc
==============================================================================
--- stable/10/ObsoleteFiles.inc Thu Mar 30 06:20:24 2017 (r316256)
+++ stable/10/ObsoleteFiles.inc Thu Mar 30 06:20:58 2017 (r316257)
@@ -38,6 +38,18 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20170322: rename <x> to <x>_test to match the FreeBSD test suite name scheme
+OLD_FILES+=usr/tests/usr.bin/col/col
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_config_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_etcdir_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_lock_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupadd_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupdel_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupmod_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_useradd_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_userdel_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_usermod_test
+OLD_FILES+=usr/tests/usr.sbin/pw/pw_usernext_test
# 20170214: Four files from ggate tests consolidated into one
OLD_FILES+=usr/tests/sys/geom/class/gate/1_test
OLD_FILES+=usr/tests/sys/geom/class/gate/2_test
Modified: stable/10/usr.bin/col/tests/Makefile
==============================================================================
--- stable/10/usr.bin/col/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256)
+++ stable/10/usr.bin/col/tests/Makefile Thu Mar 30 06:20:58 2017 (r316257)
@@ -1,6 +1,6 @@
# $FreeBSD$
-ATF_TESTS_SH= col
+ATF_TESTS_SH= col_test
FILES= rlf.in \
rlf2.in
Copied: stable/10/usr.bin/col/tests/col_test.sh (from r315776, head/usr.bin/col/tests/col_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.bin/col/tests/col_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.bin/col/tests/col_test.sh)
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+atf_test_case rlf
+
+rlf_head()
+{
+ atf_set "descr" "testing reverse line feed"
+}
+rlf_body()
+{
+ atf_check \
+ -o inline:"a b\n" \
+ -e empty \
+ -s exit:0 \
+ col < $(atf_get_srcdir)/rlf.in
+
+ atf_check \
+ -o inline:"a b\n" \
+ -e empty \
+ -s exit:0 \
+ col < $(atf_get_srcdir)/rlf2.in
+
+ atf_check \
+ -o inline:"a b\n" \
+ -e empty \
+ -s exit:0 \
+ col -x < $(atf_get_srcdir)/rlf2.in
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case rlf
+}
Modified: stable/10/usr.sbin/pw/tests/Makefile
==============================================================================
--- stable/10/usr.sbin/pw/tests/Makefile Thu Mar 30 06:20:24 2017 (r316256)
+++ stable/10/usr.sbin/pw/tests/Makefile Thu Mar 30 06:20:58 2017 (r316257)
@@ -5,16 +5,16 @@ BINDIR= ${TESTSDIR}
PROGS+= crypt
LDADD+= -lcrypt
-ATF_TESTS_SH= pw_etcdir \
- pw_lock \
- pw_config \
- pw_groupadd \
- pw_groupdel \
- pw_groupmod \
- pw_useradd \
- pw_userdel \
- pw_usermod \
- pw_usernext
+ATF_TESTS_SH= pw_etcdir_test \
+ pw_lock_test \
+ pw_config_test \
+ pw_groupadd_test \
+ pw_groupdel_test \
+ pw_groupmod_test \
+ pw_useradd_test \
+ pw_userdel_test \
+ pw_usermod_test \
+ pw_usernext_test
.for tp in ${ATF_TESTS_SH}
TEST_METADATA.${tp}+= required_user="root"
Copied: stable/10/usr.sbin/pw/tests/pw_config_test.sh (from r315776, head/usr.sbin/pw/tests/pw_config_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_config_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_config_test.sh)
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+atf_test_case generate_config
+generate_config_body() {
+ atf_check -s exit:0 \
+ ${PW} useradd -D -C ${HOME}/foo.conf
+ atf_check -o file:$(atf_get_srcdir)/pw.conf \
+ cat ${HOME}/foo.conf
+}
+
+atf_test_case modify_config_uid_gid_boundaries
+modify_config_uid_gid_boundaries_body() {
+ atf_check -s exit:0 \
+ ${PW} useradd -D -C ${HOME}/foo.conf \
+ -u 2000,5000 -i 2100,6000
+ atf_check -o file:$(atf_get_srcdir)/pw-modified.conf \
+ cat ${HOME}/foo.conf
+}
+
+atf_init_test_cases() {
+ atf_add_test_case generate_config
+ atf_add_test_case modify_config_uid_gid_boundaries
+}
Copied: stable/10/usr.sbin/pw/tests/pw_etcdir_test.sh (from r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_etcdir_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_etcdir_test.sh)
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+# When the '-V directory' option is provided, the directory must exist
+atf_test_case etcdir_must_exist
+etcdir_must_exist_head() {
+ atf_set "descr" "When the '-V directory' option is provided, the directory must exist"
+}
+
+etcdir_must_exist_body() {
+ local fakedir="/this_directory_does_not_exist"
+ atf_check -e inline:"pw: no such directory \`$fakedir'\n" \
+ -s exit:72 -x pw -V ${fakedir} usershow root
+}
+
+atf_init_test_cases() {
+ atf_add_test_case etcdir_must_exist
+}
+
Copied: stable/10/usr.sbin/pw/tests/pw_groupadd_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_groupadd_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_groupadd_test.sh)
@@ -0,0 +1,26 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+atf_test_case group_add_gid_too_large
+group_add_gid_too_large_body() {
+ populate_etc_skel
+ atf_check -s exit:64 -e inline:"pw: Bad id '9999999999999': too large\n" \
+ ${PW} groupadd -n test1 -g 9999999999999
+}
+
+atf_test_case group_add_already_exists
+group_add_already_exists_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} groupadd foo
+ atf_check -s exit:65 \
+ -e inline:"pw: group name \`foo' already exists\n" \
+ ${PW} groupadd foo
+}
+
+atf_init_test_cases() {
+ atf_add_test_case group_add_gid_too_large
+ atf_add_test_case group_add_already_exists
+}
Copied: stable/10/usr.sbin/pw/tests/pw_groupdel_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_groupdel_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_groupdel_test.sh)
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+
+# Test to make sure we do not accidentially delete wheel when trying to delete
+# an unknown group
+atf_test_case group_do_not_delete_wheel_if_group_unknown
+group_do_not_delete_wheel_if_group_unknown_head() {
+ atf_set "descr" "Make sure we do not consider gid 0 an unknown group"
+}
+group_do_not_delete_wheel_if_group_unknown_body() {
+ populate_etc_skel
+ atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel
+ atf_check -e inline:"pw: Bad id 'I_do_not_exist': invalid\n" -s exit:64 -x \
+ ${PW} groupdel -g I_do_not_exist
+ atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel
+}
+
+
+atf_init_test_cases() {
+ atf_add_test_case group_do_not_delete_wheel_if_group_unknown
+}
Copied: stable/10/usr.sbin/pw/tests/pw_groupmod_test.sh (from r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_groupmod_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_groupmod_test.sh)
@@ -0,0 +1,118 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+
+# Test adding & removing a user from a group
+atf_test_case groupmod_user
+groupmod_user_body() {
+ populate_etc_skel
+ atf_check -s exit:0 ${PW} addgroup test
+ atf_check -s exit:0 ${PW} groupmod test -m root
+ atf_check -s exit:0 -o match:"^test:\*:1001:root$" \
+ grep "^test:\*:.*:root$" $HOME/group
+ atf_check -s exit:0 ${PW} groupmod test -d root
+ atf_check -s exit:0 -o match:"^test:\*:1001:$" \
+ grep "^test:\*:.*:$" $HOME/group
+}
+
+
+# Test adding and removing a user that does not exist
+atf_test_case groupmod_invalid_user
+groupmod_invalid_user_body() {
+ populate_etc_skel
+ atf_check -s exit:0 ${PW} addgroup test
+ atf_check -s exit:67 -e match:"does not exist" ${PW} groupmod test -m foo
+ atf_check -s exit:0 ${PW} groupmod test -d foo
+}
+
+atf_test_case groupmod_bug_193704
+groupmod_bug_193704_head() {
+ atf_set "descr" "Regression test for the #193704 bug"
+}
+groupmod_bug_193704_body() {
+ populate_etc_skel
+ atf_check -s exit:0 -x ${PW} groupadd test
+ atf_check -s exit:0 -x ${PW} groupmod test -l newgroupname
+ atf_check -s exit:65 -e match:"^pw: unknown group" -x ${PW} groupshow test
+}
+
+atf_test_case usermod_bug_185666
+usermod_bug_185666_head() {
+ atf_set "descr" "Regression test for the #185666 bug"
+}
+
+usermod_bug_185666_body() {
+ populate_etc_skel
+ atf_check -s exit:0 -x ${PW} useradd testuser
+ atf_check -s exit:0 -x ${PW} groupadd testgroup
+ atf_check -s exit:0 -x ${PW} groupadd testgroup2
+ atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup
+ atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser
+ atf_check -o inline:"testgroup:*:1002:testuser\n" -x ${PW} groupshow testgroup
+ atf_check -o inline:"testgroup2:*:1003:\n" -x ${PW} groupshow testgroup2
+ atf_check -s exit:0 -x ${PW} usermod testuser -G testgroup2
+ atf_check -o inline:"testuser:*:1001:\n" -x ${PW} groupshow testuser
+ atf_check -o inline:"testgroup:*:1002:\n" -x ${PW} groupshow testgroup
+ atf_check -o inline:"testgroup2:*:1003:testuser\n" -x ${PW} groupshow testgroup2
+}
+
+atf_test_case do_not_duplicate_group_on_gid_change
+do_not_duplicate_group_on_gid_change_head() {
+ atf_set "descr" "Do not duplicate group on gid change"
+}
+
+do_not_duplicate_group_on_gid_change_body() {
+ populate_etc_skel
+ atf_check -s exit:0 -x ${PW} groupadd testgroup
+ atf_check -s exit:0 -x ${PW} groupmod testgroup -g 12345
+ # use grep to see if the entry has not be duplicated
+ atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group
+}
+
+atf_test_case groupmod_rename
+groupmod_rename_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} groupadd foo
+ atf_check -s exit:0 ${PW} groupmod foo -l bar
+ atf_check -s exit:0 -o match:"^bar:.*" \
+ grep "^bar:.*" ${HOME}/group
+}
+
+atf_test_case groupmod_members
+groupmod_members_body() {
+ populate_etc_skel
+
+ for i in user1 user2 user3 user4; do
+ atf_check -s exit:0 ${PW} useradd $i
+ done
+
+ atf_check -s exit:0 ${PW} groupadd foo -M "user1, user2"
+ atf_check -o inline:"foo:*:1005:user1,user2\n" -s exit:0 \
+ ${PW} groupshow foo
+ atf_check -s exit:0 ${PW} groupmod foo -m "user3, user4"
+ atf_check -o inline:"foo:*:1005:user1,user2,user3,user4\n" -s exit:0 \
+ ${PW} groupshow foo
+ atf_check -s exit:0 ${PW} groupmod foo -M "user1, user4"
+ atf_check -o inline:"foo:*:1005:user1,user4\n" -s exit:0 \
+ ${PW} groupshow foo
+ # what about duplicates
+ atf_check -s exit:0 ${PW} groupmod foo -m "user1, user2, user3, user4"
+ atf_check -o inline:"foo:*:1005:user1,user4,user2,user3\n" -s exit:0 \
+ ${PW} groupshow foo
+ atf_check -s exit:0 ${PW} groupmod foo -d "user1, user3"
+ atf_check -o inline:"foo:*:1005:user4,user2\n" -s exit:0 \
+ ${PW} groupshow foo
+}
+
+atf_init_test_cases() {
+ atf_add_test_case groupmod_user
+ atf_add_test_case groupmod_invalid_user
+ atf_add_test_case groupmod_bug_193704
+ atf_add_test_case usermod_bug_185666
+ atf_add_test_case do_not_duplicate_group_on_gid_change
+ atf_add_test_case groupmod_rename
+ atf_add_test_case groupmod_members
+}
Copied: stable/10/usr.sbin/pw/tests/pw_lock_test.sh (from r315776, head/usr.sbin/pw/tests/pw_lock_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_lock_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_lock_test.sh)
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+# Test locking and unlocking a user account
+atf_test_case user_locking cleanup
+user_locking_body() {
+ populate_etc_skel
+ ${PW} useradd test || atf_fail "Creating test user"
+ ${PW} lock test || atf_fail "Locking the user"
+ atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \
+ grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd
+ ${PW} unlock test || atf_fail "Locking the user"
+ atf_check -s exit:0 -o match:"^test:\*:1001:" \
+ grep "^test:\*:1001:" $HOME/master.passwd
+}
+
+atf_test_case numeric_locking cleanup
+numeric_locking_body() {
+ populate_etc_skel
+ ${PW} useradd test || atf_fail "Creating test user"
+ ${PW} lock 1001 || atf_fail "Locking the user"
+ atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \
+ grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd
+ ${PW} unlock 1001 || atf_fail "Unlocking the user"
+ atf_check -s exit:0 -o match:"^test:\*:1001:" \
+ grep "^test:\*:1001:" $HOME/master.passwd
+ # Now numeric names
+ ${PW} useradd -n 1001 || atf_fail "Creating test user"
+ ${PW} lock 1001 || atf_fail "Locking the user"
+ atf_check -s exit:0 -o match:"^1001:\*LOCKED\*\*:1002:" \
+ grep "^1001:\*LOCKED\*\*:1002:" $HOME/master.passwd
+ ${PW} unlock 1001 || atf_fail "Unlocking the user"
+ atf_check -s exit:0 -o match:"^1001:\*:1002:" \
+ grep "^1001:\*:1002:" $HOME/master.passwd
+}
+
+atf_init_test_cases() {
+ atf_add_test_case user_locking
+ atf_add_test_case numeric_locking
+}
Copied: stable/10/usr.sbin/pw/tests/pw_useradd_test.sh (from r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_useradd_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_useradd_test.sh)
@@ -0,0 +1,422 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+# Test add user
+atf_test_case user_add
+user_add_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd test
+ atf_check -s exit:0 -o match:"^test:.*" \
+ grep "^test:.*" $HOME/master.passwd
+}
+
+# Test add user with option -N
+atf_test_case user_add_noupdate
+user_add_noupdate_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 -o match:"^test:.*" ${PW} useradd test -N
+ atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd
+}
+
+# Test add user with comments
+atf_test_case user_add_comments
+user_add_comments_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd test -c "Test User,work,123,456"
+ atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \
+ grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd
+}
+
+# Test add user with comments and option -N
+atf_test_case user_add_comments_noupdate
+user_add_comments_noupdate_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \
+ ${PW} useradd test -c "Test User,work,123,456" -N
+ atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd
+}
+
+# Test add user with invalid comments
+atf_test_case user_add_comments_invalid
+user_add_comments_invalid_body() {
+ populate_etc_skel
+
+ atf_check -s exit:65 -e match:"invalid character" \
+ ${PW} useradd test -c "Test User,work,123:456,456"
+ atf_check -s exit:1 -o empty \
+ grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd
+}
+
+# Test add user with invalid comments and option -N
+atf_test_case user_add_comments_invalid_noupdate
+user_add_comments_invalid_noupdate_body() {
+ populate_etc_skel
+
+ atf_check -s exit:65 -e match:"invalid character" \
+ ${PW} useradd test -c "Test User,work,123:456,456" -N
+ atf_check -s exit:1 -o empty grep "^test:.*" $HOME/master.passwd
+}
+
+# Test add user with alternate homedir
+atf_test_case user_add_homedir
+user_add_homedir_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd test -d /foo/bar
+ atf_check -s exit:0 -o match:"^test:\*:.*::0:0:User &:/foo/bar:.*" \
+ ${PW} usershow test
+}
+
+# Test add user with account expiration as an epoch date
+atf_test_case user_add_account_expiration_epoch
+user_add_account_expiration_epoch_body() {
+ populate_etc_skel
+
+ DATE=`date -j -v+1d "+%s"`
+ atf_check -s exit:0 ${PW} useradd test -e ${DATE}
+ atf_check -s exit:0 -o match:"^test:\*:.*::0:${DATE}:.*" \
+ ${PW} usershow test
+}
+
+# Test add user with account expiration as a DD-MM-YYYY date
+atf_test_case user_add_account_expiration_date_numeric
+user_add_account_expiration_date_numeric_body() {
+ populate_etc_skel
+
+ DATE=`date -j -v+1d "+%d-%m-%Y"`
+ EPOCH=`date -j -f "%d-%m-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"`
+ atf_check -s exit:0 ${PW} useradd test -e ${DATE}
+ atf_check -s exit:0 -o match:"^test:\*:.*::0:${EPOCH}:User &:.*" \
+ ${PW} usershow test
+}
+
+# Test add user with account expiration as a DD-MM-YYYY date
+atf_test_case user_add_account_expiration_date_month
+user_add_account_expiration_date_month_body() {
+ populate_etc_skel
+
+ DATE=`date -j -v+1d "+%d-%b-%Y"`
+ EPOCH=`date -j -f "%d-%b-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"`
+ atf_check -s exit:0 ${PW} useradd test -e ${DATE}
+ atf_check -s exit:0 -o match:"^test:\*:.*::0:${EPOCH}:User &:.*" \
+ ${PW} usershow test
+}
+
+# Test add user with account expiration as a relative date
+atf_test_case user_add_account_expiration_date_relative
+user_add_account_expiration_date_relative_body() {
+ populate_etc_skel
+
+ EPOCH=`date -j -v+13m "+%s"`
+ BUF=`expr $EPOCH + 5`
+ atf_check -s exit:0 ${PW} useradd test -e +13o
+ TIME=`${PW} usershow test | awk -F ':' '{print $7}'`
+ [ ! -z $TIME -a $TIME -ge $EPOCH -a $TIME -lt $BUF ] || \
+ atf_fail "Expiration time($TIME) was not within $EPOCH - $BUF seconds."
+}
+
+# Test add user with password expiration as an epoch date
+atf_test_case user_add_password_expiration_epoch
+user_add_password_expiration_epoch_body() {
+ populate_etc_skel
+
+ DATE=`date -j -v+1d "+%s"`
+ atf_check -s exit:0 ${PW} useradd test -p ${DATE}
+ atf_check -s exit:0 -o match:"^test:\*:.*::${DATE}:0:.*" \
+ ${PW} usershow test
+}
+
+# Test add user with password expiration as a DD-MM-YYYY date
+atf_test_case user_add_password_expiration_date_numeric
+user_add_password_expiration_date_numeric_body() {
+ populate_etc_skel
+
+ DATE=`date -j -v+1d "+%d-%m-%Y"`
+ EPOCH=`date -j -f "%d-%m-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"`
+ atf_check -s exit:0 ${PW} useradd test -p ${DATE}
+ atf_check -s exit:0 -o match:"^test:\*:.*::${EPOCH}:0:User &:.*" \
+ ${PW} usershow test
+}
+
+# Test add user with password expiration as a DD-MMM-YYYY date
+atf_test_case user_add_password_expiration_date_month
+user_add_password_expiration_date_month_body() {
+ populate_etc_skel
+
+ DATE=`date -j -v+1d "+%d-%b-%Y"`
+ EPOCH=`date -j -f "%d-%b-%Y %H:%M:%S" "${DATE} 00:00:00" "+%s"`
+ atf_check -s exit:0 ${PW} useradd test -p ${DATE}
+ atf_check -s exit:0 -o match:"^test:\*:.*::${EPOCH}:0:User &:.*" \
+ ${PW} usershow test
+}
+
+# Test add user with password expiration as a relative date
+atf_test_case user_add_password_expiration_date_relative
+user_add_password_expiration_date_relative_body() {
+ populate_etc_skel
+
+ EPOCH=`date -j -v+13m "+%s"`
+ BUF=`expr $EPOCH + 5`
+ atf_check -s exit:0 ${PW} useradd test -p +13o
+ TIME=`${PW} usershow test | awk -F ':' '{print $6}'`
+ [ ! -z $TIME -a $TIME -ge $EPOCH -a $TIME -lt $BUF ] || \
+ atf_fail "Expiration time($TIME) was not within $EPOCH - $BUF seconds."
+}
+
+atf_test_case user_add_name_too_long
+user_add_name_too_long_body() {
+ populate_etc_skel
+ atf_check -e match:"too long" -s exit:64 \
+ ${PW} useradd name_very_vert_very_very_very_long
+}
+
+atf_test_case user_add_expiration
+user_add_expiration_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 \
+ ${PW} useradd foo -e 20-03-2037
+ atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \
+ -s exit:0 grep "^foo" ${HOME}/master.passwd
+ atf_check -s exit:0 ${PW} userdel foo
+ atf_check -s exit:0 \
+ ${PW} useradd foo -e 20-03-37
+ atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \
+ -s exit:0 grep "^foo" ${HOME}/master.passwd
+ atf_check -s exit:0 ${PW} userdel foo
+ atf_check -s exit:0 \
+ ${PW} useradd foo -e 20-Mar-2037
+ atf_check -o inline:"foo:*:1001:1001::0:2121120000:User &:/home/foo:/bin/sh\n" \
+ -s exit:0 grep "^foo" ${HOME}/master.passwd
+ atf_check -s exit:0 ${PW} userdel foo
+ atf_check -e inline:"pw: Invalid date\n" -s exit:1 \
+ ${PW} useradd foo -e 20-Foo-2037
+ atf_check -e inline:"pw: Invalid date\n" -s exit:1 \
+ ${PW} useradd foo -e 20-13-2037
+ atf_check -s exit:0 ${PW} useradd foo -e "12:00 20-03-2037"
+ atf_check -s exit:0 ${PW} userdel foo
+ atf_check -e inline:"pw: Invalid date\n" -s exit:1 \
+ ${PW} useradd foo -e "12 20-03-2037"
+ atf_check -s exit:0 ${PW} useradd foo -e "20-03-2037 12:00"
+ atf_check -s exit:0 ${PW} userdel foo
+}
+
+atf_test_case user_add_invalid_user_entry
+user_add_invalid_user_entry_body() {
+ touch ${HOME}/master.passwd
+ touch ${HOME}/group
+
+ pwd_mkdb -p -d ${HOME} ${HOME}/master.passwd || \
+ atf_fail "generate passwd from master.passwd"
+ atf_check -s exit:0 ${PW} useradd foo
+ echo "foo1:*:1002" >> ${HOME}/master.passwd
+ atf_check -s exit:1 -e match:"Invalid user entry" ${PW} useradd foo2
+}
+
+atf_test_case user_add_invalid_group_entry
+user_add_invalid_group_entry_body() {
+ touch ${HOME}/master.passwd
+ touch ${HOME}/group
+
+ pwd_mkdb -p -d ${HOME} ${HOME}/master.passwd || \
+ atf_fail "generate passwd from master.passwd"
+ atf_check -s exit:0 ${PW} useradd foo
+ echo 'foo1:*:1002' >> group
+ atf_check -s exit:1 -e match:"Invalid group entry" ${PW} useradd foo2
+}
+
+atf_test_case user_add_password_from_h
+user_add_password_from_h_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo -h 0 <<-EOF
+ $(echo mypassword)
+ EOF
+ passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd`
+ atf_check -s exit:0 -o inline:$passhash \
+ $(atf_get_srcdir)/crypt $passhash "mypassword"
+}
+
+atf_test_case user_add_R
+user_add_R_body() {
+ populate_root_etc_skel
+
+ atf_check -s exit:0 ${RPW} useradd foo
+ atf_check -s exit:0 ${RPW} useradd bar -m
+ test -d ${HOME}/home || atf_fail "Home parent directory not created"
+ test -d ${HOME}/home/bar || atf_fail "Directory not created"
+ atf_check -s exit:0 ${RPW} userdel bar
+ test -d ${HOME}/home/bar || atf_fail "Directory removed"
+ atf_check -s exit:0 ${RPW} useradd bar
+ atf_check -s exit:0 ${RPW} userdel bar -r
+ [ ! -d ${HOME}/home/bar ] || atf_fail "Directory not removed"
+}
+
+atf_test_case user_add_R_symlink
+user_add_R_symlink_body() {
+ populate_root_etc_skel
+
+ mkdir ${HOME}/usr
+ atf_check -s exit:0 ${RPW} useradd foo -m
+ test -d ${HOME}/usr/home || atf_fail "Home parent directory not created"
+ test -h ${HOME}/home || atf_fail "/home directory is not a symlink"
+ atf_check -s exit:0 -o inline:"usr/home\n" readlink ${HOME}/home
+}
+
+atf_test_case user_add_skel
+user_add_skel_body() {
+ populate_root_etc_skel
+
+ mkdir ${HOME}/skel
+ echo "a" > ${HOME}/skel/.a
+ echo "b" > ${HOME}/skel/b
+ mkdir ${HOME}/skel/c
+ mkdir ${HOME}/skel/c/d
+ mkdir ${HOME}/skel/dot.plop
+ echo "c" > ${HOME}/skel/c/d/dot.c
+ mkdir ${HOME}/home
+ ln -sf /nonexistent ${HOME}/skel/c/foo
+ atf_check -s exit:0 ${RPW} useradd foo -k /skel -m
+ test -d ${HOME}/home/foo || atf_fail "Directory not created"
+ test -f ${HOME}/home/foo/.a || atf_fail "File not created"
+ atf_check -o file:${HOME}/skel/.a -s exit:0 cat ${HOME}/home/foo/.a
+ atf_check -o file:${HOME}/skel/b -s exit:0 cat ${HOME}/home/foo/b
+ test -d ${HOME}/home/foo/c || atf_fail "Dotted directory in skel not copied"
+ test -d ${HOME}/home/foo/.plop || atf_fail "Directory in skell not created"
+ atf_check -o inline:"/nonexistent\n" -s ignore readlink -f ${HOME}/home/foo/c/foo
+ atf_check -o file:${HOME}/skel/c/d/dot.c -s exit:0 cat ${HOME}/home/foo/c/d/.c
+}
+
+atf_test_case user_add_uid0
+user_add_uid0_body() {
+ populate_etc_skel
+ atf_check -e inline:"pw: WARNING: new account \`foo' has a uid of 0 (superuser access!)\n" \
+ -s exit:0 ${PW} useradd foo -u 0 -g 0 -d /root -s /bin/sh -c "Bourne-again Superuser" -o
+ atf_check \
+ -o inline:"foo:*:0:0::0:0:Bourne-again Superuser:/root:/bin/sh\n" \
+ -s exit:0 ${PW} usershow foo
+}
+
+atf_test_case user_add_uid_too_large
+user_add_uid_too_large_body() {
+ populate_etc_skel
+ atf_check -s exit:64 -e inline:"pw: Bad id '9999999999999': too large\n" \
+ ${PW} useradd -n test1 -u 9999999999999
+}
+
+atf_test_case user_add_bad_shell
+user_add_bad_shell_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo -s sh
+ atf_check -s exit:78 -e ignore ${PW} useradd bar -s badshell
+}
+
+atf_test_case user_add_already_exists
+user_add_already_exists_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo
+ atf_check -s exit:65 \
+ -e inline:"pw: login name \`foo' already exists\n" \
+ ${PW} useradd foo
+}
+
+atf_test_case user_add_w_error
+user_add_w_error_body() {
+ populate_etc_skel
+
+ atf_check -s exit:1 -e match:"pw: Invalid value for default password" \
+ ${PW} useradd foo -w invalid_value
+}
+
+atf_test_case user_add_w_no
+user_add_w_no_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo -w no
+ atf_check -s exit:0 -o match:"^foo:\*" grep "^foo:" $HOME/master.passwd
+}
+
+atf_test_case user_add_w_none
+user_add_w_none_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo -w none
+ atf_check -s exit:0 -o match:"^foo::" grep "^foo:" $HOME/master.passwd
+}
+
+atf_test_case user_add_w_random
+user_add_w_random_body() {
+ populate_etc_skel
+
+ password=`${PW} useradd foo -w random | cat`
+ passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd`
+ atf_check -s exit:0 -o inline:$passhash \
+ $(atf_get_srcdir)/crypt $passhash "$password"
+}
+
+atf_test_case user_add_w_yes
+user_add_w_yes_body() {
+ populate_etc_skel
+ password=`${PW} useradd foo -w random | cat`
+ passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd`
+ atf_check -s exit:0 -o inline:$passhash \
+ $(atf_get_srcdir)/crypt $passhash "$password"
+}
+
+atf_test_case user_add_with_pw_conf
+user_add_with_pw_conf_body()
+{
+ populate_etc_skel
+ atf_check -s exit:0 \
+ ${PW} useradd -D -C ${HOME}/pw.conf \
+ -u 2000,32767 -i 2000,32767
+ atf_check -s exit:0 \
+ -o inline:"minuid = 2000\nmaxuid = 32767\nmingid = 2000\nmaxgid = 32767\n" \
+ grep "^m.*id =" ${HOME}/pw.conf
+ atf_check -s exit:0 \
+ ${PW} useradd foo -C ${HOME}/pw.conf
+}
+
+atf_init_test_cases() {
+ atf_add_test_case user_add
+ atf_add_test_case user_add_noupdate
+ atf_add_test_case user_add_comments
+ atf_add_test_case user_add_comments_noupdate
+ atf_add_test_case user_add_comments_invalid
+ atf_add_test_case user_add_comments_invalid_noupdate
+ atf_add_test_case user_add_homedir
+ atf_add_test_case user_add_account_expiration_epoch
+ atf_add_test_case user_add_account_expiration_date_numeric
+ atf_add_test_case user_add_account_expiration_date_month
+ atf_add_test_case user_add_account_expiration_date_relative
+ atf_add_test_case user_add_password_expiration_epoch
+ atf_add_test_case user_add_password_expiration_date_numeric
+ atf_add_test_case user_add_password_expiration_date_month
+ atf_add_test_case user_add_password_expiration_date_relative
+ atf_add_test_case user_add_name_too_long
+ atf_add_test_case user_add_expiration
+ atf_add_test_case user_add_invalid_user_entry
+ atf_add_test_case user_add_invalid_group_entry
+ atf_add_test_case user_add_password_from_h
+ atf_add_test_case user_add_R
+ atf_add_test_case user_add_R_symlink
+ atf_add_test_case user_add_skel
+ atf_add_test_case user_add_uid0
+ atf_add_test_case user_add_uid_too_large
+ atf_add_test_case user_add_bad_shell
+ atf_add_test_case user_add_already_exists
+ atf_add_test_case user_add_w_error
+ atf_add_test_case user_add_w_no
+ atf_add_test_case user_add_w_none
+ atf_add_test_case user_add_w_random
+ atf_add_test_case user_add_w_yes
+ atf_add_test_case user_add_with_pw_conf
+}
Copied: stable/10/usr.sbin/pw/tests/pw_userdel_test.sh (from r315776, head/usr.sbin/pw/tests/pw_userdel_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_userdel_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_userdel_test.sh)
@@ -0,0 +1,76 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+
+# Test that a user can be deleted when another user is part of this
+# user's default group and does not go into an infinate loop.
+# PR: 191427
+atf_test_case rmuser_seperate_group cleanup
+rmuser_seperate_group_head() {
+ atf_set "timeout" "30"
+}
+rmuser_seperate_group_body() {
+ populate_etc_skel
+ ${PW} useradd test || atf_fail "Creating test user"
+ ${PW} groupmod test -M 'test,root' || \
+ atf_fail "Modifying the group"
+ ${PW} userdel test || atf_fail "Delete the test user"
+}
+
+
+atf_test_case user_do_not_try_to_delete_root_if_user_unknown
+user_do_not_try_to_delete_root_if_user_unknown_head() {
+ atf_set "descr" \
+ "Make sure not to try to remove root if deleting an unknown user"
+}
+user_do_not_try_to_delete_root_if_user_unknown_body() {
+ populate_etc_skel
+ atf_check -e inline:"pw: Bad id 'plop': invalid\n" -s exit:64 -x \
+ ${PW} userdel -u plop
+}
+
+atf_test_case delete_files
+delete_files_body() {
+ populate_root_etc_skel
+
+ mkdir -p ${HOME}/skel
+ touch ${HOME}/skel/a
+ mkdir -p ${HOME}/home
+ mkdir -p ${HOME}/var/mail
+ echo "foo wedontcare" > ${HOME}/etc/opiekeys
+ atf_check -s exit:0 ${RPW} useradd foo -k /skel -m
+ test -d ${HOME}/home || atf_fail "Fail to create home directory"
+ test -f ${HOME}/var/mail/foo || atf_fail "Mail file not created"
+ atf_check -s exit:0 ${RPW} userdel foo -r
+ atf_check -s exit:0 -o inline:"#oo wedontcare\n" cat ${HOME}/etc/opiekeys
+ if test -f ${HOME}/var/mail/foo; then
+ atf_fail "Mail file not removed"
+ fi
+}
+
+atf_test_case delete_numeric_name
+delete_numeric_name_body() {
+ populate_etc_skel
+
+ atf_check ${PW} useradd -n foo -u 4001
+ atf_check -e inline:"pw: no such user \`4001'\n" -s exit:67 \
+ ${PW} userdel -n 4001
+}
+
+atf_test_case home_not_a_dir
+home_not_a_dir_body() {
+ populate_root_etc_skel
+ touch ${HOME}/foo
+ atf_check ${RPW} useradd foo -d /foo
+ atf_check ${RPW} userdel foo -r
+}
+
+atf_init_test_cases() {
+ atf_add_test_case rmuser_seperate_group
+ atf_add_test_case user_do_not_try_to_delete_root_if_user_unknown
+ atf_add_test_case delete_files
+ atf_add_test_case delete_numeric_name
+ atf_add_test_case home_not_a_dir
+}
Copied: stable/10/usr.sbin/pw/tests/pw_usermod_test.sh (from r315776, head/usr.sbin/pw/tests/pw_usermod_test.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ stable/10/usr.sbin/pw/tests/pw_usermod_test.sh Thu Mar 30 06:20:58 2017 (r316257, copy of r315776, head/usr.sbin/pw/tests/pw_usermod_test.sh)
@@ -0,0 +1,299 @@
+# $FreeBSD$
+
+# Import helper functions
+. $(atf_get_srcdir)/helper_functions.shin
+
+# Test modifying a user
+atf_test_case user_mod
+user_mod_body() {
+ populate_etc_skel
+
+ atf_check -s exit:67 -e match:"no such user" ${PW} usermod test
+ atf_check -s exit:0 ${PW} useradd test
+ atf_check -s exit:0 ${PW} usermod test
+ atf_check -s exit:0 -o match:"^test:.*" \
+ grep "^test:.*" $HOME/master.passwd
+}
+
+# Test modifying a user with option -N
+atf_test_case user_mod_noupdate
+user_mod_noupdate_body() {
+ populate_etc_skel
+
+ atf_check -s exit:67 -e match:"no such user" ${PW} usermod test -N
+ atf_check -s exit:0 ${PW} useradd test
+ atf_check -s exit:0 -o match:"^test:.*" ${PW} usermod test -N
+ atf_check -s exit:0 -o match:"^test:.*" \
+ grep "^test:.*" $HOME/master.passwd
+}
+
+# Test modifying a user with comments
+atf_test_case user_mod_comments
+user_mod_comments_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456"
+ atf_check -s exit:0 ${PW} usermod test -c "Test User,work,123,456"
+ atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \
+ grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd
+}
+
+# Test modifying a user with comments with option -N
+atf_test_case user_mod_comments_noupdate
+user_mod_comments_noupdate_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456"
+ atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \
+ ${PW} usermod test -c "Test User,work,123,456" -N
+ atf_check -s exit:0 -o match:"^test:.*:Test User,home,123,456:" \
+ grep "^test:.*:Test User,home,123,456:" $HOME/master.passwd
+}
+
+# Test modifying a user with invalid comments
+atf_test_case user_mod_comments_invalid
+user_mod_comments_invalid_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd test
+ atf_check -s exit:65 -e match:"invalid character" \
+ ${PW} usermod test -c "Test User,work,123:456,456"
+ atf_check -s exit:1 -o empty \
+ grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd
+ atf_check -s exit:0 -o match:"^test:\*" \
+ grep "^test:\*" $HOME/master.passwd
+}
+
+# Test modifying a user with invalid comments with option -N
+atf_test_case user_mod_comments_invalid_noupdate
+user_mod_comments_invalid_noupdate_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd test
+ atf_check -s exit:65 -e match:"invalid character" \
+ ${PW} usermod test -c "Test User,work,123:456,456" -N
+ atf_check -s exit:1 -o empty \
+ grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd
+ atf_check -s exit:0 -o match:"^test:\*" \
+ grep "^test:\*" $HOME/master.passwd
+}
+
+# Test modifying a user name with -l
+atf_test_case user_mod_name
+user_mod_name_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo
+ atf_check -s exit:0 ${PW} usermod foo -l "bar"
+ atf_check -s exit:0 -o match:"^bar:.*" \
+ grep "^bar:.*" $HOME/master.passwd
+}
+
+# Test modifying a user name with -l with option -N
+atf_test_case user_mod_name_noupdate
+user_mod_name_noupdate_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} useradd foo
+ atf_check -s exit:0 -o match:"^bar:.*" ${PW} usermod foo -l "bar" -N
+ atf_check -s exit:0 -o match:"^foo:.*" \
+ grep "^foo:.*" $HOME/master.passwd
+}
+
+atf_test_case user_mod_rename_multigroups
+user_mod_rename_multigroups_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} groupadd test1
+ atf_check -s exit:0 ${PW} groupadd test2
+ atf_check -s exit:0 ${PW} useradd foo -G test1,test2
+ atf_check -o match:"foo" -s exit:0 ${PW} groupshow test1
+ atf_check -o match:"foo" -s exit:0 ${PW} groupshow test2
+ atf_check -s exit:0 ${PW} usermod foo -l bar
+ atf_check -o match:"bar" -s exit:0 ${PW} groupshow test1
+ atf_check -o match:"bar" -s exit:0 ${PW} groupshow test2
+}
+
+atf_test_case user_mod_nogroups
+user_mod_nogroups_body() {
+ populate_etc_skel
+
+ atf_check -s exit:0 ${PW} groupadd test1
+ atf_check -s exit:0 ${PW} groupadd test2
+ atf_check -s exit:0 ${PW} groupadd test3
+ atf_check -s exit:0 ${PW} groupadd test4
+ atf_check -s exit:0 ${PW} useradd foo -G test1,test2
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-stable-10
mailing list