summaryrefslogtreecommitdiffstats
path: root/usr.sbin/chown
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
committersjg <sjg@FreeBSD.org>2014-08-19 06:50:54 +0000
commitd7cd1d425cc1ea9451fa235e3af9b6625c3e0de2 (patch)
treeb04f4bd7cd887f50e7d98af35f46b9834ff86c80 /usr.sbin/chown
parent3c8e37b1d04827f33c0c9a7594bd1b1ef7cdb3d3 (diff)
parent4fbde208c6460d576f64d6dc3cdc6cab085a4283 (diff)
downloadFreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.zip
FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.tar.gz
Merge head from 7/28
Diffstat (limited to 'usr.sbin/chown')
-rw-r--r--usr.sbin/chown/Makefile6
-rw-r--r--usr.sbin/chown/tests/Makefile9
-rwxr-xr-xusr.sbin/chown/tests/chown-f_test.sh21
3 files changed, 36 insertions, 0 deletions
diff --git a/usr.sbin/chown/Makefile b/usr.sbin/chown/Makefile
index 97972e5..7bcb677 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 0000000..fb13f3f
--- /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 0000000..c66b008
--- /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 1 - $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
OpenPOWER on IntegriCloud