Module Name: src
Committed By: jruoho
Date: Sat Jun 27 05:20:34 UTC 2020
Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/ztest: Makefile t_ztest.sh
Log Message:
Add a test case for PR kern/53767.
To generate a diff of this commit:
cvs rdiff -u -r1.855 -r1.856 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.168 -r1.169 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.31 -r1.32 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/ztest/Makefile \
src/tests/usr.bin/ztest/t_ztest.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.855 src/distrib/sets/lists/tests/mi:1.856
--- src/distrib/sets/lists/tests/mi:1.855 Sat Jun 27 05:07:07 2020
+++ src/distrib/sets/lists/tests/mi Sat Jun 27 05:20:34 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.855 2020/06/27 05:07:07 jruoho Exp $
+# $NetBSD: mi,v 1.856 2020/06/27 05:20:34 jruoho Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4767,6 +4767,10 @@
./usr/tests/usr.bin/xlint/lint1/d_typename_as_var.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/xlint/lint1/t_integration tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/ztest tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/ztest/Atffile tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/ztest/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua
+./usr/tests/usr.bin/ztest/t_ztest tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.sbin tests-usr.sbin-tests compattestfile,atf
./usr/tests/usr.sbin/Atffile tests-usr.sbin-tests compattestfile,atf
./usr/tests/usr.sbin/Kyuafile tests-usr.sbin-tests compattestfile,atf,kyua
Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.168 src/etc/mtree/NetBSD.dist.tests:1.169
--- src/etc/mtree/NetBSD.dist.tests:1.168 Thu Jun 25 17:08:33 2020
+++ src/etc/mtree/NetBSD.dist.tests Sat Jun 27 05:20:34 2020
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.dist.tests,v 1.168 2020/06/25 17:08:33 jruoho Exp $
+# $NetBSD: NetBSD.dist.tests,v 1.169 2020/06/27 05:20:34 jruoho Exp $
./usr/libdata/debug/usr/tests
./usr/libdata/debug/usr/tests/atf
@@ -443,6 +443,7 @@
./usr/tests/usr.bin/vmstat
./usr/tests/usr.bin/xlint
./usr/tests/usr.bin/xlint/lint1
+./usr/tests/usr.bin/ztest
./usr/tests/usr.sbin
./usr/tests/usr.sbin/cpuctl
./usr/tests/usr.sbin/mtree
Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.31 src/tests/usr.bin/Makefile:1.32
--- src/tests/usr.bin/Makefile:1.31 Wed Jun 24 12:31:26 2020
+++ src/tests/usr.bin/Makefile Sat Jun 27 05:20:34 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2020/06/24 12:31:26 jruoho Exp $
+# $NetBSD: Makefile,v 1.32 2020/06/27 05:20:34 jruoho Exp $
#
.include <bsd.own.mk>
@@ -9,7 +9,7 @@ TESTS_SUBDIRS= awk basename bzip2 cc cmp
diff dirname find fstat gdb grep gzip id indent \
infocmp jot ld m4 make mixerctl mkdep nbperf netpgpverify \
patch pkill pr printf pwhash rump_server shmif_dumpbus sdiff \
- sed sort tar tmux tr unifdef uniq vmstat xlint
+ sed sort tar tmux tr unifdef uniq vmstat xlint ztest
.if ${MKCXX} != "no"
TESTS_SUBDIRS+= c++
Added files:
Index: src/tests/usr.bin/ztest/Makefile
diff -u /dev/null src/tests/usr.bin/ztest/Makefile:1.1
--- /dev/null Sat Jun 27 05:20:34 2020
+++ src/tests/usr.bin/ztest/Makefile Sat Jun 27 05:20:34 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/06/27 05:20:34 jruoho Exp $
+
+.include <bsd.own.mk>
+
+TESTSDIR= ${TESTSBASE}/usr.bin/ztest
+TESTS_SH= t_ztest
+
+.include <bsd.test.mk>
Index: src/tests/usr.bin/ztest/t_ztest.sh
diff -u /dev/null src/tests/usr.bin/ztest/t_ztest.sh:1.1
--- /dev/null Sat Jun 27 05:20:34 2020
+++ src/tests/usr.bin/ztest/t_ztest.sh Sat Jun 27 05:20:34 2020
@@ -0,0 +1,55 @@
+# $NetBSD: t_ztest.sh,v 1.1 2020/06/27 05:20:34 jruoho Exp $
+#
+# Copyright (c) 2020 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.
+#
+tmp="/tmp/ztest"
+
+atf_test_case assert cleanup
+assert_head() {
+ atf_set "require.user" "root"
+ atf_set "require.progs" "ztest"
+ atf_set "descr" "Test that ztest(1) works (PR kern/53767)"
+}
+
+assert_body() {
+ atf_expect_fail "PR kern/53767"
+ atf_check -s exit:0 -x "mkdir $tmp"
+ atf_check -s exit:0 -o ignore -e empty \
+ -x "ztest -VVV -v10 -m2 -r12 -R3 -T 10 -f $tmp"
+}
+
+assert_cleanup() {
+
+ if [ -d $tmp ]; then
+ rm -rf $tmp
+ fi
+}
+
+atf_init_test_cases() {
+ atf_add_test_case assert
+}