From owner-svn-src-head@FreeBSD.ORG Mon Jun 30 05:33:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61C61606; Mon, 30 Jun 2014 05:33:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 342A42DFA; Mon, 30 Jun 2014 05:33:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5U5XrhL071294; Mon, 30 Jun 2014 05:33:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5U5XqZj071286; Mon, 30 Jun 2014 05:33:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201406300533.s5U5XqZj071286@svn.freebsd.org> From: Eitan Adler Date: Mon, 30 Jun 2014 05:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268030 - in head: etc/mtree usr.sbin/chown usr.sbin/chown/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jun 2014 05:33:53 -0000 Author: eadler Date: Mon Jun 30 05:33:52 2014 New Revision: 268030 URL: http://svnweb.freebsd.org/changeset/base/268030 Log: chown: add a test Add a test for the chown utility. This sets up chown(8) to be capable of being tested. As such, only add one test for now as an example. Added: head/usr.sbin/chown/tests/ head/usr.sbin/chown/tests/Makefile (contents, props changed) head/usr.sbin/chown/tests/chown-f_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/chown/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Jun 30 04:38:29 2014 (r268029) +++ head/etc/mtree/BSD.tests.dist Mon Jun 30 05:33:52 2014 (r268030) @@ -21,6 +21,8 @@ .. tests bin + chown + .. date .. mv Modified: head/usr.sbin/chown/Makefile ============================================================================== --- head/usr.sbin/chown/Makefile Mon Jun 30 04:38:29 2014 (r268029) +++ head/usr.sbin/chown/Makefile Mon Jun 30 05:33:52 2014 (r268030) @@ -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 Added: head/usr.sbin/chown/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/chown/tests/Makefile Mon Jun 30 05:33:52 2014 (r268030) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/chown + +TAP_TESTS_SH= chown-f_test + +.include Added: head/usr.sbin/chown/tests/chown-f_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/chown/tests/chown-f_test.sh Mon Jun 30 05:33:52 2014 (r268030) @@ -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