Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/ztest Add a test case for PR kern/53767.



details:   https://anonhg.NetBSD.org/src/rev/e5e132b7610f
branches:  trunk
changeset: 973313:e5e132b7610f
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Jun 27 05:20:34 2020 +0000

description:
Add a test case for PR kern/53767.

diffstat:

 distrib/sets/lists/tests/mi    |   6 +++-
 etc/mtree/NetBSD.dist.tests    |   3 +-
 tests/usr.bin/Makefile         |   4 +-
 tests/usr.bin/ztest/Makefile   |   8 ++++++
 tests/usr.bin/ztest/t_ztest.sh |  55 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 72 insertions(+), 4 deletions(-)

diffs (126 lines):

diff -r ab58fd46346b -r e5e132b7610f distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sat Jun 27 05:07:07 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Jun 27 05:20:34 2020 +0000
@@ -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
diff -r ab58fd46346b -r e5e132b7610f etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Sat Jun 27 05:07:07 2020 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Sat Jun 27 05:20:34 2020 +0000
@@ -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
diff -r ab58fd46346b -r e5e132b7610f tests/usr.bin/Makefile
--- a/tests/usr.bin/Makefile    Sat Jun 27 05:07:07 2020 +0000
+++ b/tests/usr.bin/Makefile    Sat Jun 27 05:20:34 2020 +0000
@@ -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 @@
                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++
diff -r ab58fd46346b -r e5e132b7610f tests/usr.bin/ztest/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/ztest/Makefile      Sat Jun 27 05:20:34 2020 +0000
@@ -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>
diff -r ab58fd46346b -r e5e132b7610f tests/usr.bin/ztest/t_ztest.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/ztest/t_ztest.sh    Sat Jun 27 05:20:34 2020 +0000
@@ -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
+}



Home | Main Index | Thread Index | Old Index