diff options
| author | Eitan Adler <eadler@FreeBSD.org> | 2014-06-30 05:33:52 +0000 |
|---|---|---|
| committer | Eitan Adler <eadler@FreeBSD.org> | 2014-06-30 05:33:52 +0000 |
| commit | 4bfdbb0b562f44a634356cdd8aeb372a80cc398f (patch) | |
| tree | 1f574d1c5c4c4f53f9d67b787f900ffc22d0546c /usr.sbin/chown | |
| parent | 7063e348ab1442728925ec5acf764e2595a7bec3 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/chown')
| -rw-r--r-- | usr.sbin/chown/Makefile | 6 | ||||
| -rw-r--r-- | usr.sbin/chown/tests/Makefile | 9 | ||||
| -rwxr-xr-x | usr.sbin/chown/tests/chown-f_test.sh | 21 |
3 files changed, 36 insertions, 0 deletions
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 <src.opts.mk> + PROG= chown LINKS= ${BINDIR}/chown /usr/bin/chgrp MAN= chgrp.1 chown.8 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include <bsd.prog.mk> 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 <bsd.own.mk> + +TESTSDIR= ${TESTSBASE}/bin/chown + +TAP_TESTS_SH= chown-f_test + +.include <bsd.test.mk> 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 |
