Index: usr.sbin/pw/tests/Makefile =================================================================== --- usr.sbin/pw/tests/Makefile (revision 277783) +++ usr.sbin/pw/tests/Makefile (working copy) @@ -11,7 +11,8 @@ pw_groupmod \ pw_useradd \ pw_userdel \ - pw_usermod + pw_usermod \ + pw_usernext .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" Index: usr.sbin/pw/tests/pw_usernext.sh =================================================================== --- usr.sbin/pw/tests/pw_usernext.sh (revision 0) +++ usr.sbin/pw/tests/pw_usernext.sh (working copy) @@ -0,0 +1,40 @@ +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + +# Test usernext after adding a random number of new users. +atf_test_case usernext +usernext_body() { + populate_etc_skel + + var0=1 + LIMIT=`jot -r 1 2 10` + while [ "$var0" -lt "$LIMIT" ] + do + atf_check -s exit:0 ${PW} useradd test$var0 + var0=`expr $var0 + 1` + done + atf_check -s exit:0 -o match:"100${LIMIT}:100${LIMIT}" \ + ${PW} usernext +} + +# Test usernext when multiple users are added to the same group so +# that group id doesn't increment at the same pace as new users. +atf_test_case usernext_assigned_group +usernext_assigned_group_body() { + populate_etc_skel + + var0=1 + LIMIT=`jot -r 1 2 10` + while [ "$var0" -lt "$LIMIT" ] + do + atf_check -s exit:0 ${PW} useradd -n test$var0 -g 0 + var0=`expr $var0 + 1` + done + atf_check -s exit:0 -o match:"100${LIMIT}:1001}" \ + ${PW} usernext +} + +atf_init_test_cases() { + atf_add_test_case usernext + atf_add_test_case usernext_assigned_group +} Property changes on: usr.sbin/pw/tests/pw_usernext.sh ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property