diff options
Diffstat (limited to 'pw/tests')
| -rw-r--r-- | pw/tests/Makefile | 3 | ||||
| -rw-r--r-- | pw/tests/pw.conf | 62 | ||||
| -rwxr-xr-x | pw/tests/pw_config.sh | 16 |
3 files changed, 80 insertions, 1 deletions
diff --git a/pw/tests/Makefile b/pw/tests/Makefile index 37d9c71..09fe93c 100644 --- a/pw/tests/Makefile +++ b/pw/tests/Makefile @@ -7,6 +7,7 @@ TESTSDIR= ${TESTSBASE}/usr.sbin/pw ATF_TESTS_SH= pw_etcdir \ pw_lock \ + pw_config \ pw_groupdel \ pw_groupmod \ pw_useradd \ @@ -18,7 +19,7 @@ ATF_TESTS_SH= pw_etcdir \ TEST_METADATA.${tp}+= required_user="root" .endfor -FILES= group helper_functions.shin master.passwd +FILES= group helper_functions.shin master.passwd pw.conf FILESDIR= ${TESTSDIR} ATF_TESTS_SH+= pw_test diff --git a/pw/tests/pw.conf b/pw/tests/pw.conf new file mode 100644 index 0000000..4e493f6 --- /dev/null +++ b/pw/tests/pw.conf @@ -0,0 +1,62 @@ +# +# pw.conf - user/group configuration defaults +# + +# Password for new users? no=nologin yes=loginid none=blank random=random +defaultpasswd = "no" + +# Reuse gaps in uid sequence? (yes or no) +reuseuids = "no" + +# Reuse gaps in gid sequence? (yes or no) +reusegids = "no" + +# Path to the NIS passwd file (blank or 'no' for none) +nispasswd = + +# Obtain default dotfiles from this directory +skeleton = "/usr/share/skel" + +# Mail this file to new user (/etc/newuser.msg or no) +newmail = "no" + +# Log add/change/remove information in this file +logfile = "/var/log/userlog" + +# Root directory in which $HOME directory is created +home = "/home" + +# Mode for the new $HOME directory, will be modified by umask +homemode = 0777 + +# Colon separated list of directories containing valid shells +shellpath = "/bin" + +# Comma separated list of available shells (without paths) +shells = "sh","csh","tcsh" + +# Default shell (without path) +defaultshell = "sh" + +# Default group (leave blank for new group per user) +defaultgroup = "" + +# Extra groups for new users +extragroups = + +# Default login class for new users +defaultclass = "" + +# Range of valid default user ids +minuid = 1000 +maxuid = 32000 + +# Range of valid default group ids +mingid = 1000 +maxgid = 32000 + +# Days after which account expires (0=disabled) +expire_days = 0 + +# Days after which password expires (0=disabled) +password_days = 0 diff --git a/pw/tests/pw_config.sh b/pw/tests/pw_config.sh new file mode 100755 index 0000000..b5a4fad --- /dev/null +++ b/pw/tests/pw_config.sh @@ -0,0 +1,16 @@ +# $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_init_test_cases() { + atf_add_test_case generate_config +} |
