From 1ff69b68e3f19c7bac7af4dfe412605936b8fd58 Mon Sep 17 00:00:00 2001 From: jruoho Date: Sun, 18 Mar 2012 12:40:42 +0000 Subject: [PATCH] Add a case for PR bin/44973. --- distrib/sets/lists/tests/mi | 5 +++- etc/mtree/NetBSD.dist.tests | 3 ++- tests/usr.bin/Makefile | 4 ++-- tests/usr.bin/find/Makefile | 8 +++++++ tests/usr.bin/find/t_find.sh | 46 ++++++++++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 tests/usr.bin/find/Makefile create mode 100644 tests/usr.bin/find/t_find.sh diff --git a/distrib/sets/lists/tests/mi b/distrib/sets/lists/tests/mi index 50b35d2454e4..4fb667f2066f 100644 --- a/distrib/sets/lists/tests/mi +++ b/distrib/sets/lists/tests/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.448 2012/03/18 10:12:30 jruoho Exp $ +# $NetBSD: mi,v 1.449 2012/03/18 12:40:42 jruoho Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -2845,6 +2845,9 @@ ./usr/tests/usr.bin/dirname tests-usr.bin-tests ./usr/tests/usr.bin/dirname/Atffile tests-usr.bin-tests atf ./usr/tests/usr.bin/dirname/t_dirname tests-usr.bin-tests atf +./usr/tests/usr.bin/find tests-usr.bin-tests +./usr/tests/usr.bin/find/Atffile tests-usr.bin-tests atf +./usr/tests/usr.bin/find/t_find tests-usr.bin-tests atf ./usr/tests/usr.bin/grep tests-usr.bin-tests ./usr/tests/usr.bin/grep/Atffile tests-usr.bin-tests atf ./usr/tests/usr.bin/grep/d_basic.out tests-usr.bin-tests atf diff --git a/etc/mtree/NetBSD.dist.tests b/etc/mtree/NetBSD.dist.tests index 7da4025f813e..a639c641a5a9 100644 --- a/etc/mtree/NetBSD.dist.tests +++ b/etc/mtree/NetBSD.dist.tests @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.tests,v 1.65 2012/03/18 10:12:31 jruoho Exp $ +# $NetBSD: NetBSD.dist.tests,v 1.66 2012/03/18 12:40:43 jruoho Exp $ ./usr/libdata/debug/usr/tests ./usr/libdata/debug/usr/tests/atf @@ -273,6 +273,7 @@ ./usr/tests/usr.bin/cut ./usr/tests/usr.bin/diff ./usr/tests/usr.bin/dirname +./usr/tests/usr.bin/find ./usr/tests/usr.bin/grep ./usr/tests/usr.bin/gzip ./usr/tests/usr.bin/id diff --git a/tests/usr.bin/Makefile b/tests/usr.bin/Makefile index 78af96d76dce..b9ec3a260479 100644 --- a/tests/usr.bin/Makefile +++ b/tests/usr.bin/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2012/03/18 10:12:30 jruoho Exp $ +# $NetBSD: Makefile,v 1.11 2012/03/18 12:40:42 jruoho Exp $ # .include @@ -6,7 +6,7 @@ TESTSDIR= ${TESTSBASE}/usr.bin TESTS_SUBDIRS= awk basename bzip2 cc config cut \ - diff dirname grep gzip id m4 make mkdep \ + diff dirname find grep gzip id m4 make mkdep \ pr rump_server shmif_dumpbus sdiff sed sort unifdef xlint .include diff --git a/tests/usr.bin/find/Makefile b/tests/usr.bin/find/Makefile new file mode 100644 index 000000000000..e9a4c7bd1ce0 --- /dev/null +++ b/tests/usr.bin/find/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.1 2012/03/18 12:40:42 jruoho Exp $ + +.include + +TESTSDIR= ${TESTSBASE}/usr.bin/find +TESTS_SH= t_find + +.include diff --git a/tests/usr.bin/find/t_find.sh b/tests/usr.bin/find/t_find.sh new file mode 100644 index 000000000000..b777a4a5e23e --- /dev/null +++ b/tests/usr.bin/find/t_find.sh @@ -0,0 +1,46 @@ +# $NetBSD: t_find.sh,v 1.1 2012/03/18 12:40:42 jruoho Exp $ +# +# Copyright (c) 2012 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Jukka Ruohonen. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +atf_test_case exit +exit_head() { + atf_set "descr" "Test that find(1) with -exit works (PR bin/44973)" +} + +exit_body() { + + atf_expect_fail "PR bin/44973" + + atf_check -o ignore \ + -s exit:0 -x "find /etc -type f -exit" +} + +atf_init_test_cases() { + atf_add_test_case exit +}