diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index f325fe377132..5c54598438be 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1,276 +1,278 @@ # $FreeBSD$ # # Please see the file src/etc/mtree/README before making changes to this file. # /set type=dir uname=root gname=wheel mode=0755 . include atf-c .. atf-c++ .. .. share atf .. doc atf .. .. .. tests bin + chown + .. date .. mv .. pax .. pkill .. sh builtins .. errors .. execution .. expansion .. parameters .. parser .. set-e .. .. test .. .. cddl lib .. sbin .. usr.bin .. usr.sbin .. .. etc .. games .. gnu lib .. usr.bin .. .. lib atf libatf-c detail .. .. libatf-c++ detail .. .. test-programs .. .. libcrypt .. .. libexec atf atf-check .. atf-sh .. .. rtld-elf .. .. sbin dhclient .. growfs .. mdconfig .. .. secure lib .. libexec .. usr.bin .. usr.sbin .. .. share examples tests atf .. plain .. .. .. .. sys kern .. netinet .. .. usr.bin apply .. bmake archives fmt_44bsd .. fmt_44bsd_mod .. fmt_oldbsd .. .. basic t0 .. t1 .. t2 .. t3 .. .. execution ellipsis .. empty .. joberr .. plus .. .. shell builtin .. meta .. path .. path_select .. replace .. select .. .. suffixes basic .. src_wild1 .. src_wild2 .. .. syntax directive-t0 .. enl .. funny-targets .. semi .. .. sysmk t0 2 1 .. .. mk .. .. t1 2 1 .. .. mk .. .. t2 2 1 .. .. mk .. .. .. variables modifier_M .. modifier_t .. opt_V .. t0 .. .. .. calendar .. comm .. file2c .. join .. jot .. lastcomm .. m4 .. ncal .. printf .. sed regress.multitest.out .. .. tr .. truncate .. uudecode .. uuencode .. xargs .. yacc .. .. usr.sbin etcupdate .. newsyslog .. sa .. .. .. .. diff --git a/usr.sbin/chown/Makefile b/usr.sbin/chown/Makefile index 97972e5684ed..7bcb67724832 100644 --- a/usr.sbin/chown/Makefile +++ b/usr.sbin/chown/Makefile @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= chown LINKS= ${BINDIR}/chown /usr/bin/chgrp MAN= chgrp.1 chown.8 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include diff --git a/usr.sbin/chown/tests/Makefile b/usr.sbin/chown/tests/Makefile new file mode 100644 index 000000000000..fb13f3fb0abe --- /dev/null +++ b/usr.sbin/chown/tests/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/chown + +TAP_TESTS_SH= chown-f_test + +.include diff --git a/usr.sbin/chown/tests/chown-f_test.sh b/usr.sbin/chown/tests/chown-f_test.sh new file mode 100755 index 000000000000..e9ef2bc5e282 --- /dev/null +++ b/usr.sbin/chown/tests/chown-f_test.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..1" + +name="chown -f root:wheel file" +if [ `id -u` -eq 0 ]; then + echo "ok 3 - $name # skip Test must not be uid 0." +else + touch file + output=$(chown -f root:wheel file 2>&1) + if [ $? -eq 0 -a -z "$output" ] + then + echo "ok 1 - $name" + else + echo "not ok 1 - $name" + fi + rm file +fi