CVS commit: src/tests/sbin

2020-07-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 27 07:36:19 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_random_garbage.sh
src/tests/sbin/sysctl: t_random_garbage.sh

Log Message:
Use the new "run_unsafe" atf_config_get() option also with a couple of other
tests that are known to be unsafe.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/ifconfig/t_random_garbage.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/sysctl/t_random_garbage.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_random_garbage.sh
diff -u src/tests/sbin/ifconfig/t_random_garbage.sh:1.3 src/tests/sbin/ifconfig/t_random_garbage.sh:1.4
--- src/tests/sbin/ifconfig/t_random_garbage.sh:1.3	Fri Jul  3 07:03:14 2020
+++ src/tests/sbin/ifconfig/t_random_garbage.sh	Mon Jul 27 07:36:19 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.3 2020/07/03 07:03:14 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.4 2020/07/27 07:36:19 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -63,7 +63,9 @@ random_garbage_body() {
 	#
 	# Take care.
 	#
-	atf_skip "The test is not safe (PR kern/55451)"
+	if ! [ $(atf_config_get "run_unsafe" "no") = "yes" ]; then
+		atf_skip "The test is not safe (PR kern/55451)"
+	fi
 
 	opts="advbase advskew broadcast carpdev description \
 	  media mediaopt -mediaopt mode instance metric mtu \

Index: src/tests/sbin/sysctl/t_random_garbage.sh
diff -u src/tests/sbin/sysctl/t_random_garbage.sh:1.3 src/tests/sbin/sysctl/t_random_garbage.sh:1.4
--- src/tests/sbin/sysctl/t_random_garbage.sh:1.3	Fri Jul  3 07:03:14 2020
+++ src/tests/sbin/sysctl/t_random_garbage.sh	Mon Jul 27 07:36:19 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.3 2020/07/03 07:03:14 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.4 2020/07/27 07:36:19 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,7 +47,9 @@ random_garbage_head() {
 
 random_garbage_body() {
 
-	atf_skip "The test is not safe (PR kern/55451)"
+	if ! [ $(atf_config_get "run_unsafe" "no") = "yes" ]; then
+		atf_skip "The test is not safe (PR kern/55451)"
+	fi
 
 	while read line; do
 
@@ -87,7 +89,9 @@ random_garbage_body() {
 
 random_garbage_cleanup() {
 
-	atf_skip "The test is not safe (PR kern/55451)"
+	if ! [ $(atf_config_get "run_unsafe" "no") = "yes" ]; then
+		atf_skip "The test is not safe (PR kern/55451)"
+	fi
 
 	while read line; do
 		var=$(echo $line | awk '{print $1}')



CVS commit: src/share/man/man5

2020-07-15 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 15 16:52:49 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
's/blacklistd/blocklistd/'. Note also blocklistd_flags.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/share/man/man5/rc.conf.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.183 src/share/man/man5/rc.conf.5:1.184
--- src/share/man/man5/rc.conf.5:1.183	Wed Jul 15 16:46:11 2020
+++ src/share/man/man5/rc.conf.5	Wed Jul 15 16:52:48 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.183 2020/07/15 16:46:11 jruoho Exp $
+.\"	$NetBSD: rc.conf.5,v 1.184 2020/07/15 16:52:48 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -698,12 +698,14 @@ with the
 .Fl l
 flag and suppresses warnings about interfaces in this list that
 do not have an ifconfig file or variable.
-.It Sy blacklistd
+.It Sy blocklistd
 Boolean value.
 Runs
-.Xr blacklistd 8
+.Xr blocklistd 8
 to dynamically block hosts on a DoS according to configuration set in
-.Xr blacklistd.conf 5
+.Xr blocklistd.conf 5
+Passes
+.Sy blocklistd_flags .
 .It Sy dhcpcd
 Boolean value.
 Set true to configure some or all network interfaces using dhcpcd.



CVS commit: src/share/man/man5

2020-07-15 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 15 16:46:11 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
Note modules.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/share/man/man5/rc.conf.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.182 src/share/man/man5/rc.conf.5:1.183
--- src/share/man/man5/rc.conf.5:1.182	Wed Jun 24 10:30:43 2020
+++ src/share/man/man5/rc.conf.5	Wed Jul 15 16:46:11 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.182 2020/06/24 10:30:43 jruoho Exp $
+.\"	$NetBSD: rc.conf.5,v 1.183 2020/07/15 16:46:11 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -55,7 +55,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 24, 2020
+.Dd July 15, 2020
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -338,6 +338,10 @@ assumes yes as the answer to all operato
 This might be important with hosts where the administrator does not have
 access to the console and an unsuccessful shutdown must not make the host
 unbootable even if the file system checks would fail in preen mode.
+.It Sy modules
+Boolean value.
+If true, loads the modules specified in
+.Xr modules.conf 5 .
 .It Sy no_swap
 Boolean value.
 Should be true if you have deliberately configured your system with no swap.



CVS commit: src/share/man/man7

2020-07-13 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 13 15:05:05 UTC 2020

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Xref rfc6056(7).


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/share/man/man7/sysctl.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.147 src/share/man/man7/sysctl.7:1.148
--- src/share/man/man7/sysctl.7:1.147	Sat Jun 13 20:18:00 2020
+++ src/share/man/man7/sysctl.7	Mon Jul 13 15:05:05 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.147 2020/06/13 20:18:00 ad Exp $
+.\"	$NetBSD: sysctl.7,v 1.148 2020/07/13 15:05:05 jruoho Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\"
-.Dd November 14, 2019
+.Dd July 13, 2020
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -1542,7 +1542,9 @@ The available RFC 6056 port randomizatio
 A bitmask of ports that will not be used during anonymous or privileged
 port selection.
 .It Li ip.anonportalgo.selected
-The currently selected RFC 6056 port randomization algorithm.
+The currently selected RFC 6056 port randomization algorithm; see
+.Xr rfc6056 7
+for details.
 .It Li ip.anonportmax
 The highest port number to use for TCP and UDP ephemeral port allocation.
 This cannot be set to less than 1024 or greater than 65535, and must
@@ -1859,7 +1861,9 @@ The available RFC 6056 port randomizatio
 A bitmask of ports that will not be used during anonymous or privileged
 port selection.
 .It Li ip6.anonportalgo.selected
-The currently selected RFC 6056 port randomization algorithm.
+The currently selected RFC 6056 port randomization algorithm; see
+.Xr rfc6056 7
+for details.
 .It Li ip6.anonportmax
 The highest port number to use for TCP and UDP ephemeral port allocation.
 This cannot be set to less than 1024 or greater than 65535, and must



CVS commit: src

2020-07-13 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 13 13:16:08 UTC 2020

Modified Files:
src/sys/kern: kern_cpu.c
src/tests/usr.sbin/cpuctl: t_cpuctl.sh

Log Message:
Do not allow disabling interrupts on the primary CPU. Fixes PR kern/45117.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/kern/kern_cpu.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.sbin/cpuctl/t_cpuctl.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.91 src/sys/kern/kern_cpu.c:1.92
--- src/sys/kern/kern_cpu.c:1.91	Thu May 28 20:29:18 2020
+++ src/sys/kern/kern_cpu.c	Mon Jul 13 13:16:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.91 2020/05/28 20:29:18 ad Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.92 2020/07/13 13:16:07 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.91 2020/05/28 20:29:18 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.92 2020/07/13 13:16:07 jruoho Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_cpu_ucode.h"
@@ -212,7 +212,9 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void
 			error = ESRCH;
 			break;
 		}
-		cpu_setintr(ci, cs->cs_intr);
+		error = cpu_setintr(ci, cs->cs_intr);
+		if (error)
+			break;
 		error = cpu_setstate(ci, cs->cs_online);
 		break;
 
@@ -490,6 +492,8 @@ cpu_setintr(struct cpu_info *ci, bool in
 			return 0;
 		func = (xcfunc_t)cpu_xc_intr;
 	} else {
+		if (CPU_IS_PRIMARY(ci))
+			return EINVAL;
 		if ((spc->spc_flags & SPCF_NOINTR) != 0)
 			return 0;
 		/*

Index: src/tests/usr.sbin/cpuctl/t_cpuctl.sh
diff -u src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.3 src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.4
--- src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.3	Thu Jun 25 15:43:26 2020
+++ src/tests/usr.sbin/cpuctl/t_cpuctl.sh	Mon Jul 13 13:16:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_cpuctl.sh,v 1.3 2020/06/25 15:43:26 jruoho Exp $
+# $NetBSD: t_cpuctl.sh,v 1.4 2020/07/13 13:16:07 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,9 +37,6 @@ setcpu() {
 		atf_pass
 	fi
 
-	# Skip the boot processor. Disabling interrupts
-	# on it will hang the system (PR kern/45117).
-	#
 	while [ $ncpu -gt 1 ]; do
 
 		cpuid=$(expr $ncpu - 1)
@@ -51,6 +48,15 @@ setcpu() {
 
 		ncpu=$(expr $ncpu - 1)
 	done
+
+	# Additional check that interrupts cannot be
+	# disabled for the primary CPU (PR kern/45117).
+	#
+	cpuctl nointr 0 >/dev/null 2>&1
+
+	if [ $? -eq 0 ]; then
+		$2 $3
+	fi
 }
 
 clean() {



CVS commit: src/share/man/man7

2020-07-13 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 13 12:44:04 UTC 2020

Modified Files:
src/share/man/man7: module.7

Log Message:
Complete the example.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man7/module.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/module.7
diff -u src/share/man/man7/module.7:1.7 src/share/man/man7/module.7:1.8
--- src/share/man/man7/module.7:1.7	Thu Aug 31 08:36:32 2017
+++ src/share/man/man7/module.7	Mon Jul 13 12:44:04 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: module.7,v 1.7 2017/08/31 08:36:32 wiz Exp $
+.\" $NetBSD: module.7,v 1.8 2020/07/13 12:44:04 jruoho Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 31, 2017
+.Dd July 13, 2020
 .Dt MODULE 7
 .Os
 .Sh NAME
@@ -131,10 +131,11 @@ make install
 .Pp
 Alternatively, the
 .Dq build.sh
-tool can be used to build only the modules.
+tool can be used to build only the modules:
 .Bd -literal -offset indent
 cd /usr/src
 \&./build.sh -O /usr/obj -T /usr/tools modules
+\&./build.sh -O /usr/obj -T /usr/tools installmodules=/
 .Ed
 .Sh SEE ALSO
 .Xr modctl 2 ,



CVS commit: src/libexec/httpd/small

2020-07-13 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 13 10:35:17 UTC 2020

Modified Files:
src/libexec/httpd/small: Makefile

Log Message:
Add -DNO_BLOCKLIST_SUPPORT also to small/Makefile.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/libexec/httpd/small/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/small/Makefile
diff -u src/libexec/httpd/small/Makefile:1.3 src/libexec/httpd/small/Makefile:1.4
--- src/libexec/httpd/small/Makefile:1.3	Thu Jul 17 06:24:57 2014
+++ src/libexec/httpd/small/Makefile	Mon Jul 13 10:35:17 2020
@@ -9,7 +9,7 @@ LEAN_IFDEF_FLAGS=	-UDEBUG -DNO_USER_SUPP
 			-DNO_CGIBIN_SUPPORT -DNO_DIRINDEX_SUPPORT \
 			-DNO_DAEMON_MODE -DNO_DYNAMIC_CONTENT \
 			-DNO_SSL_SUPPORT -UDO_HTPASSWD \
-			-DNO_LUA_SUPPORT
+			-DNO_LUA_SUPPORT -DNO_BLOCKLIST_SUPPORT
 
 CFLAGS=	-I$(.CURDIR)/.. ${LEAN_IFDEF_FLAGS}
 



CVS commit: src/libexec/httpd

2020-07-13 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 13 09:38:57 UTC 2020

Modified Files:
src/libexec/httpd: Makefile.boot bozohttpd.8 bozohttpd.c

Log Message:
Do not report status code 500 to blocklistd(8)  Add -DNO_BLOCKLIST_SUPPORT
to Makefile.boot.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/libexec/httpd/Makefile.boot
cvs rdiff -u -r1.81 -r1.82 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.116 -r1.117 src/libexec/httpd/bozohttpd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/Makefile.boot
diff -u src/libexec/httpd/Makefile.boot:1.7 src/libexec/httpd/Makefile.boot:1.8
--- src/libexec/httpd/Makefile.boot:1.7	Wed Oct 30 07:28:13 2019
+++ src/libexec/httpd/Makefile.boot	Mon Jul 13 09:38:57 2020
@@ -6,7 +6,7 @@
 CC=	cc
 OPT=	-O
 LARGE_CFLAGS=	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-LOCAL_CFLAGS=	-DNO_LUA_SUPPORT -D_GNU_SOURCE
+LOCAL_CFLAGS=	-DNO_LUA_SUPPORT -DNO_BLOCKLIST_SUPPORT -D_GNU_SOURCE
 CFLAGS=	$(OPT) $(LARGE_CFLAGS) $(LOCAL_CFLAGS)
 
 GROFF=	groff -Tascii

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.81 src/libexec/httpd/bozohttpd.8:1.82
--- src/libexec/httpd/bozohttpd.8:1.81	Sat Jul 11 08:10:52 2020
+++ src/libexec/httpd/bozohttpd.8	Mon Jul 13 09:38:57 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bozohttpd.8,v 1.81 2020/07/11 08:10:52 jruoho Exp $
+.\"	$NetBSD: bozohttpd.8,v 1.82 2020/07/13 09:38:57 jruoho Exp $
 .\"
 .\"	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
@@ -466,16 +466,14 @@ compilation option.
 .Pp
 Upon occurrence,
 .Nm
-reports three HTTP status codes to
+reports two HTTP status codes to
 .Xr blocklistd 8
 as failures:
 .Em 401
-(``Unauthorized'') ,
-.Em 403
-(``Forbidden'') ,
+(``Unauthorized'')
 and
-.Em 500
-(``Internal Server Error'') .
+.Em 403
+(``Forbidden'') .
 Of these,
 .Em 401
 is the one received upon authorization failure with the

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.116 src/libexec/httpd/bozohttpd.c:1.117
--- src/libexec/httpd/bozohttpd.c:1.116	Sat Jul 11 08:10:52 2020
+++ src/libexec/httpd/bozohttpd.c	Mon Jul 13 09:38:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.116 2020/07/11 08:10:52 jruoho Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.117 2020/07/13 09:38:57 jruoho Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -2297,8 +2297,7 @@ bozo_http_error(bozohttpd_t *httpd, int 
 		pfilter_notify(BLOCKLIST_AUTH_FAIL, code);
 		break;
 
-	case 403: /* FALLTHROUGH */
-	case 500:
+	case 403:
 		pfilter_notify(BLOCKLIST_ABUSIVE_BEHAVIOR, code);
 		break;
 	}



CVS commit: src

2020-07-13 Thread Jukka Ruohonen
ute.conf.5 rpc.5 \
 	security.conf.5 services.5 shells.5 \
 	stab.5 statvfs.5 sysctl.conf.5 ttyaction.5 \
 	utmp.5 utmpx.5 veriexec.5 weekly.5 wscons.conf.5
 
-MLINKS+=capfile.5 termcap.5	
+MLINKS+=capfile.5 termcap.5
 MLINKS+=daily.5 daily.conf.5
 MLINKS+=fs.5 inode.5
 MLINKS+=hosts.equiv.5 rhosts.5

Added files:

Index: src/share/man/man5/changelist.5
diff -u /dev/null src/share/man/man5/changelist.5:1.1
--- /dev/null	Mon Jul 13 09:10:35 2020
+++ src/share/man/man5/changelist.5	Mon Jul 13 09:10:35 2020
@@ -0,0 +1,52 @@
+.\" $NetBSD: changelist.5,v 1.1 2020/07/13 09:10:35 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.
+.\"
+.Dd July 13, 2020
+.Dt CHANGELIST 5
+.Os
+.Sh NAME
+.Nm changelist
+.Nd local files processed by maintenance scripts
+.Sh DESCRIPTION
+The
+.Pa /etc/changelist
+file contains locally added files that are processed by the
+.Pa /etc/security
+script as a part of the
+.Xr daily 5
+routines.
+.Sh FILES
+.Bl -tag -width /etc/pkgpath.conf -compact
+.It Pa /etc/changelist
+local files processed by maintenance scripts
+.El
+.Sh SEE ALSO
+.Xr daily 5 ,
+.Xr security.conf 5 ,
+.Xr cron 8
Index: src/share/man/man5/pkgpath.conf.5
diff -u /dev/null src/share/man/man5/pkgpath.conf.5:1.1
--- /dev/null	Mon Jul 13 09:10:35 2020
+++ src/share/man/man5/pkgpath.conf.5	Mon Jul 13 09:10:35 2020
@@ -0,0 +1,66 @@
+.\" $NetBSD: pkgpath.conf.5,v 1.1 2020/07/13 09:10:35 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.
+.\"
+.Dd July 13, 2020
+.Dt PKGPATH.CONF 5
+.Os
+.Sh NAME
+.Nm pkgpath.conf
+.Nd paths for package utilities
+.Sh DESCRIPTION
+The
+.Pa /etc/pkgpath.conf
+file provides definitions of the paths to different
+package utilities, including
+.Xr pkg_admin 1
+and
+.Xr p

CVS commit: src/share/man/man7

2020-07-13 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 13 07:26:27 UTC 2020

Modified Files:
src/share/man/man7: release.7

Log Message:
Add the missing rescue(8) and tests(7) sets.  XXX: this manual is somewhat
broken due to the differences in the archival formats used.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/share/man/man7/release.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/release.7
diff -u src/share/man/man7/release.7:1.38 src/share/man/man7/release.7:1.39
--- src/share/man/man7/release.7:1.38	Wed Jul 26 15:32:09 2017
+++ src/share/man/man7/release.7	Mon Jul 13 07:26:27 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: release.7,v 1.38 2017/07/26 15:32:09 leot Exp $
+.\"	$NetBSD: release.7,v 1.39 2020/07/13 07:26:27 jruoho Exp $
 .\"
 .\" Copyright (c) 1997, 2000, 2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 26, 2017
+.Dd July 13, 2020
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -305,6 +305,16 @@ the typesettable document set, and vario
 configuration files.
 .It Sy modules.tgz
 This set includes all the kernel modules.
+.It Sy rescue.tgz
+This set contains the
+.Xr rescue 8
+utilities.
+.It Sy tests.tgz
+This set includes the
+.Xr tests 7
+for
+.Xr atf 7 ,
+the automated test framework used by NetBSD.
 .It Sy text.tgz
 This set includes the
 .Nx



CVS commit: src/sbin/wdogctl

2020-07-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jul 11 12:51:21 UTC 2020

Modified Files:
src/sbin/wdogctl: wdogctl.8

Log Message:
Xref x86/tco(4) instead of the parent x86/ichlpcib(4) bridge.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/wdogctl/wdogctl.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/wdogctl/wdogctl.8
diff -u src/sbin/wdogctl/wdogctl.8:1.24 src/sbin/wdogctl/wdogctl.8:1.25
--- src/sbin/wdogctl/wdogctl.8:1.24	Thu Aug 11 08:00:05 2011
+++ src/sbin/wdogctl/wdogctl.8	Sat Jul 11 12:51:21 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wdogctl.8,v 1.24 2011/08/11 08:00:05 mbalmer Exp $
+.\"	$NetBSD: wdogctl.8,v 1.25 2020/07/11 12:51:21 jruoho Exp $
 .\"
 .\" Copyright (c) 2000 Zembu Labs, Inc.
 .\" All rights reserved.
@@ -31,7 +31,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 11, 2011
+.Dd July 11, 2020
 .Dt WDOGCTL 8
 .Os
 .Sh NAME
@@ -172,7 +172,7 @@ the timer.
 .Xr pcweasel 4 ,
 .Xr pwdog 4 ,
 .Xr swwdog 4 ,
-.Xr x86/ichlpcib 4
+.Xr x86/tco 4
 .Sh HISTORY
 The
 .Nm



CVS commit: src/tests/usr.sbin

2020-07-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jul 11 09:55:26 UTC 2020

Modified Files:
src/tests/usr.sbin/execsnoop: t_execsnoop.sh
src/tests/usr.sbin/opensnoop: t_opensnoop.sh

Log Message:
Sleep even more.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.sbin/execsnoop/t_execsnoop.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.sbin/opensnoop/t_opensnoop.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.sbin/execsnoop/t_execsnoop.sh
diff -u src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.2 src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.3
--- src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.2	Mon Jul  6 10:32:18 2020
+++ src/tests/usr.sbin/execsnoop/t_execsnoop.sh	Sat Jul 11 09:55:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_execsnoop.sh,v 1.2 2020/07/06 10:32:18 jruoho Exp $
+# $NetBSD: t_execsnoop.sh,v 1.3 2020/07/11 09:55:26 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,8 +47,9 @@ basic_body() {
 		n=$(expr $n - 1)
 	done
 
-	sleep 3
+	sleep 5
 	pkill -9 execsnoop
+	sleep 1
 
 	if [ ! $(cat $tmp | grep "whoami" | wc -l) -eq 10 ]; then
 		atf_fail "execsnoop does not work"

Index: src/tests/usr.sbin/opensnoop/t_opensnoop.sh
diff -u src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.3 src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.4
--- src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.3	Sat Jul 11 09:35:22 2020
+++ src/tests/usr.sbin/opensnoop/t_opensnoop.sh	Sat Jul 11 09:55:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_opensnoop.sh,v 1.3 2020/07/11 09:35:22 jruoho Exp $
+# $NetBSD: t_opensnoop.sh,v 1.4 2020/07/11 09:55:26 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -50,8 +50,9 @@ basic_body() {
 		n=$(expr $n - 1)
 	done
 
-	sleep 3
+	sleep 5
 	pkill -9 opensnoop
+	sleep 1
 
 	if [ ! $(cat $tmp | grep "/etc/spwd.db" | wc -l) -eq 10 ]; then
 		atf_fail "opensnoop does not work"



CVS commit: src/tests/usr.sbin/opensnoop

2020-07-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jul 11 09:35:22 UTC 2020

Modified Files:
src/tests/usr.sbin/opensnoop: t_opensnoop.sh

Log Message:
Skip this test as it may cause a panic. Point to PR kern/55481.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.sbin/opensnoop/t_opensnoop.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.sbin/opensnoop/t_opensnoop.sh
diff -u src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.2 src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.3
--- src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.2	Mon Jul  6 10:32:18 2020
+++ src/tests/usr.sbin/opensnoop/t_opensnoop.sh	Sat Jul 11 09:35:22 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_opensnoop.sh,v 1.2 2020/07/06 10:32:18 jruoho Exp $
+# $NetBSD: t_opensnoop.sh,v 1.3 2020/07/11 09:35:22 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,11 +33,14 @@ atf_test_case basic cleanup
 basic_head() {
 	atf_set "require.user" "root"
 	atf_set "require.progs" "opensnoop"
-	atf_set "descr" "Test that DTrace's opensnoop works (cf. kern/53417)"
+	atf_set "descr" "Test that DTrace's opensnoop works " \
+		"(cf. PR kern/53417 and PR kern/55481)"
 }
 
 basic_body() {
 
+	atf_skip "The test may cause a panic (PR kern/55481)"
+
 	n=10
 	atf_check -s exit:0 -o ignore -e empty -x "opensnoop > $tmp &"
 	sleep 1



CVS commit: src/libexec/httpd

2020-07-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jul 11 08:10:52 UTC 2020

Modified Files:
src/libexec/httpd: Makefile auth-bozo.c bozohttpd.8 bozohttpd.c
bozohttpd.h

Log Message:
Add blocklistd(8) support.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/libexec/httpd/Makefile
cvs rdiff -u -r1.24 -r1.25 src/libexec/httpd/auth-bozo.c
cvs rdiff -u -r1.80 -r1.81 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.115 -r1.116 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.61 -r1.62 src/libexec/httpd/bozohttpd.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/httpd/Makefile
diff -u src/libexec/httpd/Makefile:1.28 src/libexec/httpd/Makefile:1.29
--- src/libexec/httpd/Makefile:1.28	Thu Jan 17 07:39:00 2019
+++ src/libexec/httpd/Makefile	Sat Jul 11 08:10:52 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.28 2019/01/17 07:39:00 mrg Exp $
+#	$NetBSD: Makefile,v 1.29 2020/07/11 08:10:52 jruoho Exp $
 #
 #	$eterna: Makefile,v 1.30 2010/07/11 00:34:27 mrg Exp $
 #
@@ -14,6 +14,7 @@
 #	NO_SSL_SUPPORT		/* don't support ssl (https) */
 #	DO_HTPASSWD		/* support .htpasswd files */
 #	NO_LUA_SUPPORT		/* don't support Lua for dynamic content */
+#	NO_BLOCKLIST_SUPPORT	/* don't support blocklist */
 #
 # other system specific defines:
 #	HAVE_NBUTIL_H		/* netbsd compat is in 
@@ -32,8 +33,8 @@ SRCS=	bozohttpd.c ssl-bozo.c auth-bozo.c
 	tilde-luzah-bozo.c dir-index-bozo.c content-bozo.c lua-bozo.c
 SRCS+=	main.c
 
-LDADD=	-lcrypt -llua -lm
-DPADD=	${LIBCRYPT} ${LIBLUA} ${LIBM}
+LDADD=	-lblocklist -lcrypt -llua -lm
+DPADD=	${LIBBLOCKLIST} ${LIBCRYPT} ${LIBLUA} ${LIBM}
 
 WARNS?=	4
 

Index: src/libexec/httpd/auth-bozo.c
diff -u src/libexec/httpd/auth-bozo.c:1.24 src/libexec/httpd/auth-bozo.c:1.25
--- src/libexec/httpd/auth-bozo.c:1.24	Thu Feb 28 08:28:21 2019
+++ src/libexec/httpd/auth-bozo.c	Sat Jul 11 08:10:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth-bozo.c,v 1.24 2019/02/28 08:28:21 mrg Exp $	*/
+/*	$NetBSD: auth-bozo.c,v 1.25 2020/07/11 08:10:52 jruoho Exp $	*/
 
 /*	$eterna: auth-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -105,6 +105,11 @@ bozo_auth_check(bozo_httpreq_t *request,
 	pass) != 0)
 break;
 			fclose(fp);
+
+#ifndef NO_BLOCKLIST_SUPPORT
+			pfilter_notify(BLOCKLIST_AUTH_OK, 200);
+#endif /* !NO_BLOCKLIST_SUPPORT */
+
 			return 0;
 		}
 	}

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.80 src/libexec/httpd/bozohttpd.8:1.81
--- src/libexec/httpd/bozohttpd.8:1.80	Mon Jul  6 23:31:36 2020
+++ src/libexec/httpd/bozohttpd.8	Sat Jul 11 08:10:52 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bozohttpd.8,v 1.80 2020/07/06 23:31:36 jmcneill Exp $
+.\"	$NetBSD: bozohttpd.8,v 1.81 2020/07/11 08:10:52 jruoho Exp $
 .\"
 .\"	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\"
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd July 6, 2020
+.Dd July 11, 2020
 .Dt BOZOHTTPD 8
 .Os
 .Sh NAME
@@ -454,6 +454,45 @@ with
 on the compiler command line to enable this support.
 It may require linking with the crypt library, using
 .Dq -lcrypt .
+.Ss BLOCKLIST SUPPORT
+On NetBSD,
+.Nm
+supports
+.Xr blocklistd 8
+by default.
+The support can be disabled with the
+.Dq -DNO_BLOCKLIST_SUPPORT
+compilation option.
+.Pp
+Upon occurrence,
+.Nm
+reports three HTTP status codes to
+.Xr blocklistd 8
+as failures:
+.Em 401
+(``Unauthorized'') ,
+.Em 403
+(``Forbidden'') ,
+and
+.Em 500
+(``Internal Server Error'') .
+Of these,
+.Em 401
+is the one received upon authorization failure with the
+HTTP Basic Authorization mechanism.
+A successful authorization decreases the counter kept by
+.Xr blocklistd 8 .
+.Pp
+Note that the implementation of the HTTP Basic Authorization mechanism
+uses a redirection; a status code
+.Em 401
+is always initially received.
+Therefore, a single authorization failure of
+.Pa .htpasswd
+is reported as two failures to
+.Xr blocklistd 8 ,
+but no failures are recorded upon successful authorization
+due to the decrease of the failure counter.
 .Ss SSL SUPPORT
 .Nm
 has support for TLSv1.1 and TLSv1.2 protocols that are included by

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.115 src/libexec/httpd/bozohttpd.c:1.116
--- src/libexec/httpd/bozohttpd.c:1.115	Mon Jul  6 23:31:36 2020
+++ src/libexec/httpd/bozohttpd.c	Sat Jul 11 08:10:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.115 2020/07/06 23:31:36 jmcneill Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.116 2020/07/11 08:10:52 jruoho Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -2133,6 +2133,7 @@ static struct errors_map {
 	const char *shortmsg;		/* short version of message */
 	const char *longmsg;		/* long version of message */
 } errors_map[] = {
+	{ 200,	"200 OK",		"The request was valid", },
 	{ 400,	"400 Bad Request",	"The request was 

CVS commit: src/tests/sbin/ifconfig

2020-07-06 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul  6 10:35:01 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_repeated_link_addr.sh

Log Message:
Remove the expected timeout; there is something more sinister behind the
timeouts seen on the Qemu/evbarm-aarch64 runs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/ifconfig/t_repeated_link_addr.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_repeated_link_addr.sh
diff -u src/tests/sbin/ifconfig/t_repeated_link_addr.sh:1.2 src/tests/sbin/ifconfig/t_repeated_link_addr.sh:1.3
--- src/tests/sbin/ifconfig/t_repeated_link_addr.sh:1.2	Fri Jul  3 02:51:13 2020
+++ src/tests/sbin/ifconfig/t_repeated_link_addr.sh	Mon Jul  6 10:35:00 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_link_addr.sh,v 1.2 2020/07/03 02:51:13 jruoho Exp $
+# $NetBSD: t_repeated_link_addr.sh,v 1.3 2020/07/06 10:35:00 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,12 +37,6 @@ repeated_link_addr_head() {
 
 repeated_link_addr_body() {
 
-	case $(uname -m) in
-		evbarm)
-			atf_expect_timeout "reason for timeout unknown"
-			;;
-	esac
-
 	fail=0
 	addrs="00:11:00:00:00:00 \
 	   00:11:11:00:00:00 \



CVS commit: src/tests/usr.sbin

2020-07-06 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul  6 10:32:18 UTC 2020

Modified Files:
src/tests/usr.sbin/execsnoop: t_execsnoop.sh
src/tests/usr.sbin/opensnoop: t_opensnoop.sh

Log Message:
Sleep more.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/execsnoop/t_execsnoop.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/opensnoop/t_opensnoop.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.sbin/execsnoop/t_execsnoop.sh
diff -u src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.1 src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.2
--- src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.1	Tue Jun 30 14:30:49 2020
+++ src/tests/usr.sbin/execsnoop/t_execsnoop.sh	Mon Jul  6 10:32:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_execsnoop.sh,v 1.1 2020/06/30 14:30:49 jruoho Exp $
+# $NetBSD: t_execsnoop.sh,v 1.2 2020/07/06 10:32:18 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,7 +47,7 @@ basic_body() {
 		n=$(expr $n - 1)
 	done
 
-	sleep 1
+	sleep 3
 	pkill -9 execsnoop
 
 	if [ ! $(cat $tmp | grep "whoami" | wc -l) -eq 10 ]; then

Index: src/tests/usr.sbin/opensnoop/t_opensnoop.sh
diff -u src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.1 src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.2
--- src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.1	Tue Jun 30 14:30:50 2020
+++ src/tests/usr.sbin/opensnoop/t_opensnoop.sh	Mon Jul  6 10:32:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_opensnoop.sh,v 1.1 2020/06/30 14:30:50 jruoho Exp $
+# $NetBSD: t_opensnoop.sh,v 1.2 2020/07/06 10:32:18 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,7 +47,7 @@ basic_body() {
 		n=$(expr $n - 1)
 	done
 
-	sleep 1
+	sleep 3
 	pkill -9 opensnoop
 
 	if [ ! $(cat $tmp | grep "/etc/spwd.db" | wc -l) -eq 10 ]; then



CVS commit: src/tests/sbin

2020-07-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Jul  3 07:03:14 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_random_garbage.sh
src/tests/sbin/sysctl: t_random_garbage.sh

Log Message:
Skip these also for Qemu runs as they cause panics. Point to PR kern/55451.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/ifconfig/t_random_garbage.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/sysctl/t_random_garbage.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_random_garbage.sh
diff -u src/tests/sbin/ifconfig/t_random_garbage.sh:1.2 src/tests/sbin/ifconfig/t_random_garbage.sh:1.3
--- src/tests/sbin/ifconfig/t_random_garbage.sh:1.2	Sat Jun 27 14:04:17 2020
+++ src/tests/sbin/ifconfig/t_random_garbage.sh	Fri Jul  3 07:03:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.2 2020/06/27 14:04:17 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.3 2020/07/03 07:03:14 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,7 +47,8 @@ write_garbage() {
 atf_test_case random_garbage
 random_garbage_head() {
 	atf_set "require.user" "root"
-	atf_set "descr" "Test writing random garbage to ifconfig(8) options"
+	atf_set "descr" "Test writing random garbage to " \
+		"ifconfig(8) options (PR kern/55451)"
 }
 
 random_garbage_body() {
@@ -62,7 +63,7 @@ random_garbage_body() {
 	#
 	# Take care.
 	#
-	atf_skip "The test is not safe"
+	atf_skip "The test is not safe (PR kern/55451)"
 
 	opts="advbase advskew broadcast carpdev description \
 	  media mediaopt -mediaopt mode instance metric mtu \

Index: src/tests/sbin/sysctl/t_random_garbage.sh
diff -u src/tests/sbin/sysctl/t_random_garbage.sh:1.2 src/tests/sbin/sysctl/t_random_garbage.sh:1.3
--- src/tests/sbin/sysctl/t_random_garbage.sh:1.2	Tue Jun 30 11:49:26 2020
+++ src/tests/sbin/sysctl/t_random_garbage.sh	Fri Jul  3 07:03:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.2 2020/06/30 11:49:26 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.3 2020/07/03 07:03:14 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,16 +41,13 @@ atf_test_case random_garbage cleanup
 random_garbage_head() {
 	sysctl -a > $tmp
 	atf_set "require.user" "root"
-	atf_set "descr" "Test writing random garbage to sysctl nodes"
+	atf_set "descr" "Test writing random garbage " \
+		"to sysctl nodes (PR kern/55451)"
 }
 
 random_garbage_body() {
 
-	sysctl machdep.cpu_brand 2>/dev/null | grep "QEMU"
-
-	if [ $? -eq 1 ]; then
-		atf_skip "The test is not safe"
-	fi
+	atf_skip "The test is not safe (PR kern/55451)"
 
 	while read line; do
 
@@ -90,11 +87,7 @@ random_garbage_body() {
 
 random_garbage_cleanup() {
 
-	sysctl machdep.cpu_brand 2>/dev/null | grep "QEMU"
-
-	if [ $? -eq 1 ]; then
-		atf_skip "The test is not safe"
-	fi
+	atf_skip "The test is not safe (PR kern/55451)"
 
 	while read line; do
 		var=$(echo $line | awk '{print $1}')



CVS commit: src

2020-07-02 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Jul  3 04:25:28 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/locale: Makefile t_locale.sh

Log Message:
Add a check for PR bin/54692.


To generate a diff of this commit:
cvs rdiff -u -r1.871 -r1.872 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.172 -r1.173 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.32 -r1.33 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/locale/Makefile \
src/tests/usr.bin/locale/t_locale.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.871 src/distrib/sets/lists/tests/mi:1.872
--- src/distrib/sets/lists/tests/mi:1.871	Fri Jul  3 03:59:18 2020
+++ src/distrib/sets/lists/tests/mi	Fri Jul  3 04:25:28 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.871 2020/07/03 03:59:18 jruoho Exp $
+# $NetBSD: mi,v 1.872 2020/07/03 04:25:28 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4462,6 +4462,10 @@
 ./usr/tests/usr.bin/ld/t_orphan			tests-obsolete	obsolete,atf
 ./usr/tests/usr.bin/ld/t_script			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/ld/t_section		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/locale			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/locale/Atffile		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/locale/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua
+./usr/tests/usr.bin/locale/t_locale		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/m4tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/m4/Atffile			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/m4/Kyuafile			tests-usr.bin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.172 src/etc/mtree/NetBSD.dist.tests:1.173
--- src/etc/mtree/NetBSD.dist.tests:1.172	Fri Jul  3 03:59:18 2020
+++ src/etc/mtree/NetBSD.dist.tests	Fri Jul  3 04:25:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.172 2020/07/03 03:59:18 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.173 2020/07/03 04:25:28 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -423,6 +423,7 @@
 ./usr/tests/usr.bin/infocmp
 ./usr/tests/usr.bin/jot
 ./usr/tests/usr.bin/ld
+./usr/tests/usr.bin/locale
 ./usr/tests/usr.bin/m4
 ./usr/tests/usr.bin/make
 ./usr/tests/usr.bin/make/unit-tests

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.32 src/tests/usr.bin/Makefile:1.33
--- src/tests/usr.bin/Makefile:1.32	Sat Jun 27 05:20:34 2020
+++ src/tests/usr.bin/Makefile	Fri Jul  3 04:25:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2020/06/27 05:20:34 jruoho Exp $
+#	$NetBSD: Makefile,v 1.33 2020/07/03 04:25:28 jruoho Exp $
 #
 
 .include 
@@ -7,9 +7,10 @@ TESTSDIR=   ${TESTSBASE}/usr.bin
 
 TESTS_SUBDIRS=	awk basename bzip2 cc cmp config cpio cut \
 		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 ztest
+		infocmp jot ld locale 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 ztest
 
 .if ${MKCXX} != "no"
 TESTS_SUBDIRS+=	c++
@@ -19,5 +20,4 @@ TESTS_SUBDIRS+=	c++
 TESTS_SUBDIRS+=	argon2
 .endif
 
-
 .include 

Added files:

Index: src/tests/usr.bin/locale/Makefile
diff -u /dev/null src/tests/usr.bin/locale/Makefile:1.1
--- /dev/null	Fri Jul  3 04:25:29 2020
+++ src/tests/usr.bin/locale/Makefile	Fri Jul  3 04:25:28 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/07/03 04:25:28 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.bin/locale
+TESTS_SH=	t_locale
+
+.include 
Index: src/tests/usr.bin/locale/t_locale.sh
diff -u /dev/null src/tests/usr.bin/locale/t_locale.sh:1.1
--- /dev/null	Fri Jul  3 04:25:29 2020
+++ src/tests/usr.bin/locale/t_locale.sh	Fri Jul  3 04:25:28 2020
@@ -0,0 +1,43 @@
+# $NetBSD: t_locale.sh,v 1.1 2020/07/03 04:25:28 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, thi

CVS commit: src

2020-07-02 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Jul  3 03:59:18 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/bin: Makefile
Added Files:
src/tests/bin/date: Makefile t_date.sh

Log Message:
Add a check for the overflow noted in PR lib/46542.


To generate a diff of this commit:
cvs rdiff -u -r1.870 -r1.871 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.171 -r1.172 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.3 -r1.4 src/tests/bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/bin/date/Makefile \
src/tests/bin/date/t_date.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.870 src/distrib/sets/lists/tests/mi:1.871
--- src/distrib/sets/lists/tests/mi:1.870	Wed Jul  1 13:49:26 2020
+++ src/distrib/sets/lists/tests/mi	Fri Jul  3 03:59:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.870 2020/07/01 13:49:26 jruoho Exp $
+# $NetBSD: mi,v 1.871 2020/07/03 03:59:18 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -840,6 +840,10 @@
 ./usr/tests/bin/cp/Atffile		tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/cp/Kyuafile		tests-bin-tests		compattestfile,atf,kyua
 ./usr/tests/bin/cp/t_cp			tests-bin-tests		compattestfile,atf
+./usr/tests/bin/date			tests-bin-tests		compattestfile,atf
+./usr/tests/bin/date/Atffile		tests-bin-tests		compattestfile,atf
+./usr/tests/bin/date/Kyuafile		tests-bin-tests		compattestfile,atf,kyua
+./usr/tests/bin/date/t_date		tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/dd			tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/dd/Atffile		tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/dd/Kyuafile		tests-bin-tests		compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.171 src/etc/mtree/NetBSD.dist.tests:1.172
--- src/etc/mtree/NetBSD.dist.tests:1.171	Tue Jun 30 20:32:11 2020
+++ src/etc/mtree/NetBSD.dist.tests	Fri Jul  3 03:59:18 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.171 2020/06/30 20:32:11 riastradh Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.172 2020/07/03 03:59:18 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -186,6 +186,7 @@
 ./usr/tests/bin
 ./usr/tests/bin/cat
 ./usr/tests/bin/cp
+./usr/tests/bin/date
 ./usr/tests/bin/dd
 ./usr/tests/bin/df
 ./usr/tests/bin/expr

Index: src/tests/bin/Makefile
diff -u src/tests/bin/Makefile:1.3 src/tests/bin/Makefile:1.4
--- src/tests/bin/Makefile:1.3	Fri Mar 30 15:49:24 2012
+++ src/tests/bin/Makefile	Fri Jul  3 03:59:18 2020
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2012/03/30 15:49:24 njoly Exp $
+# $NetBSD: Makefile,v 1.4 2020/07/03 03:59:18 jruoho Exp $
 
 .include 
 
 TESTSDIR=   ${TESTSBASE}/bin
 
-TESTS_SUBDIRS=	cat cp dd df expr pax ps sh sleep tar
+TESTS_SUBDIRS=	cat cp date dd df expr pax ps sh sleep tar
 
 .include 

Added files:

Index: src/tests/bin/date/Makefile
diff -u /dev/null src/tests/bin/date/Makefile:1.1
--- /dev/null	Fri Jul  3 03:59:18 2020
+++ src/tests/bin/date/Makefile	Fri Jul  3 03:59:18 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/07/03 03:59:18 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/bin/date
+TESTS_SH=	t_date
+
+.include 
Index: src/tests/bin/date/t_date.sh
diff -u /dev/null src/tests/bin/date/t_date.sh:1.1
--- /dev/null	Fri Jul  3 03:59:18 2020
+++ src/tests/bin/date/t_date.sh	Fri Jul  3 03:59:18 2020
@@ -0,0 +1,56 @@
+# $NetBSD: t_date.sh,v 1.1 2020/07/03 03:59:18 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 

CVS commit: src/tests/lib/libc/gen

2020-07-02 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Jul  3 03:13:10 UTC 2020

Modified Files:
src/tests/lib/libc/gen: t_syslog.c

Log Message:
Verify that PR lib/55041 is no longer an issue.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/gen/t_syslog.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/t_syslog.c
diff -u src/tests/lib/libc/gen/t_syslog.c:1.2 src/tests/lib/libc/gen/t_syslog.c:1.3
--- src/tests/lib/libc/gen/t_syslog.c:1.2	Sun Mar 18 07:00:51 2012
+++ src/tests/lib/libc/gen/t_syslog.c	Fri Jul  3 03:13:10 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: t_syslog.c,v 1.2 2012/03/18 07:00:51 jruoho Exp $ */
+/*	$NetBSD: t_syslog.c,v 1.3 2020/07/03 03:13:10 jruoho Exp $ */
 
 /*-
- * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * Copyright (c) 2010, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,6 @@
 ATF_TC(syslog_pthread);
 ATF_TC_HEAD(syslog_pthread, tc)
 {
-
 	atf_tc_set_md_var(tc, "descr", "Test that syslog(3) "
 	"works when linked to pthread(3) (PR lib/44248)");
 	atf_tc_set_md_var(tc, "timeout", "2");
@@ -47,10 +46,23 @@ ATF_TC_BODY(syslog_pthread, tc)
 	syslog(LOG_DEBUG, "from tests/lib/libc/gen/t_syslog");
 }
 
+ATF_TC(syslog_invalid_priority);
+ATF_TC_HEAD(syslog_invalid_priority, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test that syslog(3) does "
+	"not segfault from an invalid priority (PR lib/55041)");
+}
+
+ATF_TC_BODY(syslog_invalid_priority, tc)
+{
+	syslog(-1, "from tests/lib/libc/gen/t_syslog");
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, syslog_pthread);
+	ATF_TP_ADD_TC(tp, syslog_invalid_priority);
 
 	return atf_no_error();
 }



CVS commit: src/tests/sbin/ifconfig

2020-07-02 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Jul  3 02:51:13 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_repeated_link_addr.sh

Log Message:
Expect a timeout for evbarm-aarch64, as seen in the recent Qemu runs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/ifconfig/t_repeated_link_addr.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_repeated_link_addr.sh
diff -u src/tests/sbin/ifconfig/t_repeated_link_addr.sh:1.1 src/tests/sbin/ifconfig/t_repeated_link_addr.sh:1.2
--- src/tests/sbin/ifconfig/t_repeated_link_addr.sh:1.1	Tue Jun 30 11:48:20 2020
+++ src/tests/sbin/ifconfig/t_repeated_link_addr.sh	Fri Jul  3 02:51:13 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_link_addr.sh,v 1.1 2020/06/30 11:48:20 jruoho Exp $
+# $NetBSD: t_repeated_link_addr.sh,v 1.2 2020/07/03 02:51:13 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,6 +37,12 @@ repeated_link_addr_head() {
 
 repeated_link_addr_body() {
 
+	case $(uname -m) in
+		evbarm)
+			atf_expect_timeout "reason for timeout unknown"
+			;;
+	esac
+
 	fail=0
 	addrs="00:11:00:00:00:00 \
 	   00:11:11:00:00:00 \



CVS commit: src

2020-07-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul  1 13:49:26 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: t_magic_symlinks.sh

Log Message:
Add basic checks for magic symlink(7)'s. These include a case for PR lib/55361,
although it seems that realpath(3) has bigger problems with these symlinks.


To generate a diff of this commit:
cvs rdiff -u -r1.869 -r1.870 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.67 -r1.68 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_magic_symlinks.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.869 src/distrib/sets/lists/tests/mi:1.870
--- src/distrib/sets/lists/tests/mi:1.869	Wed Jul  1 07:16:38 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jul  1 13:49:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.869 2020/07/01 07:16:38 jruoho Exp $
+# $NetBSD: mi,v 1.870 2020/07/01 13:49:26 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2202,6 +2202,7 @@
 ./usr/tests/kernel/t_lockf			tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_lwpctl			tests-obsolete		obsolete
 ./usr/tests/kernel/t_mkdir			tests-obsolete		obsolete
+./usr/tests/kernel/t_magic_symlinks		tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_mqueue			tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_nointerpreter		tests-kernel-tests	atf
 ./usr/tests/kernel/t_origin			tests-kernel-tests	compattestfile,atf

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.67 src/tests/kernel/Makefile:1.68
--- src/tests/kernel/Makefile:1.67	Thu Jun 25 16:16:48 2020
+++ src/tests/kernel/Makefile	Wed Jul  1 13:49:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.67 2020/06/25 16:16:48 jruoho Exp $
+# $NetBSD: Makefile,v 1.68 2020/07/01 13:49:26 jruoho Exp $
 
 NOMAN=		# defined
 
@@ -26,6 +26,7 @@ TESTS_SH+=	t_umountstress
 TESTS_SH+=	t_ps_strings
 TESTS_SH+=	t_trapsignal
 TESTS_SH+=	t_interp
+TESTS_SH+=	t_magic_symlinks
 TESTS_SH+=	t_nointerpreter
 TESTS_SH+=	t_origin
 TESTS_SH+=	t_procpath

Added files:

Index: src/tests/kernel/t_magic_symlinks.sh
diff -u /dev/null src/tests/kernel/t_magic_symlinks.sh:1.1
--- /dev/null	Wed Jul  1 13:49:27 2020
+++ src/tests/kernel/t_magic_symlinks.sh	Wed Jul  1 13:49:26 2020
@@ -0,0 +1,254 @@
+# $NetBSD: t_magic_symlinks.sh,v 1.1 2020/07/01 13:49:26 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.
+#
+tmpdir="/tmp/test-magic-symlink"
+
+init() {
+
+	enabled=$(sysctl vfs.generic.magiclinks | awk '{print $3}')
+
+	if [ $enabled -eq 0 ]; then
+		sysctl -w vfs.generic.magiclinks=1 >/dev/null 2>&1
+		echo "Initialized vfs.generic.magiclinks=1"
+	fi
+
+	mkdir "$tmpdir"
+	echo "$enabled" > "$tmpdir/enabled"
+}
+
+clean() {
+
+	enabled=$(cat "$tmpdir/enabled")
+
+	if [ $enabled -eq 0 ]; then
+		sysctl -w vfs.generic.magiclinks=$enabled >/dev/null 2>&1
+		echo "Restored vfs.generic.magiclinks=$enabled"
+	fi
+
+	rm -rf $tmpdir
+}
+
+check() {
+
+	init
+	cd "$tmpdir"
+	mkdir "$1"
+	echo 1 > "$1/magic"
+	ln -s "$2" "link"
+	cd "link"
+
+	if [ -z $(pwd | grep "$1") ]; then
+		atf_fail "kernel does not handle magic symli

CVS commit: src

2020-07-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul  1 07:16:38 UTC 2020

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/stdlib: Makefile
Added Files:
src/tests/lib/libc/stdlib: t_a64l.c

Log Message:
Add basic checks for a64l(3), l64a(3), and l64a_r(3).


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.868 -r1.869 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.32 -r1.33 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdlib/t_a64l.c

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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.322 src/distrib/sets/lists/debug/mi:1.323
--- src/distrib/sets/lists/debug/mi:1.322	Tue Jun 30 20:32:10 2020
+++ src/distrib/sets/lists/debug/mi	Wed Jul  1 07:16:38 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.322 2020/06/30 20:32:10 riastradh Exp $
+# $NetBSD: mi,v 1.323 2020/07/01 07:16:38 jruoho Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2081,6 +2081,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/h_atexit.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/h_getopt.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/h_getopt_long.debug	tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_a64l.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_abs.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_atoi.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_div.debug		tests-lib-debug		debug,atf,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.868 src/distrib/sets/lists/tests/mi:1.869
--- src/distrib/sets/lists/tests/mi:1.868	Tue Jun 30 23:51:47 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jul  1 07:16:38 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.868 2020/06/30 23:51:47 lukem Exp $
+# $NetBSD: mi,v 1.869 2020/07/01 07:16:38 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3068,6 +3068,7 @@
 ./usr/tests/lib/libc/stdlib/h_atexit		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/h_getopt		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/h_getopt_long	tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdlib/t_a64l		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_abs		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_atexit		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_atoi		tests-lib-tests		compattestfile,atf

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.32 src/tests/lib/libc/stdlib/Makefile:1.33
--- src/tests/lib/libc/stdlib/Makefile:1.32	Tue Jun 30 16:09:40 2020
+++ src/tests/lib/libc/stdlib/Makefile	Wed Jul  1 07:16:37 2020
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.32 2020/06/30 16:09:40 jruoho Exp $
+# $NetBSD: Makefile,v 1.33 2020/07/01 07:16:37 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libc/stdlib
 
+TESTS_C+=	t_a64l
 TESTS_C+=	t_abs
 TESTS_C+=	t_atoi
 TESTS_C+=	t_div

Added files:

Index: src/tests/lib/libc/stdlib/t_a64l.c
diff -u /dev/null src/tests/lib/libc/stdlib/t_a64l.c:1.1
--- /dev/null	Wed Jul  1 07:16:38 2020
+++ src/tests/lib/libc/stdlib/t_a64l.c	Wed Jul  1 07:16:37 2020
@@ -0,0 +1,111 @@
+/* $NetBSD: t_a64l.c,v 1.1 2020/07/01 07:16:37 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,

CVS commit: src/tests/lib/libc/stdlib

2020-06-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul  1 05:37:25 UTC 2020

Modified Files:
src/tests/lib/libc/stdlib: t_mktemp.c

Log Message:
Add basic tests for the rest of the mktemp(3) family of functions, including
a case for PR lib/55441.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdlib/t_mktemp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/t_mktemp.c
diff -u src/tests/lib/libc/stdlib/t_mktemp.c:1.1 src/tests/lib/libc/stdlib/t_mktemp.c:1.2
--- src/tests/lib/libc/stdlib/t_mktemp.c:1.1	Sat Jun 27 09:45:57 2020
+++ src/tests/lib/libc/stdlib/t_mktemp.c	Wed Jul  1 05:37:25 2020
@@ -1,11 +1,11 @@
-/* $NetBSD: t_mktemp.c,v 1.1 2020/06/27 09:45:57 jruoho Exp $ */
+/* $NetBSD: t_mktemp.c,v 1.2 2020/07/01 05:37:25 jruoho Exp $ */
 
 /*-
- * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * Copyright (c) 2013, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Christos Zoulas.
+ * by Christos Zoulas and Jukka Ruohonen.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,16 +29,38 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mktemp.c,v 1.1 2020/06/27 09:45:57 jruoho Exp $");
+__RCSID("$NetBSD: t_mktemp.c,v 1.2 2020/07/01 05:37:25 jruoho Exp $");
+
+#include 
 
 #include 
+#include 
+#include 
+#include 
 #include 
+#include 
+
+static int
+check_mode(struct stat sa, const int mode, const int dir)
+{
+
+	if (dir == 0 && S_ISREG(sa.st_mode) == 0)
+		return -1;
+
+	if (dir != 0 && S_ISDIR(sa.st_mode) == 0)
+		return -1;
+
+	if ((sa.st_mode & mode) == 0)
+		return -1;
+
+	return 0;
+}
 
 ATF_TC(mktemp_not_exist);
 ATF_TC_HEAD(mktemp_not_exist, tc)
 {
-	atf_tc_set_md_var(tc, "descr", "Test that mktemp does not fail on"
-	" a path that does not exist");
+	atf_tc_set_md_var(tc, "descr", "Test that mktemp(3)"
+	" does not fail on a path that does not exist");
 }
 
 ATF_TC_BODY(mktemp_not_exist, tc)
@@ -47,8 +69,198 @@ ATF_TC_BODY(mktemp_not_exist, tc)
 	ATF_REQUIRE(mktemp(template) != NULL);
 }
 
+ATF_TC(mktemp_large_template);
+ATF_TC_HEAD(mktemp_large_template, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test that mktemp "
+	"accepts arbitrarily large templates (PR lib/55441)");
+}
+
+ATF_TC_BODY(mktemp_large_template, tc)
+{
+	const char *path = "/tmp/mktemp.XX";
+	char template[PATH_MAX] = { 0 };
+	size_t i;
+
+	atf_tc_expect_fail("PR lib/55441");
+
+	ATF_REQUIRE(strcpy(template, path) != NULL);
+	ATF_REQUIRE(mktemp(template) != NULL);
+	ATF_REQUIRE(strlen(template) == strlen(path));
+	ATF_REQUIRE(strcmp(template, path) != 0);
+	ATF_REQUIRE(strncmp(template, "/tmp/mktemp.", 12) == 0);
+
+	(void)memset(template, '\0', sizeof(template));
+	(void)strcpy(template, "/tmp/mktemp.");
+
+	for (i = 12; i < sizeof(template) - 1; i++)
+		template[i] = 'X';
+
+	ATF_REQUIRE(mktemp(template) != NULL);
+	ATF_REQUIRE(strlen(template) == sizeof(template) - 1);
+	ATF_REQUIRE(strcmp(template, path) != 0);
+	ATF_REQUIRE(strncmp(template, "/tmp/mktemp.", 12) == 0);
+}
+
+ATF_TC(mkstemp_basic);
+ATF_TC_HEAD(mkstemp_basic, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "A basic test of mkstemp(3)");
+}
+
+ATF_TC_BODY(mkstemp_basic, tc)
+{
+	char template[] = "/tmp/mktemp.XX";
+	struct stat sa;
+	int fd;
+
+	(void)memset(, 0, sizeof(struct stat));
+
+	fd = mkstemp(template);
+
+	ATF_REQUIRE(fd != -1);
+	ATF_REQUIRE(strncmp(template, "/tmp/mktemp.", 12) == 0);
+	ATF_REQUIRE(write(fd, "X", 1) == 1);
+	ATF_REQUIRE(fstat(fd, ) == 0);
+	ATF_REQUIRE(check_mode(sa, 0600, 0) == 0);
+	ATF_REQUIRE(close(fd) == 0);
+	ATF_REQUIRE(unlink(template) == 0);
+}
+
+ATF_TC(mkstemps_basic);
+ATF_TC_HEAD(mkstemps_basic, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "A basic test of mkstemps(3)");
+}
+
+ATF_TC_BODY(mkstemps_basic, tc)
+{
+	char template[] = "/tmp/mktemp.XXXyyy";
+	struct stat sa;
+	int fd;
+
+	(void)memset(, 0, sizeof(struct stat));
+
+	fd = mkstemps(template, 3);
+
+	ATF_REQUIRE(fd != -1);
+	ATF_REQUIRE(strncmp(template, "/tmp/mktemp.", 12) == 0);
+
+	char *str = strchr(template, 'y');
+
+	ATF_REQUIRE(strcmp(str, "yyy") == 0);
+	ATF_REQUIRE(write(fd, "X", 1) == 1);
+	ATF_REQUIRE(fstat(fd, ) == 0);
+	ATF_REQUIRE(check_mode(sa, 0600, 0) == 0);
+	ATF_REQUIRE(close(fd) == 0);
+	ATF_REQUIRE(unlink(template) == 0);
+}
+
+ATF_TC(mkdtemp_basic);
+ATF_TC_HEAD(mkdtemp_basic, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "A basic test of mkdte

CVS commit: src

2020-06-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jun 30 16:09:40 UTC 2020

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/locale: t_mbtowc.c
src/tests/lib/libc/stdlib: Makefile
Removed Files:
src/tests/lib/libc/stdlib: t_mbtowc.c

Log Message:
After a comedy of errors, move t_mbtowc to its final resting place.


To generate a diff of this commit:
cvs rdiff -u -r1.320 -r1.321 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.865 -r1.866 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/locale/t_mbtowc.c
cvs rdiff -u -r1.31 -r1.32 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r1.3 -r0 src/tests/lib/libc/stdlib/t_mbtowc.c

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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.320 src/distrib/sets/lists/debug/mi:1.321
--- src/distrib/sets/lists/debug/mi:1.320	Mon Jun 29 23:44:01 2020
+++ src/distrib/sets/lists/debug/mi	Tue Jun 30 16:09:40 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.320 2020/06/29 23:44:01 riastradh Exp $
+# $NetBSD: mi,v 1.321 2020/06/30 16:09:40 jruoho Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2090,7 +2090,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_getenv.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_getenv_thread.debug	tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_hsearch.debug		tests-lib-debug		debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mbtowc.debug		tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mbtowc.debug		tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mi_vector_hash.debug	tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mktemp.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_posix_memalign.debug	tests-lib-debug		debug,atf,compattestfile

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.865 src/distrib/sets/lists/tests/mi:1.866
--- src/distrib/sets/lists/tests/mi:1.865	Tue Jun 30 14:30:49 2020
+++ src/distrib/sets/lists/tests/mi	Tue Jun 30 16:09:40 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.865 2020/06/30 14:30:49 jruoho Exp $
+# $NetBSD: mi,v 1.866 2020/06/30 16:09:40 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3075,7 +3075,7 @@
 ./usr/tests/lib/libc/stdlib/t_getenv_thread	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_getopt		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_hsearch		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libc/stdlib/t_mbtowc		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdlib/t_mbtowc		tests-obsolete		obsolete
 ./usr/tests/lib/libc/stdlib/t_mi_vector_hash	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_mktemp		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_posix_memalign	tests-lib-tests		compattestfile,atf

Index: src/tests/lib/libc/locale/t_mbtowc.c
diff -u src/tests/lib/libc/locale/t_mbtowc.c:1.2 src/tests/lib/libc/locale/t_mbtowc.c:1.3
--- src/tests/lib/libc/locale/t_mbtowc.c:1.2	Thu May 25 18:28:54 2017
+++ src/tests/lib/libc/locale/t_mbtowc.c	Tue Jun 30 16:09:40 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mbtowc.c,v 1.2 2017/05/25 18:28:54 perseant Exp $ */
+/* $NetBSD: t_mbtowc.c,v 1.3 2020/06/30 16:09:40 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -53,13 +53,42 @@
  *
  */
 
+/*-
+ * Copyright (c) 2005 Miloslav Trmac
+ * All rights reserved.
+ *
+ * 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR 

CVS commit: src

2020-06-30 Thread Jukka Ruohonen
/execsnoop
+TESTS_SH=	t_execsnoop
+
+.include 
Index: src/tests/usr.sbin/execsnoop/t_execsnoop.sh
diff -u /dev/null src/tests/usr.sbin/execsnoop/t_execsnoop.sh:1.1
--- /dev/null	Tue Jun 30 14:30:50 2020
+++ src/tests/usr.sbin/execsnoop/t_execsnoop.sh	Tue Jun 30 14:30:49 2020
@@ -0,0 +1,69 @@
+# $NetBSD: t_execsnoop.sh,v 1.1 2020/06/30 14:30:49 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/execsnoop"
+
+atf_test_case basic cleanup
+basic_head() {
+	atf_set "require.user" "root"
+	atf_set "require.progs" "execsnoop"
+	atf_set "descr" "Test that DTrace's execsnoop works (cf. kern/53417)"
+}
+
+basic_body() {
+
+	n=10
+	atf_check -s exit:0 -o ignore -e empty -x "execsnoop > $tmp &"
+	sleep 1
+
+	while [ $n -gt 0 ]; do
+		whoami
+		n=$(expr $n - 1)
+	done
+
+	sleep 1
+	pkill -9 execsnoop
+
+	if [ ! $(cat $tmp | grep "whoami" | wc -l) -eq 10 ]; then
+		atf_fail "execsnoop does not work"
+	fi
+
+	atf_pass
+}
+
+basic_cleanup() {
+
+	if [ -f $tmp ]; then
+		rm $tmp
+	fi
+}
+
+atf_init_test_cases() {
+	atf_add_test_case basic
+}

Index: src/tests/usr.sbin/opensnoop/Makefile
diff -u /dev/null src/tests/usr.sbin/opensnoop/Makefile:1.1
--- /dev/null	Tue Jun 30 14:30:50 2020
+++ src/tests/usr.sbin/opensnoop/Makefile	Tue Jun 30 14:30:50 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/06/30 14:30:50 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.sbin/opensnoop
+TESTS_SH=	t_opensnoop
+
+.include 
Index: src/tests/usr.sbin/opensnoop/t_opensnoop.sh
diff -u /dev/null src/tests/usr.sbin/opensnoop/t_opensnoop.sh:1.1
--- /dev/null	Tue Jun 30 14:30:50 2020
+++ src/tests/usr.sbin/opensnoop/t_opensnoop.sh	Tue Jun 30 14:30:50 2020
@@ -0,0 +1,69 @@
+# $NetBSD: t_opensnoop.sh,v 1.1 2020/06/30 14:30:50 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/opensnoop"
+
+atf_test_case basic cleanup
+basic_head() {
+	atf_set "require.user" "root"
+	atf_set "require.progs" "opensnoop"
+	atf_set "descr&qu

CVS commit: src/tests/sbin/sysctl

2020-06-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jun 30 11:49:26 UTC 2020

Modified Files:
src/tests/sbin/sysctl: t_random_garbage.sh

Log Message:
Skip a few more nodes, and enable this test for Qemu runs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/sysctl/t_random_garbage.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/sysctl/t_random_garbage.sh
diff -u src/tests/sbin/sysctl/t_random_garbage.sh:1.1 src/tests/sbin/sysctl/t_random_garbage.sh:1.2
--- src/tests/sbin/sysctl/t_random_garbage.sh:1.1	Sat Jun 27 08:50:46 2020
+++ src/tests/sbin/sysctl/t_random_garbage.sh	Tue Jun 30 11:49:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.1 2020/06/27 08:50:46 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.2 2020/06/30 11:49:26 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -46,18 +46,32 @@ random_garbage_head() {
 
 random_garbage_body() {
 
-	atf_skip "The test is not safe"
+	sysctl machdep.cpu_brand 2>/dev/null | grep "QEMU"
+
+	if [ $? -eq 1 ]; then
+		atf_skip "The test is not safe"
+	fi
 
 	while read line; do
 
 		var=$(echo $line | awk '{print $1}')
 
 		case $var in
+			hw.acpi.sleep.state)
+			echo "Skipping $var"
+			continue
+			;;
+
 			kern.securelevel*)
 			echo "Skipping $var"
 			continue
 			;;
 
+			kern.veriexec.strict)
+			echo "Skipping $var"
+			continue
+			;;
+
 			security*)
 			echo "Skipping $var"
 			continue
@@ -76,7 +90,11 @@ random_garbage_body() {
 
 random_garbage_cleanup() {
 
-	atf_skip "The test is not safe"
+	sysctl machdep.cpu_brand 2>/dev/null | grep "QEMU"
+
+	if [ $? -eq 1 ]; then
+		atf_skip "The test is not safe"
+	fi
 
 	while read line; do
 		var=$(echo $line | awk '{print $1}')



CVS commit: src

2020-06-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jun 30 11:48:20 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile
Added Files:
src/tests/sbin/ifconfig: t_repeated_link_addr.sh t_repeated_mtu.sh

Log Message:
Add a couple of tests for sequential ifconfig(8) options, incl. PR kern/41912.


To generate a diff of this commit:
cvs rdiff -u -r1.863 -r1.864 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.8 -r1.9 src/tests/sbin/ifconfig/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_repeated_link_addr.sh \
src/tests/sbin/ifconfig/t_repeated_mtu.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.863 src/distrib/sets/lists/tests/mi:1.864
--- src/distrib/sets/lists/tests/mi:1.863	Mon Jun 29 23:44:01 2020
+++ src/distrib/sets/lists/tests/mi	Tue Jun 30 11:48:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.863 2020/06/29 23:44:01 riastradh Exp $
+# $NetBSD: mi,v 1.864 2020/06/30 11:48:20 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4001,6 +4001,8 @@
 ./usr/tests/sbin/ifconfig/t_capabilities	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_nonexistent		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_random_garbage	tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_repeated_link_addr	tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_repeated_mtu	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_updown	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_tap			tests-sbin-tests	compattestfile,atf

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.8 src/tests/sbin/ifconfig/Makefile:1.9
--- src/tests/sbin/ifconfig/Makefile:1.8	Sat Jun 27 13:53:43 2020
+++ src/tests/sbin/ifconfig/Makefile	Tue Jun 30 11:48:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2020/06/27 13:53:43 jruoho Exp $
+# $NetBSD: Makefile,v 1.9 2020/06/30 11:48:20 jruoho Exp $
 
 .include 
 
@@ -8,6 +8,8 @@ TESTS_SH=	t_bridge \
 		t_capabilities \
 		t_nonexistent \
 		t_random_garbage \
+		t_repeated_link_addr \
+		t_repeated_mtu \
 		t_repeated_scan \
 		t_repeated_updown \
 		t_tap \

Added files:

Index: src/tests/sbin/ifconfig/t_repeated_link_addr.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_repeated_link_addr.sh:1.1
--- /dev/null	Tue Jun 30 11:48:20 2020
+++ src/tests/sbin/ifconfig/t_repeated_link_addr.sh	Tue Jun 30 11:48:20 2020
@@ -0,0 +1,120 @@
+# $NetBSD: t_repeated_link_addr.sh,v 1.1 2020/06/30 11:48:20 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.
+#
+atf_test_case repeated_link_addr
+repeated_link_addr_head() {
+	atf_set "require.user" "root"
+	atf_set "descr" "Check with ifconfig(8) that " \
+		"setting link addresses for active interfaces " \
+		"does not cause a panic (PR kern/41912)"
+}
+
+repeated_link_addr_body() {
+
+	fail=0
+	addrs="00:11:00:00:00:00 \
+	   00:11:11:00:00:00 \
+	   00:11:11:11:00:00 \
+	   00:11:11:11:11:00 \
+	   00:00:11:00:00:00 \
+	   00:00:11:11:00:00 \
+	   00:00:11:11:11:00 \
+	   00:00:00:11:00:00 \
+	   00:00:00:11:11:00"
+
+	pkill -9 hostapd
+	pkill -9 wpa_supplic

CVS commit: src/tests/lib/libc

2020-06-29 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jun 29 14:22:11 UTC 2020

Modified Files:
src/tests/lib/libc/stdio: Makefile
src/tests/lib/libc/stdlib: Makefile

Log Message:
Use -Wl,--no-fatal-warnings for the mktemp(3) test.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libc/stdio/Makefile
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libc/stdlib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdio/Makefile
diff -u src/tests/lib/libc/stdio/Makefile:1.13 src/tests/lib/libc/stdio/Makefile:1.14
--- src/tests/lib/libc/stdio/Makefile:1.13	Sat Jun 27 09:45:57 2020
+++ src/tests/lib/libc/stdio/Makefile	Mon Jun 29 14:22:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2020/06/27 09:45:57 jruoho Exp $
+# $NetBSD: Makefile,v 1.14 2020/06/29 14:22:11 jruoho Exp $
 
 .include 
 
@@ -15,6 +15,4 @@ TESTS_C+=	t_printf
 TESTS_C+=	t_scanf
 COPTS.t_printf.c += -Wno-format-nonliteral
 
-LDADD.t_mktemp+=	-Wl,--no-fatal-warnings
-
 .include 

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.30 src/tests/lib/libc/stdlib/Makefile:1.31
--- src/tests/lib/libc/stdlib/Makefile:1.30	Sat Jun 27 10:14:10 2020
+++ src/tests/lib/libc/stdlib/Makefile	Mon Jun 29 14:22:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2020/06/27 10:14:10 jruoho Exp $
+# $NetBSD: Makefile,v 1.31 2020/06/29 14:22:11 jruoho Exp $
 
 .include 
 
@@ -35,6 +35,7 @@ CPPFLAGS.t_strtod.c+=  -D__TEST_FENV
 LDADD.t_strtod=			-lm
 DPADD.t_strtod+=		${LIBM}
 
-LDADD.t_getenv_thread=		-lpthread
+LDADD.t_getenv_thread=	-lpthread
+LDADD.t_mktemp+=	-Wl,--no-fatal-warnings
 
 .include 



CVS commit: src/tests/sbin/ifconfig

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 14:04:17 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_random_garbage.sh

Log Message:
Ups. Fix shell parameter.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/ifconfig/t_random_garbage.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_random_garbage.sh
diff -u src/tests/sbin/ifconfig/t_random_garbage.sh:1.1 src/tests/sbin/ifconfig/t_random_garbage.sh:1.2
--- src/tests/sbin/ifconfig/t_random_garbage.sh:1.1	Sat Jun 27 13:53:43 2020
+++ src/tests/sbin/ifconfig/t_random_garbage.sh	Sat Jun 27 14:04:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_random_garbage.sh,v 1.1 2020/06/27 13:53:43 jruoho Exp $
+# $NetBSD: t_random_garbage.sh,v 1.2 2020/06/27 14:04:17 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,10 +38,10 @@ getrstr() {
 write_garbage() {
 	val=$(getrint)
 	echo "Test $3: write to $1 opt $2 -> $val"
-	ifconfig $1 $opt $val >/dev/null 2>&1
+	ifconfig $1 $2 $val >/dev/null 2>&1
 	val=$(getrstr)
 	echo "Test $3: write to $1 opt $2 -> $val"
-	ifconfig $1 $opt $val >/dev/null 2>&1
+	ifconfig $1 $2 $val >/dev/null 2>&1
 }
 
 atf_test_case random_garbage



CVS commit: src

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 13:53:43 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile
Added Files:
src/tests/sbin/ifconfig: t_random_garbage.sh

Log Message:
Add also a test that writes random garbage to every ifconfig(8) option that
takes parameters. Based on quick testing, iwn(4) and wm(4) pass, but
urtwn(4) panics. Use at your own risk; in some cases, it may be possible
that horrors are written directly to the hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.860 -r1.861 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.7 -r1.8 src/tests/sbin/ifconfig/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_random_garbage.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.860 src/distrib/sets/lists/tests/mi:1.861
--- src/distrib/sets/lists/tests/mi:1.860	Sat Jun 27 10:15:50 2020
+++ src/distrib/sets/lists/tests/mi	Sat Jun 27 13:53:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.860 2020/06/27 10:15:50 jruoho Exp $
+# $NetBSD: mi,v 1.861 2020/06/27 13:53:43 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3999,6 +3999,7 @@
 ./usr/tests/sbin/ifconfig/t_bridge		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_capabilities	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_nonexistent		tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_random_garbage	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_updown	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_tap			tests-sbin-tests	compattestfile,atf

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.7 src/tests/sbin/ifconfig/Makefile:1.8
--- src/tests/sbin/ifconfig/Makefile:1.7	Sat Jun 27 06:57:44 2020
+++ src/tests/sbin/ifconfig/Makefile	Sat Jun 27 13:53:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2020/06/27 06:57:44 jruoho Exp $
+# $NetBSD: Makefile,v 1.8 2020/06/27 13:53:43 jruoho Exp $
 
 .include 
 
@@ -7,6 +7,7 @@ TESTSDIR=	${TESTSBASE}/sbin/ifconfig
 TESTS_SH=	t_bridge \
 		t_capabilities \
 		t_nonexistent \
+		t_random_garbage \
 		t_repeated_scan \
 		t_repeated_updown \
 		t_tap \

Added files:

Index: src/tests/sbin/ifconfig/t_random_garbage.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_random_garbage.sh:1.1
--- /dev/null	Sat Jun 27 13:53:43 2020
+++ src/tests/sbin/ifconfig/t_random_garbage.sh	Sat Jun 27 13:53:43 2020
@@ -0,0 +1,94 @@
+# $NetBSD: t_random_garbage.sh,v 1.1 2020/06/27 13:53:43 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.
+#
+getrint() {
+	echo $(od -An -N2 -i /dev/urandom | sed 's/ //')
+}
+
+getrstr() {
+	echo $(cat /dev/urandom | head -n 1 | base64)
+}
+
+write_garbage() {
+	val=$(getrint)
+	echo "Test $3: write to $1 opt $2 -> $val"
+	ifconfig $1 $opt $val >/dev/null 2>&1
+	val=$(getrstr)
+	echo "Test $3: write to $1 opt $2 -> $val"
+	ifconfig $1 $opt $val >/dev/null 2>&1
+}
+
+atf_test_case random_garbage
+random_garbage_head() {
+	atf_set "require.user" "root"
+	atf_set "descr" "Test writing random garbage to ifconfig(8) options"
+}
+
+random_garbage_body() {
+
+	# Please note:
+	#
+	#

CVS commit: src/tests/lib/libc/stdlib

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 10:19:43 UTC 2020

Modified Files:
src/tests/lib/libc/stdlib: t_mbtowc.c

Log Message:
Add the default TNF copyright (2005), cf. PR misc/55419.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/stdlib/t_mbtowc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/t_mbtowc.c
diff -u src/tests/lib/libc/stdlib/t_mbtowc.c:1.1 src/tests/lib/libc/stdlib/t_mbtowc.c:1.2
--- src/tests/lib/libc/stdlib/t_mbtowc.c:1.1	Sat Jun 27 10:14:10 2020
+++ src/tests/lib/libc/stdlib/t_mbtowc.c	Sat Jun 27 10:19:43 2020
@@ -1,3 +1,30 @@
+/*	$NetBSD: t_mbtowc.c,v 1.2 2020/06/27 10:19:43 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2005 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * 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.
+ */
 
 /* From: Miloslav Trmac  */
 



CVS commit: src/distrib/sets/lists/tests

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 10:15:50 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Add t_t_mbtowc.


To generate a diff of this commit:
cvs rdiff -u -r1.859 -r1.860 src/distrib/sets/lists/tests/mi

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.859 src/distrib/sets/lists/tests/mi:1.860
--- src/distrib/sets/lists/tests/mi:1.859	Sat Jun 27 09:45:57 2020
+++ src/distrib/sets/lists/tests/mi	Sat Jun 27 10:15:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.859 2020/06/27 09:45:57 jruoho Exp $
+# $NetBSD: mi,v 1.860 2020/06/27 10:15:50 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3074,6 +3074,7 @@
 ./usr/tests/lib/libc/stdlib/t_getenv_thread	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_getopt		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_hsearch		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdlib/t_mbtowc		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_mi_vector_hash	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_mktemp		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_posix_memalign	tests-lib-tests		compattestfile,atf



CVS commit: src

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 10:14:10 UTC 2020

Modified Files:
src/tests/lib/libc/stdlib: Makefile
Added Files:
src/tests/lib/libc/stdlib: t_mbtowc.c
Removed Files:
src/regress/lib/libc/citrus: Makefile
src/regress/lib/libc/citrus/mbtowc: Makefile mbtowc_test.c

Log Message:
Start moving the remaining tests from src/regress to src/tests.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/regress/lib/libc/citrus/Makefile
cvs rdiff -u -r1.1 -r0 src/regress/lib/libc/citrus/mbtowc/Makefile \
src/regress/lib/libc/citrus/mbtowc/mbtowc_test.c
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdlib/t_mbtowc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.29 src/tests/lib/libc/stdlib/Makefile:1.30
--- src/tests/lib/libc/stdlib/Makefile:1.29	Sat Jun 27 09:45:57 2020
+++ src/tests/lib/libc/stdlib/Makefile	Sat Jun 27 10:14:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2020/06/27 09:45:57 jruoho Exp $
+# $NetBSD: Makefile,v 1.30 2020/06/27 10:14:10 jruoho Exp $
 
 .include 
 
@@ -11,6 +11,7 @@ TESTS_C+=	t_getenv
 TESTS_C+=	t_getenv_thread
 TESTS_C+=	t_exit
 TESTS_C+=	t_hsearch
+TESTS_C+=	t_mbtowc
 TESTS_C+=	t_mktemp
 TESTS_C+=	t_mi_vector_hash
 TESTS_C+=	t_posix_memalign

Added files:

Index: src/tests/lib/libc/stdlib/t_mbtowc.c
diff -u /dev/null src/tests/lib/libc/stdlib/t_mbtowc.c:1.1
--- /dev/null	Sat Jun 27 10:14:10 2020
+++ src/tests/lib/libc/stdlib/t_mbtowc.c	Sat Jun 27 10:14:10 2020
@@ -0,0 +1,47 @@
+
+/* From: Miloslav Trmac  */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+ATF_TC(mbtowc_sign);
+ATF_TC_HEAD(mbtowc_sign, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test mbtowc(3) sign conversion");
+}
+
+ATF_TC_BODY(mbtowc_sign, tc)
+{
+	char back[MB_LEN_MAX];
+	wchar_t wc;
+	size_t i;
+	int ret;
+
+	(void)setlocale(LC_ALL, "");
+	(void)printf("Charset: %s\n", nl_langinfo(CODESET));
+	ret = mbtowc(, "\xe4", 1);
+	(void)printf("mbtowc(): %d\n", ret);
+
+	if (ret > 0) {
+		(void)printf("Result: 0x%08lX\n",(unsigned long)wc);
+		ret = wctomb(back, wc);
+		(void)printf("wctomb(): %d\n", ret);
+		for(i = 0; ret > 0 && i < (size_t)ret; i++)
+			printf("%02X ",(unsigned char)back[i]);
+		putchar('\n');
+	}
+
+	ATF_REQUIRE(ret > 0);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+	ATF_TP_ADD_TC(tp, mbtowc_sign);
+
+	return atf_no_error();
+}



CVS commit: src

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 09:45:57 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/stdio: Makefile
src/tests/lib/libc/stdlib: Makefile
Added Files:
src/tests/lib/libc/stdlib: t_mktemp.c
Removed Files:
src/tests/lib/libc/stdio: t_mktemp.c

Log Message:
Move the test for mktemp(3) to the right place.


To generate a diff of this commit:
cvs rdiff -u -r1.858 -r1.859 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.12 -r1.13 src/tests/lib/libc/stdio/Makefile
cvs rdiff -u -r1.1 -r0 src/tests/lib/libc/stdio/t_mktemp.c
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libc/stdlib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdlib/t_mktemp.c

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.858 src/distrib/sets/lists/tests/mi:1.859
--- src/distrib/sets/lists/tests/mi:1.858	Sat Jun 27 08:50:46 2020
+++ src/distrib/sets/lists/tests/mi	Sat Jun 27 09:45:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.858 2020/06/27 08:50:46 jruoho Exp $
+# $NetBSD: mi,v 1.859 2020/06/27 09:45:57 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3052,7 +3052,7 @@
 ./usr/tests/lib/libc/stdio/t_fopen		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_format		tests-obsolete		obsolete
 ./usr/tests/lib/libc/stdio/t_fputc		tests-lib-tests		compattestfile,atf
-./usr/tests/lib/libc/stdio/t_mktemp		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdio/t_mktemp		tests-obsolete		obsolete
 ./usr/tests/lib/libc/stdio/t_open_memstream	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_popen		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdio/t_printf		tests-lib-tests		compattestfile,atf
@@ -3075,6 +3075,7 @@
 ./usr/tests/lib/libc/stdlib/t_getopt		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_hsearch		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_mi_vector_hash	tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libc/stdlib/t_mktemp		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_posix_memalign	tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_random		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/libc/stdlib/t_strtod		tests-lib-tests		compattestfile,atf

Index: src/tests/lib/libc/stdio/Makefile
diff -u src/tests/lib/libc/stdio/Makefile:1.12 src/tests/lib/libc/stdio/Makefile:1.13
--- src/tests/lib/libc/stdio/Makefile:1.12	Wed Oct 15 21:55:34 2014
+++ src/tests/lib/libc/stdio/Makefile	Sat Jun 27 09:45:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2014/10/15 21:55:34 justin Exp $
+# $NetBSD: Makefile,v 1.13 2020/06/27 09:45:57 jruoho Exp $
 
 .include 
 
@@ -10,7 +10,6 @@ TESTS_C+=	t_fmemopen
 TESTS_C+=	t_fopen
 TESTS_C+=	t_open_memstream
 TESTS_C+=	t_fputc
-TESTS_C+=	t_mktemp
 TESTS_C+=	t_popen
 TESTS_C+=	t_printf
 TESTS_C+=	t_scanf

Index: src/tests/lib/libc/stdlib/Makefile
diff -u src/tests/lib/libc/stdlib/Makefile:1.28 src/tests/lib/libc/stdlib/Makefile:1.29
--- src/tests/lib/libc/stdlib/Makefile:1.28	Tue Dec 22 14:27:14 2015
+++ src/tests/lib/libc/stdlib/Makefile	Sat Jun 27 09:45:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2015/12/22 14:27:14 christos Exp $
+# $NetBSD: Makefile,v 1.29 2020/06/27 09:45:57 jruoho Exp $
 
 .include 
 
@@ -11,6 +11,7 @@ TESTS_C+=	t_getenv
 TESTS_C+=	t_getenv_thread
 TESTS_C+=	t_exit
 TESTS_C+=	t_hsearch
+TESTS_C+=	t_mktemp
 TESTS_C+=	t_mi_vector_hash
 TESTS_C+=	t_posix_memalign
 TESTS_C+=	t_random

Added files:

Index: src/tests/lib/libc/stdlib/t_mktemp.c
diff -u /dev/null src/tests/lib/libc/stdlib/t_mktemp.c:1.1
--- /dev/null	Sat Jun 27 09:45:57 2020
+++ src/tests/lib/libc/stdlib/t_mktemp.c	Sat Jun 27 09:45:57 2020
@@ -0,0 +1,54 @@
+/* $NetBSD: t_mktemp.c,v 1.1 2020/06/27 09:45:57 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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. 

CVS commit: src

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 08:50:46 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/sysctl: Makefile
Added Files:
src/tests/sbin/sysctl: t_random_garbage.sh

Log Message:
Add a simple test case that writes random garbage to (almost) every sysctl node.
This test reproduced already at least five unique panics in a few quick runs.
The test is skipped by default as it is not likely safe even without the panics.


To generate a diff of this commit:
cvs rdiff -u -r1.857 -r1.858 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/sysctl/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/sysctl/t_random_garbage.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.857 src/distrib/sets/lists/tests/mi:1.858
--- src/distrib/sets/lists/tests/mi:1.857	Sat Jun 27 06:57:44 2020
+++ src/distrib/sets/lists/tests/mi	Sat Jun 27 08:50:46 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.857 2020/06/27 06:57:44 jruoho Exp $
+# $NetBSD: mi,v 1.858 2020/06/27 08:50:46 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4032,6 +4032,7 @@
 ./usr/tests/sbin/sysctl/Atffile			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/sysctl/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
 ./usr/tests/sbin/sysctl/t_perm			tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/sysctl/t_random_garbage	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/sysctl/t_sysctl		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sharetests-sys-tests	compattestfile,atf
 ./usr/tests/share/Atffile			tests-sys-tests		compattestfile,atf

Index: src/tests/sbin/sysctl/Makefile
diff -u src/tests/sbin/sysctl/Makefile:1.2 src/tests/sbin/sysctl/Makefile:1.3
--- src/tests/sbin/sysctl/Makefile:1.2	Tue Apr 10 02:39:33 2012
+++ src/tests/sbin/sysctl/Makefile	Sat Jun 27 08:50:46 2020
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.2 2012/04/10 02:39:33 jruoho Exp $
+# $NetBSD: Makefile,v 1.3 2020/06/27 08:50:46 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin/sysctl
 
-TESTS_SH=	t_perm t_sysctl
+TESTS_SH=	t_perm t_random_garbage t_sysctl
 
 .include 

Added files:

Index: src/tests/sbin/sysctl/t_random_garbage.sh
diff -u /dev/null src/tests/sbin/sysctl/t_random_garbage.sh:1.1
--- /dev/null	Sat Jun 27 08:50:46 2020
+++ src/tests/sbin/sysctl/t_random_garbage.sh	Sat Jun 27 08:50:46 2020
@@ -0,0 +1,93 @@
+# $NetBSD: t_random_garbage.sh,v 1.1 2020/06/27 08:50:46 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/sysctl.out"
+
+getrint() {
+	echo $(od -An -N2 -i /dev/urandom | sed 's/ //')
+}
+
+getrstr() {
+	echo $(cat /dev/urandom | head -n 1 | base64)
+}
+
+atf_test_case random_garbage cleanup
+random_garbage_head() {
+	sysctl -a > $tmp
+	atf_set "require.user" "root"
+	atf_set "descr" "Test writing random garbage to sysctl nodes"
+}
+
+random_garbage_body() {
+
+	atf_skip "The test is not safe"
+
+	while read line; do
+
+		var=$(echo $line | awk '{print $1}')
+
+		case $var in
+			kern.securelevel*)
+			echo "Skipping $var"
+			continue
+			;;
+
+			security*)
+			echo "Skipping $var"
+			continue
+			;;
+		esac
+
+		val=$(getrint)
+		echo "Write $var -> $val"
+		sysctl -w $var=$val
+		val=$(getrstr)
+		echo "Wri

CVS commit: src

2020-06-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 06:57:44 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile
Added Files:
src/tests/sbin/ifconfig: t_capabilities.sh

Log Message:
Add a basic test for enabling/disabling network interface capabilities.


To generate a diff of this commit:
cvs rdiff -u -r1.856 -r1.857 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.6 -r1.7 src/tests/sbin/ifconfig/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_capabilities.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.856 src/distrib/sets/lists/tests/mi:1.857
--- src/distrib/sets/lists/tests/mi:1.856	Sat Jun 27 05:20:34 2020
+++ src/distrib/sets/lists/tests/mi	Sat Jun 27 06:57:44 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.856 2020/06/27 05:20:34 jruoho Exp $
+# $NetBSD: mi,v 1.857 2020/06/27 06:57:44 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3995,6 +3995,7 @@
 ./usr/tests/sbin/ifconfig/Atffile		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
 ./usr/tests/sbin/ifconfig/t_bridge		tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_capabilities	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_nonexistent		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_updown	tests-sbin-tests	compattestfile,atf

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.6 src/tests/sbin/ifconfig/Makefile:1.7
--- src/tests/sbin/ifconfig/Makefile:1.6	Sat Jun 27 05:07:07 2020
+++ src/tests/sbin/ifconfig/Makefile	Sat Jun 27 06:57:44 2020
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.6 2020/06/27 05:07:07 jruoho Exp $
+# $NetBSD: Makefile,v 1.7 2020/06/27 06:57:44 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin/ifconfig
 
 TESTS_SH=	t_bridge \
+		t_capabilities \
 		t_nonexistent \
 		t_repeated_scan \
 		t_repeated_updown \

Added files:

Index: src/tests/sbin/ifconfig/t_capabilities.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_capabilities.sh:1.1
--- /dev/null	Sat Jun 27 06:57:44 2020
+++ src/tests/sbin/ifconfig/t_capabilities.sh	Sat Jun 27 06:57:44 2020
@@ -0,0 +1,159 @@
+# $NetBSD: t_capabilities.sh,v 1.1 2020/06/27 06:57:44 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.
+#
+setcap() {
+
+	echo "Request: $1 $2 ($3)"
+	ifconfig $1 $2
+
+	if [ $4 -eq 1 ]; then
+
+		if [ ! $? -eq 0 ]; then
+			atf_fail "Failed to enable $3 for $1"
+		fi
+
+		if [ -z "$(ifconfig $1 | grep "enabled" | grep $3)" ]; then
+			atf_fail "Failed to enable $3 for $1"
+		fi
+
+		echo "Request: $1 -$2 (-$3)"
+		ifconfig $1 -$2
+
+		if [ ! $? -eq 0 ]; then
+			atf_fail "Failed to disable $3 for $1"
+		fi
+
+		if [ ! -z "$(ifconfig $1 | grep "enabled" | grep $3)" ]; then
+			atf_fail "Failed to disable $3 for $1"
+		fi
+	fi
+}
+
+parsecap() {
+
+	i=$1
+	checkrv=$3
+	x=$(echo $2 | sed "s/.*//")
+
+	export IFS=","
+
+	for y in $x; do
+
+		z=""
+
+		if [ $y = "TSO4" ]; then
+			z="tso4"
+		elif [ $y = "IP4CSUM_Rx" ]; then
+			z="ip4csum-rx&qu

CVS commit: src

2020-06-26 Thread Jukka Ruohonen
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.sbintests-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 
@@ -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 
+
+TESTSDIR=	${TESTSBASE}/usr.bin/ztest
+TESTS_SH=	t_ztest
+
+.include 
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 W

CVS commit: src

2020-06-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 05:07:08 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile
Added Files:
src/tests/sbin/ifconfig: t_woptions.sh

Log Message:
Add test cases for different 802.11 options. These include cases for
PR kern/35045, PR kern/45745, and PR kern/55424.


To generate a diff of this commit:
cvs rdiff -u -r1.854 -r1.855 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.5 -r1.6 src/tests/sbin/ifconfig/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_woptions.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.854 src/distrib/sets/lists/tests/mi:1.855
--- src/distrib/sets/lists/tests/mi:1.854	Thu Jun 25 18:30:42 2020
+++ src/distrib/sets/lists/tests/mi	Sat Jun 27 05:07:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.854 2020/06/25 18:30:42 jruoho Exp $
+# $NetBSD: mi,v 1.855 2020/06/27 05:07:07 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3999,6 +3999,7 @@
 ./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_updown	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_tap			tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_woptions		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfstests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfs/Atffile			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfs/Kyuafile			tests-sbin-tests	compattestfile,atf,kyua

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.5 src/tests/sbin/ifconfig/Makefile:1.6
--- src/tests/sbin/ifconfig/Makefile:1.5	Thu Jun 25 18:30:42 2020
+++ src/tests/sbin/ifconfig/Makefile	Sat Jun 27 05:07:07 2020
@@ -1,9 +1,14 @@
-# $NetBSD: Makefile,v 1.5 2020/06/25 18:30:42 jruoho Exp $
+# $NetBSD: Makefile,v 1.6 2020/06/27 05:07:07 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin/ifconfig
 
-TESTS_SH=	t_bridge t_nonexistent t_repeated_scan t_repeated_updown t_tap
+TESTS_SH=	t_bridge \
+		t_nonexistent \
+		t_repeated_scan \
+		t_repeated_updown \
+		t_tap \
+		t_woptions
 
 .include 

Added files:

Index: src/tests/sbin/ifconfig/t_woptions.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_woptions.sh:1.1
--- /dev/null	Sat Jun 27 05:07:08 2020
+++ src/tests/sbin/ifconfig/t_woptions.sh	Sat Jun 27 05:07:08 2020
@@ -0,0 +1,208 @@
+# $NetBSD: t_woptions.sh,v 1.1 2020/06/27 05:07:08 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.
+
+atf_test_case chan
+chan_head() {
+	atf_set "require.user" "root"
+	atf_set "descr" "Test with ifconfig(8) that setting " \
+		"802.11 channels does not panic (PR kern/55424)"
+}
+
+chan_body() {
+
+	# This sequence covers both valid and invalid channels.
+	# Different 802.11 modes are not taken into account, and
+	# all interfaces are tested, including non-802.11 ones.
+	#
+	chans=$(seq 1 500)
+
+	pkill -9 hostapd
+	pkill -9 wpa_supplicant
+
+	for i in $(ifconfig -l); do
+
+		if [ ! -z "$(echo $i | grep urtwn)" ]; then
+			echo "Skipping $i (PR kern/55424)"
+			continue
+		fi
+
+		state="up"
+		ifconfig -s $i
+
+		if [ $? -eq 1 ]; then
+			state="down"
+		fi
+
+		m=""
+		mm=$(ifconfig $i | grep "chan"

CVS commit: src/tests/sbin/ifconfig

2020-06-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Jun 27 04:15:17 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_repeated_scan.sh t_repeated_updown.sh

Log Message:
Use atf_pass to avoid test failure in case there are no suitable interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/sbin/ifconfig/t_repeated_scan.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/ifconfig/t_repeated_updown.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_repeated_scan.sh
diff -u src/tests/sbin/ifconfig/t_repeated_scan.sh:1.4 src/tests/sbin/ifconfig/t_repeated_scan.sh:1.5
--- src/tests/sbin/ifconfig/t_repeated_scan.sh:1.4	Thu Jun 25 11:26:05 2020
+++ src/tests/sbin/ifconfig/t_repeated_scan.sh	Sat Jun 27 04:15:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_scan.sh,v 1.4 2020/06/25 11:26:05 jruoho Exp $
+# $NetBSD: t_repeated_scan.sh,v 1.5 2020/06/27 04:15:17 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -81,6 +81,8 @@ repeated_scan_body() {
 
 	/bin/sh /etc/rc.d/hostapd restart >/dev/null 2>&1
 	/bin/sh /etc/rc.d/wpa_supplicant restart >/dev/null 2>&1
+
+	atf_pass
 }
 
 atf_init_test_cases() {

Index: src/tests/sbin/ifconfig/t_repeated_updown.sh
diff -u src/tests/sbin/ifconfig/t_repeated_updown.sh:1.2 src/tests/sbin/ifconfig/t_repeated_updown.sh:1.3
--- src/tests/sbin/ifconfig/t_repeated_updown.sh:1.2	Thu Jun 25 16:34:49 2020
+++ src/tests/sbin/ifconfig/t_repeated_updown.sh	Sat Jun 27 04:15:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_updown.sh,v 1.2 2020/06/25 16:34:49 jruoho Exp $
+# $NetBSD: t_repeated_updown.sh,v 1.3 2020/06/27 04:15:17 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -63,6 +63,8 @@ repeated_updown_body() {
 		echo "Restored state of $i to $state"
 		sleep 1
 	done
+
+	atf_pass
 }
 
 atf_init_test_cases() {



CVS commit: src/tests

2020-06-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Jun 26 07:50:12 UTC 2020

Modified Files:
src/tests/dev/audio: audiotest.c
src/tests/fs/nullfs: t_basic.c
src/tests/fs/tmpfs: t_renamerace.c
src/tests/kernel: t_extattrctl.c
src/tests/lib/libc/sys: t_mmap.c t_pipe.c
src/tests/usr.bin/awk: t_awk.sh

Log Message:
Reference PRs consistently.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/dev/audio/audiotest.c
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/nullfs/t_basic.c
cvs rdiff -u -r1.14 -r1.15 src/tests/fs/tmpfs/t_renamerace.c
cvs rdiff -u -r1.1 -r1.2 src/tests/kernel/t_extattrctl.c
cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libc/sys/t_mmap.c
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_pipe.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/awk/t_awk.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/dev/audio/audiotest.c
diff -u src/tests/dev/audio/audiotest.c:1.11 src/tests/dev/audio/audiotest.c:1.12
--- src/tests/dev/audio/audiotest.c:1.11	Fri May  1 05:45:57 2020
+++ src/tests/dev/audio/audiotest.c	Fri Jun 26 07:50:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audiotest.c,v 1.11 2020/05/01 05:45:57 isaki Exp $	*/
+/*	$NetBSD: audiotest.c,v 1.12 2020/06/26 07:50:12 jruoho Exp $	*/
 
 /*
  * Copyright (C) 2019 Tetsuya Isaki. All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: audiotest.c,v 1.11 2020/05/01 05:45:57 isaki Exp $");
+__RCSID("$NetBSD: audiotest.c,v 1.12 2020/06/26 07:50:12 jruoho Exp $");
 
 #include 
 #include 
@@ -720,7 +720,7 @@ consumer_thread(void *arg)
 
 /*
  * XXX
- * Closing pad descriptor before audio descriptor causes panic (kern/54427).
+ * Closing pad descriptor before audio descriptor causes panic (PR kern/54427).
  * To avoid this, close non-pad descriptor first using atexit(3) for now.
  * This is just a workaround and this function should be removed.
  */

Index: src/tests/fs/nullfs/t_basic.c
diff -u src/tests/fs/nullfs/t_basic.c:1.4 src/tests/fs/nullfs/t_basic.c:1.5
--- src/tests/fs/nullfs/t_basic.c:1.4	Fri Jan 13 21:30:40 2017
+++ src/tests/fs/nullfs/t_basic.c	Fri Jun 26 07:50:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_basic.c,v 1.4 2017/01/13 21:30:40 christos Exp $	*/
+/*	$NetBSD: t_basic.c,v 1.5 2020/06/26 07:50:12 jruoho Exp $	*/
 
 #include 
 #include 
@@ -133,11 +133,11 @@ ATF_TC_HEAD(twistymount, tc)
 
 	/* this is expected to fail until the PR is fixed */
 	atf_tc_set_md_var(tc, "descr", "\"recursive\" mounts deadlock"
-	" (kern/43439)");
+	" (PR kern/43439)");
 }
 
 /*
- * Mapping to identifiers in kern/43439:
+ * Mapping to identifiers in PR kern/43439:
  *  /td		= /home/current/pkgsrc
  *  /td/dist	= /home/current/pkgsrc/distiles
  *  /mp		= /usr/pkgsrc

Index: src/tests/fs/tmpfs/t_renamerace.c
diff -u src/tests/fs/tmpfs/t_renamerace.c:1.14 src/tests/fs/tmpfs/t_renamerace.c:1.15
--- src/tests/fs/tmpfs/t_renamerace.c:1.14	Fri Jan 13 21:30:40 2017
+++ src/tests/fs/tmpfs/t_renamerace.c	Fri Jun 26 07:50:12 2020
@@ -1,8 +1,8 @@
-/*	$NetBSD: t_renamerace.c,v 1.14 2017/01/13 21:30:40 christos Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.15 2020/06/26 07:50:12 jruoho Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
- * by Nicolas Joly in kern/40948
+ * by Nicolas Joly in PR kern/40948
  */
 
 #include 

Index: src/tests/kernel/t_extattrctl.c
diff -u src/tests/kernel/t_extattrctl.c:1.1 src/tests/kernel/t_extattrctl.c:1.2
--- src/tests/kernel/t_extattrctl.c:1.1	Fri May 21 16:47:45 2010
+++ src/tests/kernel/t_extattrctl.c	Fri Jun 26 07:50:11 2020
@@ -9,7 +9,7 @@ ATF_TC(extattrctl_namei);
 ATF_TC_HEAD(extattrctl_namei, tc)
 {
 
-	atf_tc_set_md_var(tc, "descr", "extattrctl namei safety (kern/43328)");
+	atf_tc_set_md_var(tc, "descr", "extattrctl namei safety (PR kern/43328)");
 }
 
 ATF_TC_BODY(extattrctl_namei, tc)

Index: src/tests/lib/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.13 src/tests/lib/libc/sys/t_mmap.c:1.14
--- src/tests/lib/libc/sys/t_mmap.c:1.13	Tue May 23 13:04:29 2017
+++ src/tests/lib/libc/sys/t_mmap.c	Fri Jun 26 07:50:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.13 2017/05/23 13:04:29 christos Exp $ */
+/* $NetBSD: t_mmap.c,v 1.14 2020/06/26 07:50:11 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mmap.c,v 1.13 2017/05/23 13:04:29 christos Exp $");
+__RCSID("$NetBSD: t_mmap.c,v 1.14 2020/06/26 07:50:11 jruoho Exp $");
 
 #include 
 #include 
@@ -171,7 +171,8 @@ ATF_TC_BODY(mmap_block, tc)
 	size_t len;
 	int fd = -1;
 
-	atf_tc_skip("The test case causes a panic (PR kern/38889, kern/46592)");
+	atf_tc_skip("The test case causes a panic " \
+	"(PR kern/38889, PR kern/46592)");
 
 	ATF_REQUIRE(sysctl(mib, miblen, NULL, , NULL, 0) == 0);
 	drives = malloc(len);

Index: src/tests/lib/libc/sys/t_pipe.c
diff -u 

CVS commit: src

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 18:30:42 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile t_tap.sh
Added Files:
src/tests/sbin/ifconfig: t_bridge.sh

Log Message:
Test creating thousands of bridge(4)'s.  Unlike with tap(4) (PR kern/55417),
this test succeeeds. It is even possible to have the ultimate ifconfig(8)
output with more than 65,000 devices.


To generate a diff of this commit:
cvs rdiff -u -r1.853 -r1.854 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.5 src/tests/sbin/ifconfig/Makefile \
src/tests/sbin/ifconfig/t_tap.sh
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_bridge.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.853 src/distrib/sets/lists/tests/mi:1.854
--- src/distrib/sets/lists/tests/mi:1.853	Thu Jun 25 17:08:33 2020
+++ src/distrib/sets/lists/tests/mi	Thu Jun 25 18:30:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.853 2020/06/25 17:08:33 jruoho Exp $
+# $NetBSD: mi,v 1.854 2020/06/25 18:30:42 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3994,6 +3994,7 @@
 ./usr/tests/sbin/ifconfig			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/Atffile		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
+./usr/tests/sbin/ifconfig/t_bridge		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_nonexistent		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_updown	tests-sbin-tests	compattestfile,atf

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.4 src/tests/sbin/ifconfig/Makefile:1.5
--- src/tests/sbin/ifconfig/Makefile:1.4	Thu Jun 25 15:41:40 2020
+++ src/tests/sbin/ifconfig/Makefile	Thu Jun 25 18:30:42 2020
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.4 2020/06/25 15:41:40 jruoho Exp $
+# $NetBSD: Makefile,v 1.5 2020/06/25 18:30:42 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin/ifconfig
 
-TESTS_SH=	t_nonexistent t_repeated_scan t_repeated_updown t_tap
+TESTS_SH=	t_bridge t_nonexistent t_repeated_scan t_repeated_updown t_tap
 
 .include 
Index: src/tests/sbin/ifconfig/t_tap.sh
diff -u src/tests/sbin/ifconfig/t_tap.sh:1.4 src/tests/sbin/ifconfig/t_tap.sh:1.5
--- src/tests/sbin/ifconfig/t_tap.sh:1.4	Thu Jun 25 16:57:00 2020
+++ src/tests/sbin/ifconfig/t_tap.sh	Thu Jun 25 18:30:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_tap.sh,v 1.4 2020/06/25 16:57:00 jruoho Exp $
+# $NetBSD: t_tap.sh,v 1.5 2020/06/25 18:30:42 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,7 +38,7 @@ manytaps_head() {
 manytaps_body() {
 
 	atf_skip "The test causes a panic (PR kern/55417)"
-	seq 65535 64000 > $taps
+	seq 65535 65000 > $taps # Try to avoid stalling automated runs.
 
 	while read tap; do
 

Added files:

Index: src/tests/sbin/ifconfig/t_bridge.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_bridge.sh:1.1
--- /dev/null	Thu Jun 25 18:30:42 2020
+++ src/tests/sbin/ifconfig/t_bridge.sh	Thu Jun 25 18:30:42 2020
@@ -0,0 +1,72 @@
+# $NetBSD: t_bridge.sh,v 1.1 2020/06/25 18:30:42 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.
+#
+bridges="/tmp/bridges"

CVS commit: src

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 17:08:33 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/sbin: Makefile
Added Files:
src/tests/sbin/setkey: Makefile t_setkey.sh

Log Message:
Verify that PR kern/52150 is no longer present.


To generate a diff of this commit:
cvs rdiff -u -r1.852 -r1.853 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.167 -r1.168 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.8 -r1.9 src/tests/sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/setkey/Makefile \
src/tests/sbin/setkey/t_setkey.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.852 src/distrib/sets/lists/tests/mi:1.853
--- src/distrib/sets/lists/tests/mi:1.852	Thu Jun 25 16:16:49 2020
+++ src/distrib/sets/lists/tests/mi	Thu Jun 25 17:08:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.852 2020/06/25 16:16:49 jruoho Exp $
+# $NetBSD: mi,v 1.853 2020/06/25 17:08:33 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4021,6 +4021,10 @@
 ./usr/tests/sbin/route/Atffile			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/route/Kyuafile			tests-sbin-tests	compattestfile,atf,kyua
 ./usr/tests/sbin/route/t_missing		tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/setkeytests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/setkey/Atffile			tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/setkey/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
+./usr/tests/sbin/setkey/t_setkey		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/sysctltests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/sysctl/Atffile			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/sysctl/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.167 src/etc/mtree/NetBSD.dist.tests:1.168
--- src/etc/mtree/NetBSD.dist.tests:1.167	Thu Jun 25 15:01:35 2020
+++ src/etc/mtree/NetBSD.dist.tests	Thu Jun 25 17:08:33 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.167 2020/06/25 15:01:35 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.168 2020/06/25 17:08:33 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -379,6 +379,7 @@
 ./usr/tests/sbin/newfs_msdos
 ./usr/tests/sbin/resize_ffs
 ./usr/tests/sbin/route
+./usr/tests/sbin/setkey
 ./usr/tests/sbin/sysctl
 ./usr/tests/share
 ./usr/tests/share/examples

Index: src/tests/sbin/Makefile
diff -u src/tests/sbin/Makefile:1.8 src/tests/sbin/Makefile:1.9
--- src/tests/sbin/Makefile:1.8	Thu Jun 25 15:01:35 2020
+++ src/tests/sbin/Makefile	Thu Jun 25 17:08:32 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2020/06/25 15:01:35 jruoho Exp $
+#	$NetBSD: Makefile,v 1.9 2020/06/25 17:08:32 jruoho Exp $
 #
 
 .include 
@@ -7,6 +7,6 @@ TESTSDIR=	${TESTSBASE}/sbin
 
 TESTS_SUBDIRS+=	envstat fsck_ffs gpt ifconfig \
 		newfs newfs_msdos resize_ffs \
-		route sysctl
+		route setkey sysctl
 
 .include 

Added files:

Index: src/tests/sbin/setkey/Makefile
diff -u /dev/null src/tests/sbin/setkey/Makefile:1.1
--- /dev/null	Thu Jun 25 17:08:33 2020
+++ src/tests/sbin/setkey/Makefile	Thu Jun 25 17:08:32 2020
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2020/06/25 17:08:32 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/sbin/setkey
+
+TESTS_SH=	t_setkey
+
+.include 
Index: src/tests/sbin/setkey/t_setkey.sh
diff -u /dev/null src/tests/sbin/setkey/t_setkey.sh:1.1
--- /dev/null	Thu Jun 25 17:08:33 2020
+++ src/tests/sbin/setkey/t_setkey.sh	Thu Jun 25 17:08:32 2020
@@ -0,0 +1,47 @@
+# $NetBSD: t_setkey.sh,v 1.1 2020/06/25 17:08:32 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
+# 

CVS commit: src/tests/sbin/ifconfig

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 16:57:00 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_tap.sh

Log Message:
Instead of UINT_MAX + 2, test what is claimed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/ifconfig/t_tap.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_tap.sh
diff -u src/tests/sbin/ifconfig/t_tap.sh:1.3 src/tests/sbin/ifconfig/t_tap.sh:1.4
--- src/tests/sbin/ifconfig/t_tap.sh:1.3	Thu Jun 25 16:52:49 2020
+++ src/tests/sbin/ifconfig/t_tap.sh	Thu Jun 25 16:57:00 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_tap.sh,v 1.3 2020/06/25 16:52:49 jruoho Exp $
+# $NetBSD: t_tap.sh,v 1.4 2020/06/25 16:57:00 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -83,15 +83,15 @@ overflow_head() {
 
 overflow_body() {
 	atf_skip "The test causes a panic (PR kern/53546)"
-	ifconfig tap65537 create
+	ifconfig tap9 create
 }
 
 overflow_cleanup() {
 
-	ifconfig tap65537 create
+	ifconfig tap9
 
 	if [ $? -eq 0 ]; then
-		ifconfig tap65537 destroy
+		ifconfig tap9 destroy
 	fi
 }
 



CVS commit: src/tests/sbin/ifconfig

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 16:52:50 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_tap.sh

Log Message:
Actually create the tap(4) with a negative device number. Doh.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/ifconfig/t_tap.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_tap.sh
diff -u src/tests/sbin/ifconfig/t_tap.sh:1.2 src/tests/sbin/ifconfig/t_tap.sh:1.3
--- src/tests/sbin/ifconfig/t_tap.sh:1.2	Thu Jun 25 15:43:26 2020
+++ src/tests/sbin/ifconfig/t_tap.sh	Thu Jun 25 16:52:49 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_tap.sh,v 1.2 2020/06/25 15:43:26 jruoho Exp $
+# $NetBSD: t_tap.sh,v 1.3 2020/06/25 16:52:49 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -88,7 +88,7 @@ overflow_body() {
 
 overflow_cleanup() {
 
-	ifconfig tap65537
+	ifconfig tap65537 create
 
 	if [ $? -eq 0 ]; then
 		ifconfig tap65537 destroy



CVS commit: src/tests/sbin/ifconfig

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 16:34:49 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_repeated_updown.sh

Log Message:
Reference also PR kern/52526.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/ifconfig/t_repeated_updown.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_repeated_updown.sh
diff -u src/tests/sbin/ifconfig/t_repeated_updown.sh:1.1 src/tests/sbin/ifconfig/t_repeated_updown.sh:1.2
--- src/tests/sbin/ifconfig/t_repeated_updown.sh:1.1	Thu Jun 25 15:41:40 2020
+++ src/tests/sbin/ifconfig/t_repeated_updown.sh	Thu Jun 25 16:34:49 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_updown.sh,v 1.1 2020/06/25 15:41:40 jruoho Exp $
+# $NetBSD: t_repeated_updown.sh,v 1.2 2020/06/25 16:34:49 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,8 +30,8 @@
 atf_test_case repeated_updown
 repeated_updown_head() {
 	atf_set "require.user" "root"
-	atf_set "descr" "Test with ifconfig(8) that repeated " \
-		"up/down does not cause a panic (PR kern/52771)"
+	atf_set "descr" "Test with ifconfig(8) that repeated up/down " \
+		"does not cause a panic (PR kern/52526; PR kern/52771)"
 }
 
 repeated_updown_body() {



CVS commit: src

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 16:16:49 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: t_nointerpreter.sh

Log Message:
Add a test case for PR kern/52744, which no longer appears to be present.


To generate a diff of this commit:
cvs rdiff -u -r1.851 -r1.852 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.66 -r1.67 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_nointerpreter.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.851 src/distrib/sets/lists/tests/mi:1.852
--- src/distrib/sets/lists/tests/mi:1.851	Thu Jun 25 15:41:40 2020
+++ src/distrib/sets/lists/tests/mi	Thu Jun 25 16:16:49 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.851 2020/06/25 15:41:40 jruoho Exp $
+# $NetBSD: mi,v 1.852 2020/06/25 16:16:49 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2200,6 +2200,7 @@
 ./usr/tests/kernel/t_lwpctl			tests-obsolete		obsolete
 ./usr/tests/kernel/t_mkdir			tests-obsolete		obsolete
 ./usr/tests/kernel/t_mqueue			tests-kernel-tests	compattestfile,atf
+./usr/tests/kernel/t_nointerpreter		tests-kernel-tests	atf
 ./usr/tests/kernel/t_origin			tests-kernel-tests	compattestfile,atf
 ./usr/tests/kernel/t_pipe			tests-obsolete		obsolete
 ./usr/tests/kernel/t_poll3w			tests-obsolete		obsolete

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.66 src/tests/kernel/Makefile:1.67
--- src/tests/kernel/Makefile:1.66	Sun Mar  1 18:08:15 2020
+++ src/tests/kernel/Makefile	Thu Jun 25 16:16:48 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.66 2020/03/01 18:08:15 christos Exp $
+# $NetBSD: Makefile,v 1.67 2020/06/25 16:16:48 jruoho Exp $
 
 NOMAN=		# defined
 
@@ -26,6 +26,7 @@ TESTS_SH+=	t_umountstress
 TESTS_SH+=	t_ps_strings
 TESTS_SH+=	t_trapsignal
 TESTS_SH+=	t_interp
+TESTS_SH+=	t_nointerpreter
 TESTS_SH+=	t_origin
 TESTS_SH+=	t_procpath
 TESTS_SH+=	t_fexecve

Added files:

Index: src/tests/kernel/t_nointerpreter.sh
diff -u /dev/null src/tests/kernel/t_nointerpreter.sh:1.1
--- /dev/null	Thu Jun 25 16:16:49 2020
+++ src/tests/kernel/t_nointerpreter.sh	Thu Jun 25 16:16:48 2020
@@ -0,0 +1,59 @@
+# $NetBSD: t_nointerpreter.sh,v 1.1 2020/06/25 16:16:48 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/nointerpreter"
+
+atf_test_case nointerpreter cleanup
+nointerpreter_head() {
+	atf_set "descr" "Check that executing shell scripts without a " \
+		"specified interpreter does not spam (PR kern/52744)"
+}
+
+nointerpreter_body() {
+
+	echo "echo hello world" > $tmp
+	chmod u+x $tmp
+	. $tmp
+	spam=$(dmesg | grep "check exec failed")
+
+	if [ ! -z $spam ]; then
+		atf_fail "Kernel spams harmless diagnostics"
+	fi
+}
+
+nointerpreter_cleanup() {
+
+	if [ -f $tmp ]; then
+		rm $tmp
+	fi
+}
+
+atf_init_test_cases() {
+	atf_add_test_case nointerpreter
+}



CVS commit: src/tests

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 15:43:27 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_tap.sh
src/tests/usr.sbin/cpuctl: t_cpuctl.sh

Log Message:
Fix pastos.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/ifconfig/t_tap.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.sbin/cpuctl/t_cpuctl.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_tap.sh
diff -u src/tests/sbin/ifconfig/t_tap.sh:1.1 src/tests/sbin/ifconfig/t_tap.sh:1.2
--- src/tests/sbin/ifconfig/t_tap.sh:1.1	Thu Jun 25 14:24:46 2020
+++ src/tests/sbin/ifconfig/t_tap.sh	Thu Jun 25 15:43:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_tap.sh,v 1.1 2020/06/25 14:24:46 jruoho Exp $
+# $NetBSD: t_tap.sh,v 1.2 2020/06/25 15:43:26 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -50,7 +50,7 @@ manytaps_body() {
 		fi
 
 		ifconfig "tap$tap" create
-		echo "Created $tap"
+		echo "Created tap$tap"
 
 	done < $taps
 }

Index: src/tests/usr.sbin/cpuctl/t_cpuctl.sh
diff -u src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.2 src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.3
--- src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.2	Wed Jun 24 10:07:13 2020
+++ src/tests/usr.sbin/cpuctl/t_cpuctl.sh	Thu Jun 25 15:43:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_cpuctl.sh,v 1.2 2020/06/24 10:07:13 jruoho Exp $
+# $NetBSD: t_cpuctl.sh,v 1.3 2020/06/25 15:43:26 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -126,13 +126,13 @@ err_body() {
 		-o empty -x cpuctl nointr -1
 
 	atf_check -s exit:1 -e ignore \
-		-o empty -x cpuctl identify $(exp ncpu + 1)
+		-o empty -x cpuctl identify $(expr ncpu + 1)
 
 	atf_check -s exit:1 -e ignore \
-		-o empty -x cpuctl offline $(exp ncpu + 1)
+		  -o empty -x cpuctl offline $(expr ncpu + 1)
 
 	atf_check -s exit:1 -e ignore \
-		-o empty -x cpuctl nointr $(exp ncpu + 1)
+		-o empty -x cpuctl nointr $(expr ncpu + 1)
 }
 
 err_cleanup() {



CVS commit: src

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 15:41:40 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile
Added Files:
src/tests/sbin/ifconfig: t_repeated_updown.sh

Log Message:
Add a test case for kern/52771.


To generate a diff of this commit:
cvs rdiff -u -r1.850 -r1.851 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/ifconfig/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_repeated_updown.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.850 src/distrib/sets/lists/tests/mi:1.851
--- src/distrib/sets/lists/tests/mi:1.850	Thu Jun 25 15:01:35 2020
+++ src/distrib/sets/lists/tests/mi	Thu Jun 25 15:41:40 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.850 2020/06/25 15:01:35 jruoho Exp $
+# $NetBSD: mi,v 1.851 2020/06/25 15:41:40 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3995,6 +3995,7 @@
 ./usr/tests/sbin/ifconfig/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
 ./usr/tests/sbin/ifconfig/t_nonexistent		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_repeated_updown	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_tap			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfstests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfs/Atffile			tests-sbin-tests	compattestfile,atf

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.3 src/tests/sbin/ifconfig/Makefile:1.4
--- src/tests/sbin/ifconfig/Makefile:1.3	Thu Jun 25 14:24:46 2020
+++ src/tests/sbin/ifconfig/Makefile	Thu Jun 25 15:41:40 2020
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2020/06/25 14:24:46 jruoho Exp $
+# $NetBSD: Makefile,v 1.4 2020/06/25 15:41:40 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin/ifconfig
 
-TESTS_SH=	t_nonexistent t_repeated_scan t_tap
+TESTS_SH=	t_nonexistent t_repeated_scan t_repeated_updown t_tap
 
 .include 

Added files:

Index: src/tests/sbin/ifconfig/t_repeated_updown.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_repeated_updown.sh:1.1
--- /dev/null	Thu Jun 25 15:41:40 2020
+++ src/tests/sbin/ifconfig/t_repeated_updown.sh	Thu Jun 25 15:41:40 2020
@@ -0,0 +1,70 @@
+# $NetBSD: t_repeated_updown.sh,v 1.1 2020/06/25 15:41:40 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.
+
+atf_test_case repeated_updown
+repeated_updown_head() {
+	atf_set "require.user" "root"
+	atf_set "descr" "Test with ifconfig(8) that repeated " \
+		"up/down does not cause a panic (PR kern/52771)"
+}
+
+repeated_updown_body() {
+
+	# Try to avoid stalling any automated test runs.
+	#
+	n=35
+
+	for i in $(ifconfig -l); do
+
+		state="up"
+		ifconfig -s $i
+
+		if [ $? -eq 1 ]; then
+			state="down"
+			ifconfig $i up
+			echo "Initialized $i up"
+		fi
+
+		while [ $n -gt 0 ]; do
+			ifconfig $i down
+			echo "Test $n: $i down"
+			ifconfig $i up
+			echo "Test $n: $i up"
+			n=$(expr $n - 1)
+		done
+
+		ifconfig $i $state
+		echo "Restored state of $i to $state"
+		sleep 1
+	done
+}
+
+atf_init_test_cases() {
+	atf_add_test_case repeated_updown
+}



CVS commit: src/usr.bin/logger

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 15:21:57 UTC 2020

Modified Files:
src/usr.bin/logger: logger.1

Log Message:
Fix PR kern/5.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/logger/logger.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/logger/logger.1
diff -u src/usr.bin/logger/logger.1:1.15 src/usr.bin/logger/logger.1:1.16
--- src/usr.bin/logger/logger.1:1.15	Sun May 13 17:08:31 2012
+++ src/usr.bin/logger/logger.1	Thu Jun 25 15:21:56 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: logger.1,v 1.15 2012/05/13 17:08:31 njoly Exp $
+.\"	$NetBSD: logger.1,v 1.16 2020/06/25 15:21:56 jruoho Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)logger.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd April 26, 2012
+.Dd June 25, 2020
 .Dt LOGGER 1
 .Os
 .Sh NAME
@@ -54,8 +54,12 @@ Options:
 .Pp
 .Bl -tag -width "messageXX"
 .It Fl c
-Log to console
-.Dv ( LOG_CONS ) .
+Log to console as a fallback
+.Dv ( LOG_CONS ) :
+if the message cannot be passed to
+.Xr syslogd 8 ,
+the message is written to
+.Pa /dev/console .
 .It Fl d Ar sd
 Log this in the structured data (SD) field.
 .Po



CVS commit: src

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 15:01:36 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/sbin: Makefile
Added Files:
src/tests/sbin/envstat: Makefile t_envstat.sh

Log Message:
Add a test case for PR kern/53410.


To generate a diff of this commit:
cvs rdiff -u -r1.849 -r1.850 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.166 -r1.167 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.7 -r1.8 src/tests/sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/envstat/Makefile \
src/tests/sbin/envstat/t_envstat.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.849 src/distrib/sets/lists/tests/mi:1.850
--- src/distrib/sets/lists/tests/mi:1.849	Thu Jun 25 14:24:45 2020
+++ src/distrib/sets/lists/tests/mi	Thu Jun 25 15:01:35 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.849 2020/06/25 14:24:45 jruoho Exp $
+# $NetBSD: mi,v 1.850 2020/06/25 15:01:35 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3967,6 +3967,10 @@
 ./usr/tests/sbintests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/Atffile			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/Kyuafile			tests-sbin-tests	compattestfile,atf,kyua
+./usr/tests/sbin/envstat			tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/envstat/Atffile		tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/envstat/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
+./usr/tests/sbin/envstat/t_envstat		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/fsck_ffs			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/fsck_ffs/Atffile		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/fsck_ffs/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.166 src/etc/mtree/NetBSD.dist.tests:1.167
--- src/etc/mtree/NetBSD.dist.tests:1.166	Wed Jun 24 10:05:07 2020
+++ src/etc/mtree/NetBSD.dist.tests	Thu Jun 25 15:01:35 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.166 2020/06/24 10:05:07 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.167 2020/06/25 15:01:35 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -371,6 +371,7 @@
 ./usr/tests/rump/rumpnet
 ./usr/tests/rump/rumpvfs
 ./usr/tests/sbin
+./usr/tests/sbin/envstat
 ./usr/tests/sbin/fsck_ffs
 ./usr/tests/sbin/gpt
 ./usr/tests/sbin/ifconfig

Index: src/tests/sbin/Makefile
diff -u src/tests/sbin/Makefile:1.7 src/tests/sbin/Makefile:1.8
--- src/tests/sbin/Makefile:1.7	Fri Dec  4 17:20:38 2015
+++ src/tests/sbin/Makefile	Thu Jun 25 15:01:35 2020
@@ -1,10 +1,12 @@
-#	$NetBSD: Makefile,v 1.7 2015/12/04 17:20:38 christos Exp $
+#	$NetBSD: Makefile,v 1.8 2020/06/25 15:01:35 jruoho Exp $
 #
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin
 
-TESTS_SUBDIRS+=	fsck_ffs gpt ifconfig newfs newfs_msdos resize_ffs route sysctl
+TESTS_SUBDIRS+=	envstat fsck_ffs gpt ifconfig \
+		newfs newfs_msdos resize_ffs \
+		route sysctl
 
 .include 

Added files:

Index: src/tests/sbin/envstat/Makefile
diff -u /dev/null src/tests/sbin/envstat/Makefile:1.1
--- /dev/null	Thu Jun 25 15:01:36 2020
+++ src/tests/sbin/envstat/Makefile	Thu Jun 25 15:01:35 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/06/25 15:01:35 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/sbin/envstat
+TESTS_SH=	t_envstat
+
+.include 
Index: src/tests/sbin/envstat/t_envstat.sh
diff -u /dev/null src/tests/sbin/envstat/t_envstat.sh:1.1
--- /dev/null	Thu Jun 25 15:01:36 2020
+++ src/tests/sbin/envstat/t_envstat.sh	Thu Jun 25 15:01:35 2020
@@ -0,0 +1,67 @@
+# $NetBSD: t_envstat.sh,v 1.1 2020/06/25 15:01:35 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 N

CVS commit: src

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 14:24:46 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile
Added Files:
src/tests/sbin/ifconfig: t_tap.sh

Log Message:
Add test cases for PR kern/53546 and PR kern/55417. Both are skipped as
both reproduce panics.


To generate a diff of this commit:
cvs rdiff -u -r1.848 -r1.849 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/ifconfig/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_tap.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.848 src/distrib/sets/lists/tests/mi:1.849
--- src/distrib/sets/lists/tests/mi:1.848	Wed Jun 24 10:05:07 2020
+++ src/distrib/sets/lists/tests/mi	Thu Jun 25 14:24:45 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.848 2020/06/24 10:05:07 jruoho Exp $
+# $NetBSD: mi,v 1.849 2020/06/25 14:24:45 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3991,6 +3991,7 @@
 ./usr/tests/sbin/ifconfig/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
 ./usr/tests/sbin/ifconfig/t_nonexistent		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_tap			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfstests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfs/Atffile			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfs/Kyuafile			tests-sbin-tests	compattestfile,atf,kyua

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.2 src/tests/sbin/ifconfig/Makefile:1.3
--- src/tests/sbin/ifconfig/Makefile:1.2	Wed Jun 24 09:11:26 2020
+++ src/tests/sbin/ifconfig/Makefile	Thu Jun 25 14:24:46 2020
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.2 2020/06/24 09:11:26 jruoho Exp $
+# $NetBSD: Makefile,v 1.3 2020/06/25 14:24:46 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin/ifconfig
 
-TESTS_SH=	t_nonexistent t_repeated_scan
+TESTS_SH=	t_nonexistent t_repeated_scan t_tap
 
 .include 

Added files:

Index: src/tests/sbin/ifconfig/t_tap.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_tap.sh:1.1
--- /dev/null	Thu Jun 25 14:24:46 2020
+++ src/tests/sbin/ifconfig/t_tap.sh	Thu Jun 25 14:24:46 2020
@@ -0,0 +1,101 @@
+# $NetBSD: t_tap.sh,v 1.1 2020/06/25 14:24:46 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.
+#
+taps="/tmp/taps"
+
+atf_test_case manytaps cleanup
+manytaps_head() {
+	atf_set "require.user" "root"
+	atf_set "descr" "Test creating many, many tap(4)'s (PR kern/55417)"
+}
+
+manytaps_body() {
+
+	atf_skip "The test causes a panic (PR kern/55417)"
+	seq 65535 64000 > $taps
+
+	while read tap; do
+
+		ifconfig "tap$tap"
+
+		if [ $? -eq 0 ]; then
+			echo "Skipping existing tap$tap"
+			continue
+		fi
+
+		ifconfig "tap$tap" create
+		echo "Created $tap"
+
+	done < $taps
+}
+
+manytaps_cleanup() {
+
+	if [ -f $taps ]; then
+
+		while read tap; do
+
+			ifconfig "tap$tap"
+
+			if [ $? -eq 0 ]; then
+ifconfig "tap$tap" destroy
+echo "Destroyed tap$tap"
+			fi
+
+		done < $taps
+
+		rm $taps
+	fi
+}
+
+atf_test_case overflow cleanup
+overflow_head() {
+	atf_set "require.user" "root"
+	atf_set "

CVS commit: src/tests/sbin/ifconfig

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 11:26:05 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_repeated_scan.sh

Log Message:
Reference also PR kern/53860.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/ifconfig/t_repeated_scan.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_repeated_scan.sh
diff -u src/tests/sbin/ifconfig/t_repeated_scan.sh:1.3 src/tests/sbin/ifconfig/t_repeated_scan.sh:1.4
--- src/tests/sbin/ifconfig/t_repeated_scan.sh:1.3	Thu Jun 25 10:34:34 2020
+++ src/tests/sbin/ifconfig/t_repeated_scan.sh	Thu Jun 25 11:26:05 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_scan.sh,v 1.3 2020/06/25 10:34:34 jruoho Exp $
+# $NetBSD: t_repeated_scan.sh,v 1.4 2020/06/25 11:26:05 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,7 +31,7 @@ atf_test_case repeated_scan
 repeated_scan_head() {
 	atf_set "require.user" "root"
 	atf_set "descr" "Test with ifconfig(8) that repeated 802.11 " \
-		"scanning does not cause a panic (PR kern/55389)"
+		"scanning does not panic (PR kern/53860; PR kern/55389)"
 }
 
 repeated_scan_body() {



CVS commit: src/tests

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 11:12:03 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_kevent.c
src/tests/lib/libm: t_hypot.c
src/tests/usr.bin/gdb: t_regress.sh
src/tests/usr.bin/vmstat: t_vmstat.sh
src/tests/usr.bin/xlint/lint1: d_long_double_int.c t_integration.sh

Log Message:
Reference PRs consistently.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_kevent.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libm/t_hypot.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/gdb/t_regress.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/vmstat/t_vmstat.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/d_long_double_int.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/t_integration.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_kevent.c
diff -u src/tests/lib/libc/sys/t_kevent.c:1.7 src/tests/lib/libc/sys/t_kevent.c:1.8
--- src/tests/lib/libc/sys/t_kevent.c:1.7	Thu Feb  5 13:55:37 2015
+++ src/tests/lib/libc/sys/t_kevent.c	Thu Jun 25 11:12:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_kevent.c,v 1.7 2015/02/05 13:55:37 isaki Exp $ */
+/*	$NetBSD: t_kevent.c,v 1.8 2020/06/25 11:12:03 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_kevent.c,v 1.7 2015/02/05 13:55:37 isaki Exp $");
+__RCSID("$NetBSD: t_kevent.c,v 1.8 2020/06/25 11:12:03 jruoho Exp $");
 
 #include 
 #include 
@@ -85,7 +85,7 @@ ATF_TC_BODY(kqueue_desc_passing, tc)
 
 	ATF_REQUIRE((kq = kqueue()) != -1);
 
-	// atf_tc_skip("crashes kernel (PR 46463)");
+	// atf_tc_skip("crashes kernel (PR kern/46463)");
 
 	ATF_REQUIRE(socketpair(AF_LOCAL, SOCK_STREAM, 0, s) != -1);
 	msg = malloc(CMSG_SPACE(sizeof(int)));

Index: src/tests/lib/libm/t_hypot.c
diff -u src/tests/lib/libm/t_hypot.c:1.1 src/tests/lib/libm/t_hypot.c:1.2
--- src/tests/lib/libm/t_hypot.c:1.1	Sun Jan 24 20:26:47 2016
+++ src/tests/lib/libm/t_hypot.c	Thu Jun 25 11:12:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_hypot.c,v 1.1 2016/01/24 20:26:47 gson Exp $ */
+/* $NetBSD: t_hypot.c,v 1.2 2020/06/25 11:12:03 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@ ATF_TC_BODY(hypotf_integer, tc)
 ATF_TC(pr50698);
 ATF_TC_HEAD(pr50698, tc)
 {
-	atf_tc_set_md_var(tc, "descr", "Check for the bug of PR 50698");
+	atf_tc_set_md_var(tc, "descr", "Check for the bug of PR lib/50698");
 }
 
 ATF_TC_BODY(pr50698, tc)

Index: src/tests/usr.bin/gdb/t_regress.sh
diff -u src/tests/usr.bin/gdb/t_regress.sh:1.2 src/tests/usr.bin/gdb/t_regress.sh:1.3
--- src/tests/usr.bin/gdb/t_regress.sh:1.2	Fri Jun  7 19:05:15 2019
+++ src/tests/usr.bin/gdb/t_regress.sh	Thu Jun 25 11:12:03 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_regress.sh,v 1.2 2019/06/07 19:05:15 gson Exp $
+# $NetBSD: t_regress.sh,v 1.3 2020/06/25 11:12:03 jruoho Exp $
 #
 # Copyright (c) 2016 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,11 +27,10 @@
 
 # Regression tests for some GDB PRs
 
-# PR 47430
-
 atf_test_case threads
 threads_head() {
-	atf_set "descr" "Test that gdb works with threaded programs"
+	atf_set "descr" "Test that gdb works with " \
+		"threaded programs (PR bin/47430)"
 	atf_set "require.progs" "gdb"
 }
 threads_body() {
@@ -50,11 +49,10 @@ EOF
 	atf_check -s exit:1 -o ignore -e ignore grep "Program received signal SIGTRAP" gdb.out
 }
 
-# PR 48250
-
 atf_test_case pie
 pie_head() {
-	atf_set "descr" "Test that gdb works with PIE executables"
+	atf_set "descr" "Test that gdb works with " \
+		"PIE executables (PR bin/48250)"
 	atf_set "require.progs" "cc gdb"
 }
 pie_body() {
@@ -71,11 +69,10 @@ EOF
 	atf_check -s exit:1 -o ignore -e ignore grep "annot access memory" gdb.out
 }
 
-# PR 54154
-
 atf_test_case xml
 xml_head() {
-	atf_set "descr" "Test that gdb was built with XML support"
+	atf_set "descr" "Test that gdb was built " \
+		"with XML support (PR bin/54154)"
 	atf_set "require.progs" "gdb"
 }
 xml_body() {

Index: src/tests/usr.bin/vmstat/t_vmstat.sh
diff -u src/tests/usr.bin/vmstat/t_vmstat.sh:1.1 src/tests/usr.bin/vmstat/t_vmstat.sh:1.2
--- src/tests/usr.bin/vmstat/t_vmstat.sh:1.1	Tue Jan  7 16:47:13 2014
+++ src/tests/usr.bin/vmstat/t_vmstat.sh	Thu Jun 25 11:12:03 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_vmstat.sh,v 1.1 2014/01/07 16:47:13 gson Exp $
+# $NetBSD: t_vmstat.sh,v 1.2 2020/06/25 11:12:03 jruoho Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,7 +27,8 @@
 
 atf_test_case default
 default_head() {
-	atf_set "descr" "Test that vmstat(1) returns success when run with no arguments"
+	atf_set "descr" "Test that vmstat(1) returns " \
+		"success when run with no arguments"
 }
 default_body() {
 	atf_check -s exit:0 -o ignore -e empty vmstat
@@ -35,7 +36,8 @@ default_body() {
 
 atf_test_case opt_s
 

CVS commit: src/tests/sbin/ifconfig

2020-06-25 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jun 25 10:34:34 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_repeated_scan.sh

Log Message:
Require root privileges.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/sbin/ifconfig/t_repeated_scan.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_repeated_scan.sh
diff -u src/tests/sbin/ifconfig/t_repeated_scan.sh:1.2 src/tests/sbin/ifconfig/t_repeated_scan.sh:1.3
--- src/tests/sbin/ifconfig/t_repeated_scan.sh:1.2	Wed Jun 24 10:07:13 2020
+++ src/tests/sbin/ifconfig/t_repeated_scan.sh	Thu Jun 25 10:34:34 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_scan.sh,v 1.2 2020/06/24 10:07:13 jruoho Exp $
+# $NetBSD: t_repeated_scan.sh,v 1.3 2020/06/25 10:34:34 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -29,6 +29,7 @@
 
 atf_test_case repeated_scan
 repeated_scan_head() {
+	atf_set "require.user" "root"
 	atf_set "descr" "Test with ifconfig(8) that repeated 802.11 " \
 		"scanning does not cause a panic (PR kern/55389)"
 }



CVS commit: src/tests

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 12:31:26 UTC 2020

Modified Files:
src/tests/usr.bin: Makefile
src/tests/usr.sbin: Makefile

Log Message:
Also install new tests.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/usr.bin/Makefile
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.sbin/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.30 src/tests/usr.bin/Makefile:1.31
--- src/tests/usr.bin/Makefile:1.30	Fri Jan 17 16:25:37 2020
+++ src/tests/usr.bin/Makefile	Wed Jun 24 12:31:26 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2020/01/17 16:25:37 christos Exp $
+#	$NetBSD: Makefile,v 1.31 2020/06/24 12:31:26 jruoho Exp $
 #
 
 .include 
@@ -6,9 +6,9 @@
 TESTSDIR=   ${TESTSBASE}/usr.bin
 
 TESTS_SUBDIRS=	awk basename bzip2 cc cmp config cpio cut \
-		diff dirname find gdb grep gzip id indent \
+		diff dirname find fstat gdb grep gzip id indent \
 		infocmp jot ld m4 make mixerctl mkdep nbperf netpgpverify \
-		pkill pr printf pwhash rump_server shmif_dumpbus sdiff \
+		patch pkill pr printf pwhash rump_server shmif_dumpbus sdiff \
 		sed sort tar tmux tr unifdef uniq vmstat xlint
 
 .if ${MKCXX} != "no"

Index: src/tests/usr.sbin/Makefile
diff -u src/tests/usr.sbin/Makefile:1.4 src/tests/usr.sbin/Makefile:1.5
--- src/tests/usr.sbin/Makefile:1.4	Thu Apr 19 18:51:35 2012
+++ src/tests/usr.sbin/Makefile	Wed Jun 24 12:31:26 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2012/04/19 18:51:35 jruoho Exp $
+# $NetBSD: Makefile,v 1.5 2020/06/24 12:31:26 jruoho Exp $
 .include 
 
 TESTSDIR=   ${TESTSBASE}/usr.sbin
 
-TESTS_SUBDIRS+= mtree tcpdump traceroute useradd
+TESTS_SUBDIRS+= cpuctl mtree stdethers stdhosts tcpdump traceroute useradd
 
 .include 



CVS commit: src/share/man/man5

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 10:30:43 UTC 2020

Modified Files:
src/share/man/man5: rc.conf.5

Log Message:
As bin/55344 was fixed, note the flags also in rc.conf(5).


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/share/man/man5/rc.conf.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.181 src/share/man/man5/rc.conf.5:1.182
--- src/share/man/man5/rc.conf.5:1.181	Mon Jun  3 06:04:20 2019
+++ src/share/man/man5/rc.conf.5	Wed Jun 24 10:30:43 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.181 2019/06/03 06:04:20 msaitoh Exp $
+.\"	$NetBSD: rc.conf.5,v 1.182 2020/06/24 10:30:43 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -55,7 +55,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd June 3, 2019
+.Dd June 24, 2020
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -899,6 +899,8 @@ Boolean value.
 Runs
 .Xr npfd 8 ,
 the NPF packet filter logging and state synchronization daemon.
+Passes
+.Sy npfd_flags .
 .It Sy net_interfaces
 A string.
 The list of network interfaces to be configured at boot time.



CVS commit: src/tests

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 10:07:13 UTC 2020

Modified Files:
src/tests/sbin/ifconfig: t_repeated_scan.sh
src/tests/usr.sbin/cpuctl: t_cpuctl.sh

Log Message:
Fix references in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/ifconfig/t_repeated_scan.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/cpuctl/t_cpuctl.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/sbin/ifconfig/t_repeated_scan.sh
diff -u src/tests/sbin/ifconfig/t_repeated_scan.sh:1.1 src/tests/sbin/ifconfig/t_repeated_scan.sh:1.2
--- src/tests/sbin/ifconfig/t_repeated_scan.sh:1.1	Wed Jun 24 09:11:26 2020
+++ src/tests/sbin/ifconfig/t_repeated_scan.sh	Wed Jun 24 10:07:13 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_repeated_scan.sh,v 1.1 2020/06/24 09:11:26 jruoho Exp $
+# $NetBSD: t_repeated_scan.sh,v 1.2 2020/06/24 10:07:13 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,7 +30,7 @@
 atf_test_case repeated_scan
 repeated_scan_head() {
 	atf_set "descr" "Test with ifconfig(8) that repeated 802.11 " \
-		"scanning does not cause a panic (PR bin/55389)"
+		"scanning does not cause a panic (PR kern/55389)"
 }
 
 repeated_scan_body() {

Index: src/tests/usr.sbin/cpuctl/t_cpuctl.sh
diff -u src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.1 src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.2
--- src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.1	Wed Jun 24 09:32:41 2020
+++ src/tests/usr.sbin/cpuctl/t_cpuctl.sh	Wed Jun 24 10:07:13 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_cpuctl.sh,v 1.1 2020/06/24 09:32:41 jruoho Exp $
+# $NetBSD: t_cpuctl.sh,v 1.2 2020/06/24 10:07:13 jruoho Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -176,7 +176,7 @@ offline_body() {
 	setcpu "offline" atf_fail "error in setting a CPU offline"
 
 	# Additional check that the boot processor cannot be
-	# set offline, as noted in the cpuctl(9) manual page.
+	# set offline, as noted in the cpuctl(8) manual page.
 	#
 	cpuctl offline 0 >/dev/null 2>&1
 



CVS commit: src

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 10:05:08 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
Added Files:
src/tests/usr.bin/fstat: Makefile t_fstat.sh

Log Message:
Check that fstat(1) works (cf. PR kern/55407).


To generate a diff of this commit:
cvs rdiff -u -r1.847 -r1.848 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.165 -r1.166 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/fstat/Makefile \
src/tests/usr.bin/fstat/t_fstat.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.847 src/distrib/sets/lists/tests/mi:1.848
--- src/distrib/sets/lists/tests/mi:1.847	Wed Jun 24 09:47:17 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jun 24 10:05:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.847 2020/06/24 09:47:17 jruoho Exp $
+# $NetBSD: mi,v 1.848 2020/06/24 10:05:07 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4307,6 +4307,10 @@
 ./usr/tests/usr.bin/find/Atffile		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/find/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua
 ./usr/tests/usr.bin/find/t_find			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/fstat			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/fstat/Atffile		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/fstat/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua
+./usr/tests/usr.bin/fstat/t_fstat		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/gdbtests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/gdb/Atffile			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/gdb/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.165 src/etc/mtree/NetBSD.dist.tests:1.166
--- src/etc/mtree/NetBSD.dist.tests:1.165	Wed Jun 24 09:47:18 2020
+++ src/etc/mtree/NetBSD.dist.tests	Wed Jun 24 10:05:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.165 2020/06/24 09:47:18 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.166 2020/06/24 10:05:07 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -407,6 +407,7 @@
 ./usr/tests/usr.bin/diff
 ./usr/tests/usr.bin/dirname
 ./usr/tests/usr.bin/find
+./usr/tests/usr.bin/fstat
 ./usr/tests/usr.bin/gdb
 ./usr/tests/usr.bin/grep
 ./usr/tests/usr.bin/gzip

Added files:

Index: src/tests/usr.bin/fstat/Makefile
diff -u /dev/null src/tests/usr.bin/fstat/Makefile:1.1
--- /dev/null	Wed Jun 24 10:05:08 2020
+++ src/tests/usr.bin/fstat/Makefile	Wed Jun 24 10:05:07 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/06/24 10:05:07 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.bin/fstat
+TESTS_SH=	t_fstat
+
+.include 
Index: src/tests/usr.bin/fstat/t_fstat.sh
diff -u /dev/null src/tests/usr.bin/fstat/t_fstat.sh:1.1
--- /dev/null	Wed Jun 24 10:05:08 2020
+++ src/tests/usr.bin/fstat/t_fstat.sh	Wed Jun 24 10:05:07 2020
@@ -0,0 +1,75 @@
+# $NetBSD: t_fstat.sh,v 1.1 2020/06/24 10:05:07 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.
+#
+
+atf_test_case basic
+basic_head()
+{
+	atf_require_prog fstat
+	atf_set "descr" "Check that fstat(1) works"
+}
+
+basic_body()
+{
+	# If there are chrooted processes running, the following
+	# simple test should

CVS commit: src

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 09:47:18 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
Added Files:
src/tests/usr.sbin/stdethers: Makefile d_valid.in t_stdethers.sh
src/tests/usr.sbin/stdhosts: Makefile d_ipv6.in t_stdhosts.sh

Log Message:
Add a few checks for stdethers(8) and stdhosts(8).


To generate a diff of this commit:
cvs rdiff -u -r1.846 -r1.847 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.164 -r1.165 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/stdethers/Makefile \
src/tests/usr.sbin/stdethers/d_valid.in \
src/tests/usr.sbin/stdethers/t_stdethers.sh
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/stdhosts/Makefile \
src/tests/usr.sbin/stdhosts/d_ipv6.in \
src/tests/usr.sbin/stdhosts/t_stdhosts.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.846 src/distrib/sets/lists/tests/mi:1.847
--- src/distrib/sets/lists/tests/mi:1.846	Wed Jun 24 09:32:41 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jun 24 09:47:17 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.846 2020/06/24 09:32:41 jruoho Exp $
+# $NetBSD: mi,v 1.847 2020/06/24 09:47:17 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4772,6 +4772,16 @@
 ./usr/tests/usr.sbin/mtree/mtree_d_create.out	tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/mtree/netbsd6_d_create.out	tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/mtree/t_mtree		tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdethers			tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdethers/Atffile		tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdethers/Kyuafile		tests-usr.sbin-tests	compattestfile,atf,kyua
+./usr/tests/usr.sbin/stdethers/d_valid.in	tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdethers/t_stdethers	tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdhosts			tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdhosts/Atffile		tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdhosts/Kyuafile		tests-usr.sbin-tests	compattestfile,atf,kyua
+./usr/tests/usr.sbin/stdhosts/d_ipv6.in		tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/stdhosts/t_stdhosts	tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/tcpdump			tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/tcpdump/Atffile		tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/tcpdump/Kyuafile		tests-usr.sbin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.164 src/etc/mtree/NetBSD.dist.tests:1.165
--- src/etc/mtree/NetBSD.dist.tests:1.164	Wed Jun 24 09:32:41 2020
+++ src/etc/mtree/NetBSD.dist.tests	Wed Jun 24 09:47:18 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.164 2020/06/24 09:32:41 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.165 2020/06/24 09:47:18 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -443,6 +443,8 @@
 ./usr/tests/usr.sbin
 ./usr/tests/usr.sbin/cpuctl
 ./usr/tests/usr.sbin/mtree
+./usr/tests/usr.sbin/stdethers
+./usr/tests/usr.sbin/stdhosts
 ./usr/tests/usr.sbin/tcpdump
 ./usr/tests/usr.sbin/traceroute
 ./usr/tests/usr.sbin/useradd

Added files:

Index: src/tests/usr.sbin/stdethers/Makefile
diff -u /dev/null src/tests/usr.sbin/stdethers/Makefile:1.1
--- /dev/null	Wed Jun 24 09:47:18 2020
+++ src/tests/usr.sbin/stdethers/Makefile	Wed Jun 24 09:47:18 2020
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2020/06/24 09:47:18 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.sbin/t_stdethers
+
+TESTS_SH=	t_stdethers
+
+.include 
Index: src/tests/usr.sbin/stdethers/d_valid.in
diff -u /dev/null src/tests/usr.sbin/stdethers/d_valid.in:1.1
--- /dev/null	Wed Jun 24 09:47:18 2020
+++ src/tests/usr.sbin/stdethers/d_valid.in	Wed Jun 24 09:47:18 2020
@@ -0,0 +1,7 @@
+00:00:00:00:00:00	a
+01:00:00:00:00:00	b
+00:01:00:00:00:00	c
+00:00:01:00:00:00	d
+00:00:00:01:00:00	e
+00:00:00:00:01:00	f
+00:00:00:00:00:01	g
Index: src/tests/usr.sbin/stdethers/t_stdethers.sh
diff -u /dev/null src/tests/usr.sbin/stdethers/t_stdethers.sh:1.1
--- /dev/null	Wed Jun 24 09:47:18 2020
+++ src/tests/usr.sbin/stdethers/t_stdethers.sh	Wed Jun 24 09:47:18 2020
@@ -0,0 +1,87 @@
+# $NetBSD: t_stdethers.sh,v 1.1 2020/06/24 09:47:18 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 m

CVS commit: src

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 09:32:41 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
Added Files:
src/tests/usr.sbin/cpuctl: Makefile t_cpuctl.sh

Log Message:
Add few basic tests for cpuctl(8). These cover PR kern/45117 and PR bin/54220.
Though, the former is not explicitly tested as it hangs the system.


To generate a diff of this commit:
cvs rdiff -u -r1.845 -r1.846 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.163 -r1.164 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/cpuctl/Makefile \
src/tests/usr.sbin/cpuctl/t_cpuctl.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.845 src/distrib/sets/lists/tests/mi:1.846
--- src/distrib/sets/lists/tests/mi:1.845	Wed Jun 24 09:21:43 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jun 24 09:32:41 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.845 2020/06/24 09:21:43 jruoho Exp $
+# $NetBSD: mi,v 1.846 2020/06/24 09:32:41 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4753,6 +4753,10 @@
 ./usr/tests/usr.sbintests-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
+./usr/tests/usr.sbin/cpuctl			tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/cpuctl/Atffile		tests-usr.sbin-tests	compattestfile,atf
+./usr/tests/usr.sbin/cpuctl/Kyuafile		tests-usr.sbin-tests	compattestfile,atf,kyua
+./usr/tests/usr.sbin/cpuctl/t_cpuctl		tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/mtree			tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/mtree/Atffile		tests-usr.sbin-tests	compattestfile,atf
 ./usr/tests/usr.sbin/mtree/Kyuafile		tests-usr.sbin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.163 src/etc/mtree/NetBSD.dist.tests:1.164
--- src/etc/mtree/NetBSD.dist.tests:1.163	Wed Jun 24 09:21:43 2020
+++ src/etc/mtree/NetBSD.dist.tests	Wed Jun 24 09:32:41 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.163 2020/06/24 09:21:43 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.164 2020/06/24 09:32:41 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -441,6 +441,7 @@
 ./usr/tests/usr.bin/xlint
 ./usr/tests/usr.bin/xlint/lint1
 ./usr/tests/usr.sbin
+./usr/tests/usr.sbin/cpuctl
 ./usr/tests/usr.sbin/mtree
 ./usr/tests/usr.sbin/tcpdump
 ./usr/tests/usr.sbin/traceroute

Added files:

Index: src/tests/usr.sbin/cpuctl/Makefile
diff -u /dev/null src/tests/usr.sbin/cpuctl/Makefile:1.1
--- /dev/null	Wed Jun 24 09:32:41 2020
+++ src/tests/usr.sbin/cpuctl/Makefile	Wed Jun 24 09:32:41 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/06/24 09:32:41 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.sbin/cpuctl
+TESTS_SH=	t_cpuctl
+
+.include 
Index: src/tests/usr.sbin/cpuctl/t_cpuctl.sh
diff -u /dev/null src/tests/usr.sbin/cpuctl/t_cpuctl.sh:1.1
--- /dev/null	Wed Jun 24 09:32:41 2020
+++ src/tests/usr.sbin/cpuctl/t_cpuctl.sh	Wed Jun 24 09:32:41 2020
@@ -0,0 +1,240 @@
+# $NetBSD: t_cpuctl.sh,v 1.1 2020/06/24 09:32:41 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/cpuctl.txt"
+
+setcpu() {
+
+	ncpu=$(sysctl -n hw.ncpu)

CVS commit: src

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 09:21:43 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
Added Files:
src/tests/usr.bin/patch: Makefile t_patch.sh

Log Message:
Add a test case for bin/54620.


To generate a diff of this commit:
cvs rdiff -u -r1.844 -r1.845 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.162 -r1.163 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/patch/Makefile \
src/tests/usr.bin/patch/t_patch.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.844 src/distrib/sets/lists/tests/mi:1.845
--- src/distrib/sets/lists/tests/mi:1.844	Wed Jun 24 09:11:26 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jun 24 09:21:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.844 2020/06/24 09:11:26 jruoho Exp $
+# $NetBSD: mi,v 1.845 2020/06/24 09:21:43 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4562,6 +4562,10 @@
 ./usr/tests/usr.bin/netpgpverify/Atffile		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/netpgpverify/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua
 ./usr/tests/usr.bin/netpgpverify/t_netpgpverify		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/patch			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/patch/Atffile		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/patch/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua
+./usr/tests/usr.bin/patch/t_patch		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/pkill			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/pkill/Atffile		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/pkill/Kyuafile		tests-usr.bin-tests	compattestfile,atf,kyua

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.162 src/etc/mtree/NetBSD.dist.tests:1.163
--- src/etc/mtree/NetBSD.dist.tests:1.162	Sun Apr 19 13:22:58 2020
+++ src/etc/mtree/NetBSD.dist.tests	Wed Jun 24 09:21:43 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.162 2020/04/19 13:22:58 maxv Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.163 2020/06/24 09:21:43 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -422,6 +422,7 @@
 ./usr/tests/usr.bin/mkdep
 ./usr/tests/usr.bin/nbperf
 ./usr/tests/usr.bin/netpgpverify
+./usr/tests/usr.bin/patch
 ./usr/tests/usr.bin/pkill
 ./usr/tests/usr.bin/pr
 ./usr/tests/usr.bin/printf

Added files:

Index: src/tests/usr.bin/patch/Makefile
diff -u /dev/null src/tests/usr.bin/patch/Makefile:1.1
--- /dev/null	Wed Jun 24 09:21:43 2020
+++ src/tests/usr.bin/patch/Makefile	Wed Jun 24 09:21:43 2020
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2020/06/24 09:21:43 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.bin/patch
+TESTS_SH=	t_patch
+
+.include 
Index: src/tests/usr.bin/patch/t_patch.sh
diff -u /dev/null src/tests/usr.bin/patch/t_patch.sh:1.1
--- /dev/null	Wed Jun 24 09:21:43 2020
+++ src/tests/usr.bin/patch/t_patch.sh	Wed Jun 24 09:21:43 2020
@@ -0,0 +1,78 @@
+# $NetBSD: t_patch.sh,v 1.1 2020/06/24 09:21:43 jruoho Exp $
+#
+# Copyright (c) 2020 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# 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.
+#
+
+patch_lines() {
+
+	printf "%$1s" | tr " " "a" > longlines 2>/dev/null
+
+	cat << EOF > longlines.patch
+--- ./longlines.orig 2019-10-16 09:25:30.667656644 +
 ./longlines
+@@ -1 +1 @@
+EOF
+	printf -- "-%$1s\n" | tr " " "a" >> longlines.patch 2>/dev/null
+	printf -- "+%$1s" | tr " " "b" >> longlines.patch 

CVS commit: src

2020-06-24 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun 24 09:11:26 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/sbin/ifconfig: Makefile
Added Files:
src/tests/sbin/ifconfig: t_repeated_scan.sh

Log Message:
Add a test case for PR bin/55389.


To generate a diff of this commit:
cvs rdiff -u -r1.843 -r1.844 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/ifconfig/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/ifconfig/t_repeated_scan.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.843 src/distrib/sets/lists/tests/mi:1.844
--- src/distrib/sets/lists/tests/mi:1.843	Fri Jun 12 11:04:44 2020
+++ src/distrib/sets/lists/tests/mi	Wed Jun 24 09:11:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.843 2020/06/12 11:04:44 roy Exp $
+# $NetBSD: mi,v 1.844 2020/06/24 09:11:26 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3990,6 +3990,7 @@
 ./usr/tests/sbin/ifconfig/Atffile		tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/ifconfig/Kyuafile		tests-sbin-tests	compattestfile,atf,kyua
 ./usr/tests/sbin/ifconfig/t_nonexistent		tests-sbin-tests	compattestfile,atf
+./usr/tests/sbin/ifconfig/t_repeated_scan	tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfstests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfs/Atffile			tests-sbin-tests	compattestfile,atf
 ./usr/tests/sbin/newfs/Kyuafile			tests-sbin-tests	compattestfile,atf,kyua

Index: src/tests/sbin/ifconfig/Makefile
diff -u src/tests/sbin/ifconfig/Makefile:1.1 src/tests/sbin/ifconfig/Makefile:1.2
--- src/tests/sbin/ifconfig/Makefile:1.1	Tue May  3 06:13:06 2011
+++ src/tests/sbin/ifconfig/Makefile	Wed Jun 24 09:11:26 2020
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2011/05/03 06:13:06 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2020/06/24 09:11:26 jruoho Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin/ifconfig
 
-TESTS_SH=	t_nonexistent
+TESTS_SH=	t_nonexistent t_repeated_scan
 
 .include 

Added files:

Index: src/tests/sbin/ifconfig/t_repeated_scan.sh
diff -u /dev/null src/tests/sbin/ifconfig/t_repeated_scan.sh:1.1
--- /dev/null	Wed Jun 24 09:11:26 2020
+++ src/tests/sbin/ifconfig/t_repeated_scan.sh	Wed Jun 24 09:11:26 2020
@@ -0,0 +1,87 @@
+# $NetBSD: t_repeated_scan.sh,v 1.1 2020/06/24 09:11:26 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.
+
+atf_test_case repeated_scan
+repeated_scan_head() {
+	atf_set "descr" "Test with ifconfig(8) that repeated 802.11 " \
+		"scanning does not cause a panic (PR bin/55389)"
+}
+
+repeated_scan_body() {
+
+	# Even though this should amount to a "few minutes",
+	# try to still avoid stalling any automated test runs.
+	#
+	n=15
+
+	pkill -9 hostapd
+	pkill -9 wpa_supplicant
+
+	for i in $(ifconfig -l); do
+
+		state="up"
+		ifconfig -s $i
+
+		if [ $? -eq 1 ]; then
+
+			state="down"
+			ifconfig $i up
+
+			if [ ! $? -eq 0 ]; then
+echo "Failed to set $i up"
+continue
+			fi
+		fi
+
+		sleep 1
+		ifconfig $i list scan >/dev/null 2>&1
+
+		if [ ! $? -eq 0 ]; then
+			echo "Skipping $i; scan not supported"
+			continue
+		fi
+
+		while [ $n -gt 0 ]; do
+			echo "Test $n for $i"
+			ifconfig $i list scan >/dev/null 2>&1
+			n=$(expr $n - 1)
+		done
+
+		ifconfig $i $state
+		echo

CVS commit: src/share/man/man9

2014-03-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 12 16:37:01 UTC 2014

Modified Files:
src/share/man/man9: SET.9

Log Message:
Fix a prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/SET.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/SET.9
diff -u src/share/man/man9/SET.9:1.2 src/share/man/man9/SET.9:1.3
--- src/share/man/man9/SET.9:1.2	Tue Apr 13 08:24:31 2010
+++ src/share/man/man9/SET.9	Wed Mar 12 16:37:01 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: SET.9,v 1.2 2010/04/13 08:24:31 jruoho Exp $
+.\ $NetBSD: SET.9,v 1.3 2014/03/12 16:37:01 jruoho Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd April 13, 2010
+.Dd March 12, 2014
 .Dt SET 9
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .In sys/types.h
 .Ft void
 .Fn SET val x
-.Ft void
+.Ft int
 .Fn ISSET val x
 .Ft void
 .Fn CLR val x



CVS commit: src/sys/dev/acpi

2013-11-20 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Nov 20 13:39:59 UTC 2013

Modified Files:
src/sys/dev/acpi: acpi_cpu_tstate.c

Log Message:
As discussed with bouyer@, fix a too eager T-state validation check to
accomodate new Intel CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/acpi/acpi_cpu_tstate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi_cpu_tstate.c
diff -u src/sys/dev/acpi/acpi_cpu_tstate.c:1.31 src/sys/dev/acpi/acpi_cpu_tstate.c:1.32
--- src/sys/dev/acpi/acpi_cpu_tstate.c:1.31	Fri Apr 27 04:38:24 2012
+++ src/sys/dev/acpi/acpi_cpu_tstate.c	Wed Nov 20 13:39:59 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.31 2012/04/27 04:38:24 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.32 2013/11/20 13:39:59 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_tstate.c,v 1.31 2012/04/27 04:38:24 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_tstate.c,v 1.32 2013/11/20 13:39:59 jruoho Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -329,9 +329,14 @@ acpicpu_tstate_tss_add(struct acpicpu_ts
 		*p = val[i];
 
 	/*
-	 * The minimum should be around 100 / 8 = 12.5 %.
+	 * The minimum should be either 12.5 % or 6.5 %,
+	 * the latter 4-bit dynamic range being available
+	 * in some newer models; see Section 14.5.3.1 in
+	 *
+	 *	Intel 64 and IA-32 Architectures Software
+	 *	Developer's Manual. Volume 3B, Part 2. 2013.
 	 */
-if (ts-ts_percent  10 || ts-ts_percent  100)
+if (ts-ts_percent  6 || ts-ts_percent  100)
 		return AE_BAD_DECIMAL_CONSTANT;
 
 	if (ts-ts_latency == 0 || ts-ts_latency  1000)



CVS commit: src/sys/arch/x86/acpi

2013-11-20 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Nov 20 13:52:30 UTC 2013

Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c

Log Message:
Allow 4-bit range for MSR_THERM_CONTROL.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/x86/acpi/acpi_cpu_md.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.73 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.74
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.73	Fri Nov 15 08:47:55 2013
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Wed Nov 20 13:52:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.73 2013/11/15 08:47:55 msaitoh Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.74 2013/11/20 13:52:30 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.c,v 1.73 2013/11/15 08:47:55 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.c,v 1.74 2013/11/20 13:52:30 jruoho Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -986,7 +986,7 @@ acpicpu_md_tstate_set(struct acpicpu_tst
 	uint8_t i;
 
 	val = ts-ts_control;
-	val = val  __BITS(1, 4);
+	val = val  __BITS(0, 4);
 
 	wrmsr(MSR_THERM_CONTROL, val);
 



CVS commit: src/share/man/man9/man9.x86

2013-11-20 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Nov 20 18:13:16 UTC 2013

Modified Files:
src/share/man/man9/man9.x86: tsc.9

Log Message:
Don't be so pessimistic.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/man9.x86/tsc.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/man9.x86/tsc.9
diff -u src/share/man/man9/man9.x86/tsc.9:1.4 src/share/man/man9/man9.x86/tsc.9:1.5
--- src/share/man/man9/man9.x86/tsc.9:1.4	Tue Oct 25 05:41:35 2011
+++ src/share/man/man9/man9.x86/tsc.9	Wed Nov 20 18:13:16 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: tsc.9,v 1.4 2011/10/25 05:41:35 jruoho Exp $
+.\ $NetBSD: tsc.9,v 1.5 2013/11/20 18:13:16 jruoho Exp $
 .\
 .\ Copyright (c) 2011 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd October 25, 2011
+.Dd November 20, 2013
 .Dt TSC 9 x86
 .Os
 .Sh NAME
@@ -59,32 +59,25 @@ register has been present since the orig
 .Pp
 Already because of the access method,
 .Tn TSC
-has traditionally provided a low-overhead and high-resolution
+provides a low-overhead and high-resolution
 way to obtain
 .Tn CPU
 timing information.
-Recently, however, this reliability has been undermined by
-such factors as system sleep states,
+This traditional premise was violated when such factors as
+system sleep states,
 .Tn CPU
 .Dq hotplugging ,
 .Dq hibernation ,
 and
 .Tn CPU
-frequency scaling.
-.Pp
-These potential new sources of unreliability are easily understandable
-when one recalls that the counter measures cycles and not
-.Dq time .
-Comparing the cycle counts only makes sense when the clock frequency
-is stable; to convert the cycle counts to time units, a general equation
-would be:
-.Dq seconds = cycles / frequency in Hz .
-The use of
-.Tn TSC
-as a source of high-resolution timing can be thus discouraged.
-But the basic premise is still guaranteed:
-.Tn TSC
-is a monotonically increasing counter.
+frequency scaling
+were introduced to the x86 lineage.
+This was however mainly a short abruption:
+in many new x86
+.Tn CPUs
+the time stamp counter is again invariant with
+respect to the stability of the clock frequency.
+Care should be however taken in implementations that rely on this assumption.
 .Sh FUNCTIONS
 .Bl -tag -width abcd
 .It Fn rdtsc 



CVS commit: src/sys/arch/x86/acpi

2012-12-05 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Dec  6 04:43:29 UTC 2012

Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c

Log Message:
Disable C1E also on K8, if present. From Imre Vadasz i...@vdsz.com
in PR install/47224.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/x86/acpi/acpi_cpu_md.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.71 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.72
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.71	Sat Feb 11 22:09:47 2012
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Thu Dec  6 04:43:29 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.71 2012/02/11 22:09:47 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.72 2012/12/06 04:43:29 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.c,v 1.71 2012/02/11 22:09:47 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_md.c,v 1.72 2012/12/06 04:43:29 jruoho Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -253,6 +253,12 @@ acpicpu_md_flags(void)
 		case 0x0f:
 
 			/*
+			 * Disable C1E if present.
+			 */
+			if (rdmsr_safe(MSR_CMPHALT, msr) != EFAULT)
+val |= ACPICPU_FLAG_C_C1E;
+
+			/*
 			 * Evaluate support for the FID/VID
 			 * algorithm also used by powernow(4).
 			 */
@@ -268,6 +274,9 @@ acpicpu_md_flags(void)
 		case 0x10:
 		case 0x11:
 
+			/*
+			 * Disable C1E if present.
+			 */
 			if (rdmsr_safe(MSR_CMPHALT, msr) != EFAULT)
 val |= ACPICPU_FLAG_C_C1E;
 



CVS commit: src

2012-12-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Dec  4 06:57:45 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: mi
src/share/man/man3: bitmap.3 bitops.3 bitstring.3
src/tests/include/sys: t_bitops.c
src/tests/lib/libc/sys: Makefile
Removed Files:
src/tests/lib/libc/sys: t_bitops.c

Log Message:
Move the bitmap(3) test to the right place. Note it in bitops(3). Xrefs.


To generate a diff of this commit:
cvs rdiff -u -r1.511 -r1.512 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.3 -r1.4 src/share/man/man3/bitmap.3 \
src/share/man/man3/bitops.3
cvs rdiff -u -r1.13 -r1.14 src/share/man/man3/bitstring.3
cvs rdiff -u -r1.14 -r1.15 src/tests/include/sys/t_bitops.c
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.1 -r0 src/tests/lib/libc/sys/t_bitops.c

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.511 src/distrib/sets/lists/tests/mi:1.512
--- src/distrib/sets/lists/tests/mi:1.511	Sat Dec  1 16:30:00 2012
+++ src/distrib/sets/lists/tests/mi	Tue Dec  4 06:57:44 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.511 2012/12/01 16:30:00 christos Exp $
+# $NetBSD: mi,v 1.512 2012/12/04 06:57:44 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -548,7 +548,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_swab.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/systests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_access.debug		tests-lib-debug		debug,atf
-./usr/libdata/debug/usr/tests/lib/libc/sys/t_bitops.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/sys/t_bitops.debug		tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_cerror.debug		tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_chroot.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_clock_gettime.debug	tests-lib-debug		debug,atf
@@ -2491,7 +2491,7 @@
 ./usr/tests/lib/libc/sys			tests-lib-tests
 ./usr/tests/lib/libc/sys/Atffile		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_access		tests-lib-tests		atf
-./usr/tests/lib/libc/sys/t_bitops		tests-lib-tests		atf
+./usr/tests/lib/libc/sys/t_bitops		tests-obsolete		obsolete
 ./usr/tests/lib/libc/sys/t_cerror		tests-obsolete		obsolete
 ./usr/tests/lib/libc/sys/t_chroot		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_clock_gettime	tests-lib-tests		atf

Index: src/share/man/man3/bitmap.3
diff -u src/share/man/man3/bitmap.3:1.3 src/share/man/man3/bitmap.3:1.4
--- src/share/man/man3/bitmap.3:1.3	Sat Dec  1 21:21:44 2012
+++ src/share/man/man3/bitmap.3	Tue Dec  4 06:57:45 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: bitmap.3,v 1.3 2012/12/01 21:21:44 wiz Exp $
+.\	$NetBSD: bitmap.3,v 1.4 2012/12/04 06:57:45 jruoho Exp $
 .\
 .\ Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 1, 2012
+.Dd December 4, 2012
 .Dt BITMAP 3
 .Os
 .Sh NAME
@@ -125,6 +125,7 @@ main(int argc, char **argv)
 .Ed
 .Sh SEE ALSO
 .Xr select 2 ,
+.Xr bitops 3 ,
 .Xr bitstring 3
 .Sh HISTORY
 The
Index: src/share/man/man3/bitops.3
diff -u src/share/man/man3/bitops.3:1.3 src/share/man/man3/bitops.3:1.4
--- src/share/man/man3/bitops.3:1.3	Fri Apr  8 08:46:12 2011
+++ src/share/man/man3/bitops.3	Tue Dec  4 06:57:45 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: bitops.3,v 1.3 2011/04/08 08:46:12 jruoho Exp $
+.\ $NetBSD: bitops.3,v 1.4 2012/12/04 06:57:45 jruoho Exp $
 .\
 .\ Copyright (c) 2011 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd April 8, 2011
+.Dd December 4, 2012
 .Dt BITOPS 3
 .Os
 .Sh NAME
@@ -35,11 +35,13 @@
 .Sh DESCRIPTION
 The
 .In sys/bitops.h
-header includes some
+header includes macros and
 .Em static inline
 functions related bits and integers.
 Among these are:
 .Bl -tag -width fast_divide32(3)  -offset indent
+.It Xr bitmap 3
+bitmap manipulation macros
 .It Xr ffs32 3
 functions to find the first and last bit in integers of type
 .Vt uint32_t

Index: src/share/man/man3/bitstring.3
diff -u src/share/man/man3/bitstring.3:1.13 src/share/man/man3/bitstring.3:1.14
--- src/share/man/man3/bitstring.3:1.13	Tue Mar  8 10:53:34 2005
+++ src/share/man/man3/bitstring.3	Tue Dec  4 06:57:45 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: bitstring.3,v 1.13 2005/03/08 10:53:34 wiz Exp $
+.\	$NetBSD: bitstring.3,v 1.14 2012/12/04 06:57:45 jruoho Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -31,7 +31,7 @@
 .\
 .\ @(#)bitstring.3	8.1 (Berkeley) 7/19/93
 .\
-.Dd July

CVS commit: src/share/man/man4

2012-11-01 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Nov  1 11:33:35 UTC 2012

Modified Files:
src/share/man/man4: acpiwmi.4

Log Message:
Remove line acpiwmibus* at acpiwmi?.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/acpiwmi.4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/acpiwmi.4
diff -u src/share/man/man4/acpiwmi.4:1.7 src/share/man/man4/acpiwmi.4:1.8
--- src/share/man/man4/acpiwmi.4:1.7	Wed Feb 16 07:30:26 2011
+++ src/share/man/man4/acpiwmi.4	Thu Nov  1 11:33:34 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: acpiwmi.4,v 1.7 2011/02/16 07:30:26 jruoho Exp $
+.\ $NetBSD: acpiwmi.4,v 1.8 2012/11/01 11:33:34 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 16, 2011
+.Dd November 1, 2012
 .Dt ACPIWMI 4
 .Os
 .Sh NAME
@@ -33,7 +33,6 @@
 .Tn ACPI
 .Sh SYNOPSIS
 .Cd acpiwmi* at acpi?
-.Cd acpiwmibus* at acpiwmi?
 .Cd wmidell* at acpiwmibus?
 .Cd wmieeepc* at acpiwmibus?
 .Cd wmihp* at acpiwmibus?



CVS commit: src/tests/lib

2012-09-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Sep 26 07:24:38 UTC 2012

Modified Files:
src/tests/lib/libc/stdlib: t_strtod.c
src/tests/lib/libm: t_infinity.c

Log Message:
Remove expected failures that no longer fail (probably due a Qemu update).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libc/stdlib/t_strtod.c
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libm/t_infinity.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdlib/t_strtod.c
diff -u src/tests/lib/libc/stdlib/t_strtod.c:1.30 src/tests/lib/libc/stdlib/t_strtod.c:1.31
--- src/tests/lib/libc/stdlib/t_strtod.c:1.30	Tue May 15 18:46:20 2012
+++ src/tests/lib/libc/stdlib/t_strtod.c	Wed Sep 26 07:24:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtod.c,v 1.30 2012/05/15 18:46:20 alnsn Exp $ */
+/*	$NetBSD: t_strtod.c,v 1.31 2012/09/26 07:24:38 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 /* Public domain, Otto Moerbeek o...@drijf.net, 2006. */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_strtod.c,v 1.30 2012/05/15 18:46:20 alnsn Exp $);
+__RCSID($NetBSD: t_strtod.c,v 1.31 2012/09/26 07:24:38 jruoho Exp $);
 
 #include errno.h
 #include math.h
@@ -155,8 +155,6 @@ ATF_TC_BODY(strtold_inf, tc)
 {
 #ifndef __vax__
 #   ifdef __HAVE_LONG_DOUBLE
-	if (system(cpuctl identify 0 | grep -q QEMU) == 0)
-		atf_tc_expect_fail(PR misc/44767);
 
 	for (size_t i = 0; i  __arraycount(inf_strings); i++) {
 		volatile long double ld = strtold(inf_strings[i], NULL);
@@ -221,9 +219,6 @@ ATF_TC_BODY(strtold_nan, tc)
 
 	char *end;
 
-	if (system(cpuctl identify 0 | grep -q QEMU) == 0)
-		atf_tc_expect_fail(PR misc/44767);
-
 	volatile long double ld = strtold(nan_string, end);
 	ATF_REQUIRE(isnan(ld) != 0);
 	ATF_REQUIRE(__isnanl(ld) != 0);

Index: src/tests/lib/libm/t_infinity.c
diff -u src/tests/lib/libm/t_infinity.c:1.5 src/tests/lib/libm/t_infinity.c:1.6
--- src/tests/lib/libm/t_infinity.c:1.5	Fri Jul  8 05:10:05 2011
+++ src/tests/lib/libm/t_infinity.c	Wed Sep 26 07:24:38 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_infinity.c,v 1.5 2011/07/08 05:10:05 jruoho Exp $ */
+/* $NetBSD: t_infinity.c,v 1.6 2012/09/26 07:24:38 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_infinity.c,v 1.5 2011/07/08 05:10:05 jruoho Exp $);
+__RCSID($NetBSD: t_infinity.c,v 1.6 2012/09/26 07:24:38 jruoho Exp $);
 
 #include atf-c.h
 #include math.h
@@ -89,11 +89,6 @@ ATF_TC_HEAD(infinity_long_double, tc)
 
 ATF_TC_BODY(infinity_long_double, tc)
 {
-	/*
-	 * May fail under QEMU; cf. PR misc/44767.
-	 */
-	if (system(cpuctl identify 0 | grep -q QEMU) == 0)
-		atf_tc_expect_fail(PR misc/44767);
 
 #ifndef LDBL_MAX
 	atf_tc_skip(no long double support on this architecture);



CVS commit: src/sbin/rndctl

2012-08-14 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Aug 14 14:41:07 UTC 2012

Modified Files:
src/sbin/rndctl: rndctl.c

Log Message:
Use _PATH_URANDOM from paths(3).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/rndctl/rndctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/rndctl/rndctl.c
diff -u src/sbin/rndctl/rndctl.c:1.24 src/sbin/rndctl/rndctl.c:1.25
--- src/sbin/rndctl/rndctl.c:1.24	Thu Feb  2 19:42:57 2012
+++ src/sbin/rndctl/rndctl.c	Tue Aug 14 14:41:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndctl.c,v 1.24 2012/02/02 19:42:57 tls Exp $	*/
+/*	$NetBSD: rndctl.c,v 1.25 2012/08/14 14:41:07 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 1997 Michael Graff.
@@ -33,7 +33,7 @@
 #include sha1.h
 
 #ifndef lint
-__RCSID($NetBSD: rndctl.c,v 1.24 2012/02/02 19:42:57 tls Exp $);
+__RCSID($NetBSD: rndctl.c,v 1.25 2012/08/14 14:41:07 jruoho Exp $);
 #endif
 
 
@@ -48,6 +48,7 @@ __RCSID($NetBSD: rndctl.c,v 1.24 2012/0
 #include fcntl.h
 #include errno.h
 #include err.h
+#include paths.h
 #include string.h
 
 typedef struct {
@@ -133,11 +134,11 @@ do_save(const char *const filename)
 
 	int fd;
 
-	fd = open(/dev/urandom, O_RDONLY, 0644);
+	fd = open(_PATH_URANDOM, O_RDONLY, 0644);
 	if (fd  0) {
 		err(1, device open);
 	}
-	
+
 	if (ioctl(fd, RNDGETPOOLSTAT, rp)  0) {
 		err(1, ioctl(RNDGETPOOLSTAT));
 	}
@@ -171,7 +172,7 @@ do_save(const char *const filename)
 	if (fd  0) {
 		err(1, output open);
 	}
-	
+
 	if (write(fd, rs, sizeof(rs)) != sizeof(rs)) {
 		unlink(filename);
 		fsync_range(fd, FDATASYNC|FDISKSYNC, (off_t)0, (off_t)0);
@@ -221,7 +222,7 @@ do_load(const char *const filename)
 	rd.entropy = rs.entropy;
 	memcpy(rd.data, rs.data, MIN(sizeof(rd.data), sizeof(rs.data)));
 
-	fd = open(/dev/urandom, O_RDWR, 0644);
+	fd = open(_PATH_URANDOM, O_RDWR, 0644);
 	if (fd  0) {
 		err(1, device open);
 	}
@@ -238,7 +239,7 @@ do_ioctl(rndctl_t *rctl)
 	int fd;
 	int res;
 
-	fd = open(/dev/urandom, O_RDONLY, 0644);
+	fd = open(_PATH_URANDOM, O_RDONLY, 0644);
 	if (fd  0)
 		err(1, open);
 
@@ -283,7 +284,7 @@ do_list(int all, u_int32_t type, char *n
 	uint32_t i;
 	u_int32_t start;
 
-	fd = open(/dev/urandom, O_RDONLY, 0644);
+	fd = open(_PATH_URANDOM, O_RDONLY, 0644);
 	if (fd  0)
 		err(1, open);
 
@@ -339,7 +340,7 @@ do_stats(void)
 	rndpoolstat_t rs;
 	int fd;
 
-	fd = open(/dev/urandom, O_RDONLY, 0644);
+	fd = open(_PATH_URANDOM, O_RDONLY, 0644);
 	if (fd  0)
 		err(1, open);
 



CVS commit: src/doc

2012-07-08 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Jul  8 08:22:24 UTC 2012

Modified Files:
src/doc: 3RDPARTY

Log Message:
ACPICA 20120620 is out.


To generate a diff of this commit:
cvs rdiff -u -r1.944 -r1.945 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.944 src/doc/3RDPARTY:1.945
--- src/doc/3RDPARTY:1.944	Mon Jul  2 06:52:20 2012
+++ src/doc/3RDPARTY	Sun Jul  8 08:22:24 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.944 2012/07/02 06:52:20 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.945 2012/07/08 08:22:24 jruoho Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -26,7 +26,7 @@
 
 Package:	acpica
 Version:	20110623
-Current Vers:	20120215
+Current Vers:	20120620
 Maintainer:	Intel
 Archive Site:	http://www.acpica.org/downloads/unix2_source_code.php
 Home Page:	http://www.acpica.org/



CVS commit: src/tests/lib/libexecinfo

2012-05-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 30 15:11:58 UTC 2012

Modified Files:
src/tests/lib/libexecinfo: t_backtrace.c

Log Message:
Use atf_arch instead of atf_machine; see atf-config(1).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libexecinfo/t_backtrace.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libexecinfo/t_backtrace.c
diff -u src/tests/lib/libexecinfo/t_backtrace.c:1.3 src/tests/lib/libexecinfo/t_backtrace.c:1.4
--- src/tests/lib/libexecinfo/t_backtrace.c:1.3	Wed May 30 06:01:22 2012
+++ src/tests/lib/libexecinfo/t_backtrace.c	Wed May 30 15:11:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_backtrace.c,v 1.3 2012/05/30 06:01:22 martin Exp $	*/
+/*	$NetBSD: t_backtrace.c,v 1.4 2012/05/30 15:11:58 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_backtrace.c,v 1.3 2012/05/30 06:01:22 martin Exp $);
+__RCSID($NetBSD: t_backtrace.c,v 1.4 2012/05/30 15:11:58 jruoho Exp $);
 
 #include atf-c.h
 #include atf-c/config.h
@@ -97,7 +97,7 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc)
 
 ATF_TC_BODY(backtrace_fmt_basic, tc)
 {
-	const char *arch = atf_config_get(atf_machine);
+	const char *arch = atf_config_get(atf_arch);
 
 if (strcmp(arch, amd64) != 0)
 	atf_tc_skip(PR toolchain/46490: libexecinfo only



CVS commit: src/tests/lib/libm

2012-05-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 30 15:14:11 UTC 2012

Modified Files:
src/tests/lib/libm: t_exp.c

Log Message:
Add patch from Tetsuya Isaki in PR lib/46433.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libm/t_exp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/t_exp.c
diff -u src/tests/lib/libm/t_exp.c:1.1 src/tests/lib/libm/t_exp.c:1.2
--- src/tests/lib/libm/t_exp.c:1.1	Sun Sep 18 05:19:18 2011
+++ src/tests/lib/libm/t_exp.c	Wed May 30 15:14:10 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_exp.c,v 1.1 2011/09/18 05:19:18 jruoho Exp $ */
+/* $NetBSD: t_exp.c,v 1.2 2012/05/30 15:14:10 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,6 +32,22 @@
 #include atf-c.h
 #include math.h
 
+/* y = exp(x) */
+static const struct {
+	double x;
+	double y;
+} exp_values[] = {
+	{  -10, 0.4539992976248485e-4, },
+	{   -5, 0.6737946999085467e-2, },
+	{   -1, 0.3678794411714423, },
+	{ -0.1, 0.9048374180359595, },
+	{0, 1., },
+	{  0.1, 1.1051709180756477, },
+	{1, 2.7182818284590452, },
+	{5, 148.41315910257660, },
+	{   10, 22026.465794806718, },
+};
+
 /*
  * exp2(3)
  */
@@ -305,22 +321,23 @@ ATF_TC_BODY(exp_inf_pos, tc)
 ATF_TC(exp_product);
 ATF_TC_HEAD(exp_product, tc)
 {
-	atf_tc_set_md_var(tc, descr, Test exp(x + y) == exp(x) * exp(y));
+	atf_tc_set_md_var(tc, descr, Test some selected exp(x));
 }
 
 ATF_TC_BODY(exp_product, tc)
 {
 #ifndef __vax__
-	const double x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 };
-	const double y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 };
+	double x;
+	double y;
 	const double eps = 1.0e-11;
 	size_t i;
 
-	for (i = 0; i  __arraycount(x); i++) {
+	for (i = 0; i  __arraycount(exp_values); i++) {
+		x = exp_values[i].x;
+		y = exp_values[i].y;
 
-		if (fabs(exp(x[i] + y[i]) - (exp(x[i]) * exp(y[i])))  eps)
-			atf_tc_fail_nonfatal(exp(%0.01f + %0.01f) != exp(
-			%0.01f) * exp(%0.01f), x[i], y[i], x[i], y[i]);
+		if (fabs(exp(x) - y)  eps)
+			atf_tc_fail_nonfatal(exp(%0.01f) != %18.18e, x, y);
 	}
 #endif
 }
@@ -413,22 +430,23 @@ ATF_TC_BODY(expf_inf_pos, tc)
 ATF_TC(expf_product);
 ATF_TC_HEAD(expf_product, tc)
 {
-	atf_tc_set_md_var(tc, descr, Test expf(x+y) == expf(x) * expf(y));
+	atf_tc_set_md_var(tc, descr, Test some selected expf(x));
 }
 
 ATF_TC_BODY(expf_product, tc)
 {
 #ifndef __vax__
-	const float x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 };
-	const float y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 };
+	float x;
+	float y;
 	const float eps = 1.0e-2;
 	size_t i;
 
-	for (i = 0; i  __arraycount(x); i++) {
+	for (i = 0; i  __arraycount(exp_values); i++) {
+		x = exp_values[i].x;
+		y = exp_values[i].y;
 
-		if (fabsf(expf(x[i] + y[i]) - (expf(x[i]) * expf(y[i])))  eps)
-			atf_tc_fail_nonfatal(expf(%0.01f + %0.01f) != expf(
-			%0.01f) * expf(%0.01f), x[i], y[i], x[i], y[i]);
+		if (fabsf(expf(x) - y)  eps)
+			atf_tc_fail_nonfatal(expf(%0.01f) != %18.18e, x, y);
 	}
 #endif
 }



CVS commit: src/tests/usr.bin/tmux

2012-05-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat May 19 07:30:38 UTC 2012

Modified Files:
src/tests/usr.bin/tmux: t_tmux.sh

Log Message:
Make the test pass. It appears that this however does not reproduce the
PR kern/46463, even though the command is exactly the same.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/tmux/t_tmux.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/tmux/t_tmux.sh
diff -u src/tests/usr.bin/tmux/t_tmux.sh:1.1 src/tests/usr.bin/tmux/t_tmux.sh:1.2
--- src/tests/usr.bin/tmux/t_tmux.sh:1.1	Fri May 18 15:25:25 2012
+++ src/tests/usr.bin/tmux/t_tmux.sh	Sat May 19 07:30:37 2012
@@ -1,4 +1,4 @@
-# $NetBSD: t_tmux.sh,v 1.1 2012/05/18 15:25:25 jruoho Exp $
+# $NetBSD: t_tmux.sh,v 1.2 2012/05/19 07:30:37 jruoho Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,7 +30,7 @@
 
 stdincrash() {
 	atf_check -s ignore -o ignore -e ignore -x \
-		tmux list-sessions 0-  sleep 2; kill $! /dev/null 21
+	\tmux list-sessions 0-\  sleep 2; kill $! /dev/null 21
 }
 
 atf_test_case stdin



CVS commit: src

2012-05-18 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri May 18 15:25:26 UTC 2012

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/tmux: Makefile t_tmux.sh

Log Message:
Add a test case for PR kern/46463. From Richard Hansen.


To generate a diff of this commit:
cvs rdiff -u -r1.467 -r1.468 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.75 -r1.76 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/tmux/Makefile \
src/tests/usr.bin/tmux/t_tmux.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.467 src/distrib/sets/lists/tests/mi:1.468
--- src/distrib/sets/lists/tests/mi:1.467	Mon Apr 30 13:47:51 2012
+++ src/distrib/sets/lists/tests/mi	Fri May 18 15:25:25 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.467 2012/04/30 13:47:51 njoly Exp $
+# $NetBSD: mi,v 1.468 2012/05/18 15:25:25 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3178,6 +3178,9 @@
 ./usr/tests/usr.bin/sort/d_any_char_iflag_out.txt	tests-usr.bin-tests	atf
 ./usr/tests/usr.bin/sort/d_any_char_in.txt		tests-usr.bin-tests	atf
 ./usr/tests/usr.bin/sort/t_sorttests-usr.bin-tests	atf
+./usr/tests/usr.bin/tmux			tests-usr.bin-tests
+./usr/tests/usr.bin/tmux/Atffile		tests-usr.bin-tests	atf	atf
+./usr/tests/usr.bin/tmux/t_tmux			tests-usr.bin-tests	atf
 ./usr/tests/usr.bin/unifdef			tests-usr.bin-tests
 ./usr/tests/usr.bin/unifdef/Atffile		tests-usr.bin-tests	atf	atf
 ./usr/tests/usr.bin/unifdef/d_basic.in		tests-usr.bin-tests	atf

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.75 src/etc/mtree/NetBSD.dist.tests:1.76
--- src/etc/mtree/NetBSD.dist.tests:1.75	Thu Apr 19 18:51:36 2012
+++ src/etc/mtree/NetBSD.dist.tests	Fri May 18 15:25:26 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.75 2012/04/19 18:51:36 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.76 2012/05/18 15:25:26 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -293,6 +293,7 @@
 ./usr/tests/usr.bin/sed
 ./usr/tests/usr.bin/shmif_dumpbus
 ./usr/tests/usr.bin/sort
+./usr/tests/usr.bin/tmux
 ./usr/tests/usr.bin/unifdef
 ./usr/tests/usr.bin/xlint
 ./usr/tests/usr.bin/xlint/lint1

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.13 src/tests/usr.bin/Makefile:1.14
--- src/tests/usr.bin/Makefile:1.13	Tue Mar 20 06:18:33 2012
+++ src/tests/usr.bin/Makefile	Fri May 18 15:25:25 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2012/03/20 06:18:33 jruoho Exp $
+#	$NetBSD: Makefile,v 1.14 2012/05/18 15:25:25 jruoho Exp $
 #
 
 .include bsd.own.mk
@@ -7,6 +7,6 @@ TESTSDIR=   ${TESTSBASE}/usr.bin
 
 TESTS_SUBDIRS=	awk basename bzip2 cc cmp config cut \
 		diff dirname find grep gzip id jot m4 make mkdep \
-		pr rump_server shmif_dumpbus sdiff sed sort unifdef xlint
+		pr rump_server shmif_dumpbus sdiff sed sort tmux unifdef xlint
 
 .include bsd.test.mk

Added files:

Index: src/tests/usr.bin/tmux/Makefile
diff -u /dev/null src/tests/usr.bin/tmux/Makefile:1.1
--- /dev/null	Fri May 18 15:25:26 2012
+++ src/tests/usr.bin/tmux/Makefile	Fri May 18 15:25:25 2012
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2012/05/18 15:25:25 jruoho Exp $
+
+.include bsd.own.mk
+
+TESTSDIR=	${TESTSBASE}/usr.bin/tmux
+TESTS_SH=	t_tmux
+
+.include bsd.test.mk
Index: src/tests/usr.bin/tmux/t_tmux.sh
diff -u /dev/null src/tests/usr.bin/tmux/t_tmux.sh:1.1
--- /dev/null	Fri May 18 15:25:26 2012
+++ src/tests/usr.bin/tmux/t_tmux.sh	Fri May 18 15:25:25 2012
@@ -0,0 +1,49 @@
+# $NetBSD: t_tmux.sh,v 1.1 2012/05/18 15:25:25 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

CVS commit: src/tests

2012-05-18 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri May 18 15:36:21 UTC 2012

Modified Files:
src/tests: README

Log Message:
Clarify this a little.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/README
diff -u src/tests/README:1.3 src/tests/README:1.4
--- src/tests/README:1.3	Mon Feb 13 08:55:20 2012
+++ src/tests/README	Fri May 18 15:36:21 2012
@@ -1,11 +1,20 @@
-$NetBSD: README,v 1.3 2012/02/13 08:55:20 wiz Exp $
+$NetBSD: README,v 1.4 2012/05/18 15:36:21 jruoho Exp $
 
-When adding new tests, please try to follow the directory structure of
-the real source tree. For instance, interfaces available via the C library
-should follow:
+When adding new tests, please try to follow the following conventions.
+
+1. For library routines, including system calls, the directory structure of
+   the tests should follow the directory structure of the real source tree.
+   For instance, interfaces available via the C library should follow:
 
 	src/lib/libc/gen - src/tests/lib/libc/gen
 	src/lib/libc/sys - src/tests/lib/libc/sys
+	...
+
+2. Equivalently, all tests for userland utilities should try to follow their
+   location in the source tree. If this can not be satisfied, the tests for
+   a utility should be located under the directory to which the utility is
+   installed. Thus, a test for env(1) should go to src/tests/usr.bin/env.
+   Likewise, a test for tcpdump(8) should be in src/tests/usr.sbin/tcpdump,
+   even though the source code for the program is located under src/external.
 
-Equivalently, tests for a program residing in src/usr.bin/program should be
-added to the src/tests/usr.bin/program subdirectory.
+3. Otherwise use your own discretion.



CVS commit: src/tests/lib/libc/sys

2012-05-16 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 16 09:06:35 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_pipe2.c

Log Message:
Add a case for PR kern/46457. This is skipped for the time being, as it
reproduces the panic described in the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_pipe2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.3 src/tests/lib/libc/sys/t_pipe2.c:1.4
--- src/tests/lib/libc/sys/t_pipe2.c:1.3	Sat Jan 28 02:47:09 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 09:06:35 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.3 2012/01/28 02:47:09 christos Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.3 2012/01/28 02:47:09 christos Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $);
 
 #include atf-c.h
 #include fcntl.h
@@ -98,6 +98,29 @@ ATF_TC_BODY(pipe2_basic, tc)
 	run(0);
 }
 
+ATF_TC(pipe2_consume);
+ATF_TC_HEAD(pipe2_consume, tc)
+{
+	atf_tc_set_md_var(tc, descr, Test that consuming file descriptors 
+	with pipe2(2) does not crash the system (PR kern/46457));
+}
+
+ATF_TC_BODY(pipe2_consume, tc)
+{
+	const size_t n = 200;
+	size_t i;
+
+	atf_tc_skip(The test case causes a panic (PR PR kern/46457));
+
+	for (i = 0; i  n; i++) {
+
+		int fildes[2];
+
+		if (pipe2(fildes, O_CLOEXEC) == -1)
+			return;
+	}
+}
+
 ATF_TC(pipe2_nonblock);
 ATF_TC_HEAD(pipe2_nonblock, tc)
 {
@@ -147,6 +170,7 @@ ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, pipe2_basic);
+	ATF_TP_ADD_TC(tp, pipe2_consume);
 	ATF_TP_ADD_TC(tp, pipe2_nonblock);
 	ATF_TP_ADD_TC(tp, pipe2_cloexec);
 	ATF_TP_ADD_TC(tp, pipe2_nosigpipe);



CVS commit: src/tests/lib/libc/sys

2012-05-16 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 16 13:54:28 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_pipe2.c

Log Message:
Remove also redundant comment (the reference to the PR is already in the
metadata).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_pipe2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.7 src/tests/lib/libc/sys/t_pipe2.c:1.8
--- src/tests/lib/libc/sys/t_pipe2.c:1.7	Wed May 16 13:48:35 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 13:54:28 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $);
 
 #include atf-c.h
 #include fcntl.h
@@ -125,9 +125,6 @@ ATF_TC_BODY(pipe2_consume, tc)
 	err = setrlimit(RLIMIT_NOFILE, rl);
 	ATF_REQUIRE(err == 0);
 
-	/*
-	 * atf_tc_skip(The test case causes a panic (PR kern/46457));
-	 */
 	err = pipe2(filedes, O_CLOEXEC);
 	ATF_REQUIRE(err == -1);
 }



CVS commit: src/sys/arch/x86/x86

2012-04-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr 26 10:15:42 UTC 2012

Modified Files:
src/sys/arch/x86/x86: mpacpi.c

Log Message:
Based on PR kern/44069, revert revision 1.79.

XXX: The actual problem related to Qemu/KVM is yet to be determined.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/x86/x86/mpacpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/mpacpi.c
diff -u src/sys/arch/x86/x86/mpacpi.c:1.92 src/sys/arch/x86/x86/mpacpi.c:1.93
--- src/sys/arch/x86/x86/mpacpi.c:1.92	Fri Jul  1 18:21:31 2011
+++ src/sys/arch/x86/x86/mpacpi.c	Thu Apr 26 10:15:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpacpi.c,v 1.92 2011/07/01 18:21:31 dyoung Exp $	*/
+/*	$NetBSD: mpacpi.c,v 1.93 2012/04/26 10:15:42 jruoho Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mpacpi.c,v 1.92 2011/07/01 18:21:31 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: mpacpi.c,v 1.93 2012/04/26 10:15:42 jruoho Exp $);
 
 #include acpica.h
 #include opt_acpi.h
@@ -1133,7 +1133,7 @@ mpacpi_find_interrupts(void *self)
 		 *   0 = PIC mode, 1 = APIC mode, 2 = SAPIC mode.
 		 */
 		rv = acpi_eval_set_integer(NULL, \\_PIC, 1);
-		if (ACPI_FAILURE(rv)  rv != AE_NOT_FOUND) {
+		if (ACPI_FAILURE(rv)) {
 			if (mp_verbose)
 printf(mpacpi: switch to APIC mode failed\n);
 			return 0;



CVS commit: src/sys/arch/x86/x86

2012-04-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Apr 27 04:32:27 UTC 2012

Modified Files:
src/sys/arch/x86/x86: mpacpi.c

Log Message:
Revert previous. Revision 1.79 was right; Qemu does not implement _PIC.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/x86/x86/mpacpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/mpacpi.c
diff -u src/sys/arch/x86/x86/mpacpi.c:1.93 src/sys/arch/x86/x86/mpacpi.c:1.94
--- src/sys/arch/x86/x86/mpacpi.c:1.93	Thu Apr 26 10:15:42 2012
+++ src/sys/arch/x86/x86/mpacpi.c	Fri Apr 27 04:32:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpacpi.c,v 1.93 2012/04/26 10:15:42 jruoho Exp $	*/
+/*	$NetBSD: mpacpi.c,v 1.94 2012/04/27 04:32:27 jruoho Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mpacpi.c,v 1.93 2012/04/26 10:15:42 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: mpacpi.c,v 1.94 2012/04/27 04:32:27 jruoho Exp $);
 
 #include acpica.h
 #include opt_acpi.h
@@ -1133,7 +1133,7 @@ mpacpi_find_interrupts(void *self)
 		 *   0 = PIC mode, 1 = APIC mode, 2 = SAPIC mode.
 		 */
 		rv = acpi_eval_set_integer(NULL, \\_PIC, 1);
-		if (ACPI_FAILURE(rv)) {
+		if (ACPI_FAILURE(rv)  rv != AE_NOT_FOUND) {
 			if (mp_verbose)
 printf(mpacpi: switch to APIC mode failed\n);
 			return 0;



CVS commit: src/sys/dev/acpi

2012-04-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Apr 27 04:38:24 UTC 2012

Modified Files:
src/sys/dev/acpi: acpi_cpu.h acpi_cpu_tstate.c

Log Message:
Remove the upper limit for the number of T-states.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/acpi/acpi_cpu.h
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/acpi/acpi_cpu_tstate.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi_cpu.h
diff -u src/sys/dev/acpi/acpi_cpu.h:1.43 src/sys/dev/acpi/acpi_cpu.h:1.44
--- src/sys/dev/acpi/acpi_cpu.h:1.43	Tue Oct 18 05:08:24 2011
+++ src/sys/dev/acpi/acpi_cpu.h	Fri Apr 27 04:38:24 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.h,v 1.43 2011/10/18 05:08:24 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.h,v 1.44 2012/04/27 04:38:24 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen jruoho...@iki.fi
@@ -88,7 +88,6 @@
 /*
  * T-states.
  */
-#define ACPICPU_T_STATE_MAX	 0x8
 #define ACPICPU_T_STATE_RETRY	 0xA
 #define ACPICPU_T_STATE_UNKNOWN	 255
 

Index: src/sys/dev/acpi/acpi_cpu_tstate.c
diff -u src/sys/dev/acpi/acpi_cpu_tstate.c:1.30 src/sys/dev/acpi/acpi_cpu_tstate.c:1.31
--- src/sys/dev/acpi/acpi_cpu_tstate.c:1.30	Wed Jun 22 08:49:54 2011
+++ src/sys/dev/acpi/acpi_cpu_tstate.c	Fri Apr 27 04:38:24 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.30 2011/06/22 08:49:54 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.31 2012/04/27 04:38:24 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_cpu_tstate.c,v 1.30 2011/06/22 08:49:54 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_cpu_tstate.c,v 1.31 2012/04/27 04:38:24 jruoho Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -243,11 +243,6 @@ acpicpu_tstate_tss(struct acpicpu_softc 
 		goto out;
 	}
 
-	if (sc-sc_tstate_count  ACPICPU_T_STATE_MAX) {
-		rv = AE_LIMIT;
-		goto out;
-	}
-
 	sc-sc_tstate = kmem_zalloc(sc-sc_tstate_count *
 	sizeof(struct acpicpu_tstate), KM_SLEEP);
 
@@ -560,9 +555,6 @@ acpicpu_tstate_fadt(struct acpicpu_softc
 
 	count = 1  width;
 
-	if (count  ACPICPU_T_STATE_MAX)
-		return AE_LIMIT;
-
 	if (sc-sc_tstate != NULL)
 		kmem_free(sc-sc_tstate, sc-sc_tstate_count * size);
 



CVS commit: src/sys/dev/acpi/acpica

2012-04-22 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Apr 22 06:33:05 UTC 2012

Modified Files:
src/sys/dev/acpi/acpica: OsdMemory.c

Log Message:
As in Linux, prevent BIOS from trying to map addresses beyond ULONG_MAX.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/acpica/OsdMemory.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpica/OsdMemory.c
diff -u src/sys/dev/acpi/acpica/OsdMemory.c:1.4 src/sys/dev/acpi/acpica/OsdMemory.c:1.5
--- src/sys/dev/acpi/acpica/OsdMemory.c:1.4	Thu Feb 17 10:21:43 2011
+++ src/sys/dev/acpi/acpica/OsdMemory.c	Sun Apr 22 06:33:04 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: OsdMemory.c,v 1.4 2011/02/17 10:21:43 jruoho Exp $	*/
+/*	$NetBSD: OsdMemory.c,v 1.5 2012/04/22 06:33:04 jruoho Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: OsdMemory.c,v 1.4 2011/02/17 10:21:43 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: OsdMemory.c,v 1.5 2012/04/22 06:33:04 jruoho Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -61,12 +61,17 @@ MALLOC_DECLARE(M_ACPI);
 void *
 AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length)
 {
-	ACPI_STATUS Status;
 	void *LogicalAddress = NULL;
+	ACPI_STATUS Status;
+
+	if (PhysicalAddress  ULONG_MAX)
+		return NULL;
 
 	Status = acpi_md_OsMapMemory(PhysicalAddress, Length, LogicalAddress);
-	if (ACPI_FAILURE (Status))
+
+	if (ACPI_FAILURE(Status))
 		return NULL;
+
 	return LogicalAddress;
 }
 



CVS commit: src

2012-04-20 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Apr 20 12:11:30 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/sys: Makefile
Added Files:
src/tests/lib/libc/sys: t_mlock.c

Log Message:
Add few unit tests for mlock(2), including a case for PR kern/44788.


To generate a diff of this commit:
cvs rdiff -u -r1.465 -r1.466 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_mlock.c

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.465 src/distrib/sets/lists/tests/mi:1.466
--- src/distrib/sets/lists/tests/mi:1.465	Thu Apr 19 18:51:36 2012
+++ src/distrib/sets/lists/tests/mi	Fri Apr 20 12:11:30 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.465 2012/04/19 18:51:36 jruoho Exp $
+# $NetBSD: mi,v 1.466 2012/04/20 12:11:30 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -549,6 +549,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mkdir.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mkfifo.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mknod.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/sys/t_mlock.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mmap.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mprotect.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_msgctl.debug		tests-lib-debug		debug,atf
@@ -2449,6 +2450,7 @@
 ./usr/tests/lib/libc/sys/t_mkdir		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_mkfifo		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_mknod		tests-lib-tests		atf
+./usr/tests/lib/libc/sys/t_mlock		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_mmap			tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_mprotect		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_msgctl		tests-lib-tests		atf

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.21 src/tests/lib/libc/sys/Makefile:1.22
--- src/tests/lib/libc/sys/Makefile:1.21	Sat Mar 17 17:23:34 2012
+++ src/tests/lib/libc/sys/Makefile	Fri Apr 20 12:11:29 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2012/03/17 17:23:34 jruoho Exp $
+# $NetBSD: Makefile,v 1.22 2012/04/20 12:11:29 jruoho Exp $
 
 MKMAN=	no
 
@@ -33,6 +33,7 @@ TESTS_C+=		t_mincore
 TESTS_C+=		t_mkdir
 TESTS_C+=		t_mkfifo
 TESTS_C+=		t_mknod
+TESTS_C+=		t_mlock
 TESTS_C+=		t_mmap
 TESTS_C+=		t_mprotect
 TESTS_C+=		t_msgctl

Added files:

Index: src/tests/lib/libc/sys/t_mlock.c
diff -u /dev/null src/tests/lib/libc/sys/t_mlock.c:1.1
--- /dev/null	Fri Apr 20 12:11:30 2012
+++ src/tests/lib/libc/sys/t_mlock.c	Fri Apr 20 12:11:29 2012
@@ -0,0 +1,220 @@
+/* $NetBSD: t_mlock.c,v 1.1 2012/04/20 12:11:29 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.
+ */
+#include sys/cdefs.h
+__RCSID($NetBSD: t_mlock.c,v 1.1 2012/04/20 12:11:29 jruoho Exp $);
+
+#include sys/mman.h
+#include sys/resource.h
+#include sys/wait.h
+
+#include errno.h
+#include atf-c.h
+#include stdio.h
+#include stdlib.h
+#include unistd.h
+
+static long page = 0;
+
+ATF_TC(mlock_clip);
+ATF_TC_HEAD(mlock_clip, tc)
+{
+	atf_tc_set_md_var(tc, descr, Test with mlock(2) that UVM only 
+	clips if the clip

CVS commit: src/tests/lib/libc/sys

2012-04-20 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Apr 21 01:15:13 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_mlock.c

Log Message:
Avoid harmless compiler (integer) warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_mlock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/t_mlock.c
diff -u src/tests/lib/libc/sys/t_mlock.c:1.1 src/tests/lib/libc/sys/t_mlock.c:1.2
--- src/tests/lib/libc/sys/t_mlock.c:1.1	Fri Apr 20 12:11:29 2012
+++ src/tests/lib/libc/sys/t_mlock.c	Sat Apr 21 01:15:13 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mlock.c,v 1.1 2012/04/20 12:11:29 jruoho Exp $ */
+/* $NetBSD: t_mlock.c,v 1.2 2012/04/21 01:15:13 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mlock.c,v 1.1 2012/04/20 12:11:29 jruoho Exp $);
+__RCSID($NetBSD: t_mlock.c,v 1.2 2012/04/21 01:15:13 jruoho Exp $);
 
 #include sys/mman.h
 #include sys/resource.h
@@ -61,7 +61,6 @@ ATF_TC_BODY(mlock_clip, tc)
 		atf_tc_skip(page size too small);
 
 	for (size_t i = page; i = 1; i = i - 1024) {
-		(void)fprintf(stderr, trying to lock %zu bytes\n, page - i);
 		(void)mlock(buf, page - i);
 		(void)munlock(buf, page - i);
 	}



CVS commit: src

2012-04-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr 19 18:51:36 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.sbin: Makefile
Added Files:
src/tests/usr.sbin/useradd: Makefile t_useradd.sh

Log Message:
Add a test case for PR bin/39546.


To generate a diff of this commit:
cvs rdiff -u -r1.464 -r1.465 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.74 -r1.75 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/useradd/Makefile \
src/tests/usr.sbin/useradd/t_useradd.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.464 src/distrib/sets/lists/tests/mi:1.465
--- src/distrib/sets/lists/tests/mi:1.464	Sat Apr 14 12:21:45 2012
+++ src/distrib/sets/lists/tests/mi	Thu Apr 19 18:51:36 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.464 2012/04/14 12:21:45 jruoho Exp $
+# $NetBSD: mi,v 1.465 2012/04/19 18:51:36 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3246,6 +3246,9 @@
 ./usr/tests/usr.sbin/traceroute			tests-usr.sbin-tests
 ./usr/tests/usr.sbin/traceroute/Atffile		tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/traceroute/t_traceroute	tests-usr.sbin-tests	atf
+./usr/tests/usr.sbin/useradd			tests-usr.sbin-tests
+./usr/tests/usr.sbin/useradd/Atffile		tests-usr.sbin-tests	atf
+./usr/tests/usr.sbin/useradd/t_useradd		tests-usr.sbin-tests	atf
 ./usr/tests/utiltests-obsolete		obsolete
 ./usr/tests/util/Atffile			tests-obsolete		obsolete
 ./usr/tests/util/awktests-obsolete		obsolete

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.74 src/etc/mtree/NetBSD.dist.tests:1.75
--- src/etc/mtree/NetBSD.dist.tests:1.74	Sat Apr 14 12:21:46 2012
+++ src/etc/mtree/NetBSD.dist.tests	Thu Apr 19 18:51:36 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.74 2012/04/14 12:21:46 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.75 2012/04/19 18:51:36 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -300,3 +300,4 @@
 ./usr/tests/usr.sbin/mtree
 ./usr/tests/usr.sbin/tcpdump
 ./usr/tests/usr.sbin/traceroute
+./usr/tests/usr.sbin/useradd

Index: src/tests/usr.sbin/Makefile
diff -u src/tests/usr.sbin/Makefile:1.3 src/tests/usr.sbin/Makefile:1.4
--- src/tests/usr.sbin/Makefile:1.3	Sat Apr 14 12:21:45 2012
+++ src/tests/usr.sbin/Makefile	Thu Apr 19 18:51:35 2012
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.3 2012/04/14 12:21:45 jruoho Exp $
+# $NetBSD: Makefile,v 1.4 2012/04/19 18:51:35 jruoho Exp $
 .include bsd.own.mk
 
 TESTSDIR=   ${TESTSBASE}/usr.sbin
 
-TESTS_SUBDIRS+= mtree tcpdump traceroute
+TESTS_SUBDIRS+= mtree tcpdump traceroute useradd
 
 .include bsd.test.mk

Added files:

Index: src/tests/usr.sbin/useradd/Makefile
diff -u /dev/null src/tests/usr.sbin/useradd/Makefile:1.1
--- /dev/null	Thu Apr 19 18:51:36 2012
+++ src/tests/usr.sbin/useradd/Makefile	Thu Apr 19 18:51:35 2012
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile,v 1.1 2012/04/19 18:51:35 jruoho Exp $
+
+NOMAN=		# defined
+
+.include bsd.own.mk
+
+TESTSDIR=	${TESTSBASE}/usr.sbin/useradd
+
+TESTS_SH=	t_useradd
+
+.include bsd.test.mk
Index: src/tests/usr.sbin/useradd/t_useradd.sh
diff -u /dev/null src/tests/usr.sbin/useradd/t_useradd.sh:1.1
--- /dev/null	Thu Apr 19 18:51:36 2012
+++ src/tests/usr.sbin/useradd/t_useradd.sh	Thu Apr 19 18:51:36 2012
@@ -0,0 +1,50 @@
+# $NetBSD: t_useradd.sh,v 1.1 2012/04/19 18:51:36 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

CVS commit: src/tests/lib/librumphijack

2012-04-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Apr 20 05:15:11 UTC 2012

Modified Files:
src/tests/lib/librumphijack: h_client.c

Log Message:
Close all file descriptors before trying to reason about the number of open
descriptors. Should fix the test failures reported on current users.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/librumphijack/h_client.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/librumphijack/h_client.c
diff -u src/tests/lib/librumphijack/h_client.c:1.7 src/tests/lib/librumphijack/h_client.c:1.8
--- src/tests/lib/librumphijack/h_client.c:1.7	Tue Apr 17 09:23:21 2012
+++ src/tests/lib/librumphijack/h_client.c	Fri Apr 20 05:15:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_client.c,v 1.7 2012/04/17 09:23:21 jruoho Exp $	*/
+/*	$NetBSD: h_client.c,v 1.8 2012/04/20 05:15:11 jruoho Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -115,12 +115,15 @@ main(int argc, char *argv[])
 
 		return EXIT_SUCCESS;
 	} else if (strcmp(argv[1], fdoff8) == 0) {
+
+		(void)closefrom(0);
+
 		int fd;
 
-		do
+		do {
 			if ((fd = open(/dev/null, O_RDWR)) == -1)
 err(EXIT_FAILURE, open1);
-		while (fd  7);
+		} while (fd  7);
 		fd = open(/dev/null, O_RDWR);
 		if (fd != -1 || errno != ENFILE)
 			errx(EXIT_FAILURE, unexpected fd8 %d %d, fd, errno);



CVS commit: src/tests/modules

2012-04-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Apr 20 05:41:26 UTC 2012

Modified Files:
src/tests/modules: t_abi_uvm.sh t_modload.sh

Log Message:
For now, skip module tests if modctl(8) fails either with EPERM or ENOSYS.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/modules/t_abi_uvm.sh
cvs rdiff -u -r1.12 -r1.13 src/tests/modules/t_modload.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/modules/t_abi_uvm.sh
diff -u src/tests/modules/t_abi_uvm.sh:1.2 src/tests/modules/t_abi_uvm.sh:1.3
--- src/tests/modules/t_abi_uvm.sh:1.2	Tue Mar 20 05:50:11 2012
+++ src/tests/modules/t_abi_uvm.sh	Fri Apr 20 05:41:25 2012
@@ -1,4 +1,4 @@
-# $NetBSD: t_abi_uvm.sh,v 1.2 2012/03/20 05:50:11 jruoho Exp $
+# $NetBSD: t_abi_uvm.sh,v 1.3 2012/04/20 05:41:25 jruoho Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -32,11 +32,12 @@ PAGE_SIZE_head() {
 }
 PAGE_SIZE_body() {
 
-	# XXX: There should be a reliable way to detect MODULAR.
+	# XXX: Adjust when modctl(8) fails consistently.
 	#
-	sysctl machdep.xen  /dev/null 21
+	$(atf_get_srcdir)/k_helper3 \
+		%s/k_helper/k_helper.kmod $(atf_get_srcdir)
 
-	if [ $? -eq 0 ]; then
+	if [ $? -eq 1 ] || [ $? -eq 78 ]; then
 		atf_skip host does not support modules
 	fi
 

Index: src/tests/modules/t_modload.sh
diff -u src/tests/modules/t_modload.sh:1.12 src/tests/modules/t_modload.sh:1.13
--- src/tests/modules/t_modload.sh:1.12	Sat Apr 14 02:46:17 2012
+++ src/tests/modules/t_modload.sh	Fri Apr 20 05:41:25 2012
@@ -1,4 +1,4 @@
-# $NetBSD: t_modload.sh,v 1.12 2012/04/14 02:46:17 pgoyette Exp $
+# $NetBSD: t_modload.sh,v 1.13 2012/04/20 05:41:25 jruoho Exp $
 #
 # Copyright (c) 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -42,7 +42,7 @@ plain_body() {
 	$(atf_get_srcdir)/k_helper3 \
 		%s/k_helper/k_helper.kmod $(atf_get_srcdir)
 
-	if [ $? -eq 78 ]; then
+	if [ $? -eq 1 ] || [ $? -eq 78 ]; then
 		atf_skip host does not support modules
 	fi
 
@@ -115,7 +115,7 @@ iflag_body() {
 	$(atf_get_srcdir)/k_helper3 \
 		%s/k_helper/k_helper.kmod $(atf_get_srcdir)
 
-	if [ $? -eq 78 ]; then
+	if [ $? -eq 1 ] || [ $? -eq 78 ]; then
 		atf_skip host does not support modules
 	fi
 
@@ -169,7 +169,7 @@ sflag_body() {
 	$(atf_get_srcdir)/k_helper3 \
 		%s/k_helper/k_helper.kmod $(atf_get_srcdir)
 
-	if [ $? -eq 78 ]; then
+	if [ $? -eq 1 ] || [ $? -eq 78 ]; then
 		atf_skip host does not support modules
 	fi
 



CVS commit: src/tests/modules

2012-04-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 17 06:23:52 UTC 2012

Modified Files:
src/tests/modules: t_modctl.c

Log Message:
Avoid zero-length format string.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/modules/t_modctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/modules/t_modctl.c
diff -u src/tests/modules/t_modctl.c:1.8 src/tests/modules/t_modctl.c:1.9
--- src/tests/modules/t_modctl.c:1.8	Thu Mar 15 02:02:23 2012
+++ src/tests/modules/t_modctl.c	Tue Apr 17 06:23:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_modctl.c,v 1.8 2012/03/15 02:02:23 joerg Exp $	*/
+/*	$NetBSD: t_modctl.c,v 1.9 2012/04/17 06:23:52 jruoho Exp $	*/
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: t_modctl.c,v 1.8 2012/03/15 02:02:23 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: t_modctl.c,v 1.9 2012/04/17 06:23:52 jruoho Exp $);
 
 #include sys/module.h
 #include sys/sysctl.h
@@ -294,7 +294,7 @@ ATF_TC_BODY(cmd_load, tc)
 	char longname[MAXPATHLEN];
 	size_t i;
 
-	ATF_CHECK(load(NULL, false, ) == ENOENT);
+	ATF_CHECK(load(NULL, false,  ) == ENOENT);
 	ATF_CHECK(load(NULL, false, non-existent.o) == ENOENT);
 
 	for (i = 0; i  MAXPATHLEN - 1; i++)



CVS commit: src/tests/lib/librumphijack

2012-04-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 17 09:23:21 UTC 2012

Modified Files:
src/tests/lib/librumphijack: h_client.c h_cwd.c h_netget.c

Log Message:
Return from main() and use EXIT_FAILURE/EXIT_SUCCESS from stdlib(3).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/librumphijack/h_client.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/librumphijack/h_cwd.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/librumphijack/h_netget.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/librumphijack/h_client.c
diff -u src/tests/lib/librumphijack/h_client.c:1.6 src/tests/lib/librumphijack/h_client.c:1.7
--- src/tests/lib/librumphijack/h_client.c:1.6	Mon Mar 14 15:56:40 2011
+++ src/tests/lib/librumphijack/h_client.c	Tue Apr 17 09:23:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_client.c,v 1.6 2011/03/14 15:56:40 pooka Exp $	*/
+/*	$NetBSD: h_client.c,v 1.7 2012/04/17 09:23:21 jruoho Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -57,19 +57,19 @@ main(int argc, char *argv[])
 		tv.tv_usec = 1;
 
 		if (pipe(pipefd) == -1)
-			err(1, pipe);
+			err(EXIT_FAILURE, pipe);
 		FD_ZERO(rfds);
 		FD_SET(pipefd[0], rfds);
 
 		rv = select(pipefd[0]+1, rfds, NULL, NULL, tv);
 		if (rv == -1)
-			err(1, select);
+			err(EXIT_FAILURE, select);
 		if (rv != 0)
-			errx(1, select succesful);
+			errx(EXIT_FAILURE, select succesful);
 
 		if (FD_ISSET(pipefd[0], rfds))
-			errx(1, stdin fileno is still set);
-		exit(0);
+			errx(EXIT_FAILURE, stdin fileno is still set);
+		return EXIT_SUCCESS;
 	} else if (strcmp(argv[1], select_allunset) == 0) {
 		fd_set fds;
 		struct timeval tv;
@@ -82,24 +82,24 @@ main(int argc, char *argv[])
 
 		rv = select(100, fds, fds, fds, tv);
 		if (rv == -1)
-			err(1, select);
+			err(EXIT_FAILURE, select);
 		if (rv != 0)
-			errx(1, select succesful);
+			errx(EXIT_FAILURE, select succesful);
 
 		rv = select(0, NULL, NULL, NULL, tv);
 		if (rv == -1)
-			err(1, select2);
+			err(EXIT_FAILURE, select2);
 		if (rv != 0)
-			errx(1, select2 succesful);
+			errx(EXIT_FAILURE, select2 succesful);
 
-		exit(0);
+		return EXIT_SUCCESS;
 	} else if (strcmp(argv[1], invafd) == 0) {
 		struct pollfd pfd[2];
 		int fd, rv;
 
 		fd = open(/rump/dev/null, O_RDWR);
 		if (fd == -1)
-			err(1, open);
+			err(EXIT_FAILURE, open);
 		close(fd);
 
 		pfd[0].fd = STDIN_FILENO;
@@ -108,26 +108,27 @@ main(int argc, char *argv[])
 		pfd[1].events = POLLIN;
 
 		if ((rv = poll(pfd, 2, INFTIM)) != 1)
-			errx(1, poll unexpected rv %d (%d), rv, errno);
+			errx(EXIT_FAILURE, poll unexpected rv %d (%d),
+			rv, errno);
 		if (pfd[1].revents != POLLNVAL || pfd[0].revents != 0)
-			errx(1, poll unexpected revents);
+			errx(EXIT_FAILURE, poll unexpected revents);
 
-		exit(0);
+		return EXIT_SUCCESS;
 	} else if (strcmp(argv[1], fdoff8) == 0) {
 		int fd;
 
 		do
 			if ((fd = open(/dev/null, O_RDWR)) == -1)
-err(1, open1);
+err(EXIT_FAILURE, open1);
 		while (fd  7);
 		fd = open(/dev/null, O_RDWR);
 		if (fd != -1 || errno != ENFILE)
-			errx(1, unexpected fd8 %d %d, fd, errno);
+			errx(EXIT_FAILURE, unexpected fd8 %d %d, fd, errno);
 		if (fcntl(0, F_MAXFD) != 7)
-			errx(1, fd leak?);
+			errx(EXIT_FAILURE, fd leak?);
 		if ((fd = open(/rump/dev/null, O_RDWR)) != 8)
-			errx(1, rump open %d %d, fd, errno);
-		exit(0);
+			errx(EXIT_FAILURE, rump open %d %d, fd, errno);
+		return EXIT_SUCCESS;
 	} else {
 		return ENOTSUP;
 	}

Index: src/tests/lib/librumphijack/h_cwd.c
diff -u src/tests/lib/librumphijack/h_cwd.c:1.2 src/tests/lib/librumphijack/h_cwd.c:1.3
--- src/tests/lib/librumphijack/h_cwd.c:1.2	Sat Feb 19 19:57:28 2011
+++ src/tests/lib/librumphijack/h_cwd.c	Tue Apr 17 09:23:21 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: h_cwd.c,v 1.2 2011/02/19 19:57:28 pooka Exp $	*/
+/*  $NetBSD: h_cwd.c,v 1.3 2012/04/17 09:23:21 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,6 +33,7 @@
 #include err.h
 #include errno.h
 #include fcntl.h
+#include stdlib.h
 #include string.h
 #include unistd.h
 
@@ -58,7 +59,7 @@ dochdir(const char *path, const char *er
 {
 
 	if (chdir(path) == -1)
-		err(1, %s, errmsg);
+		err(EXIT_FAILURE, %s, errmsg);
 }
 
 static void
@@ -68,9 +69,9 @@ dofchdir(const char *path, const char *e
 
 	fd = open(path, O_RDONLY);
 	if (fd == -1)
-		err(1, open %s, errmsg);
+		err(EXIT_FAILURE, open %s, errmsg);
 	if (fchdir(fd) == -1)
-		err(1, fchdir %s, errmsg);
+		err(EXIT_FAILURE, fchdir %s, errmsg);
 	close(fd);
 }
 static void (*thechdir)(const char *, const char *);
@@ -81,44 +82,44 @@ simple(void)
 
 	thechdir(prefix, chdir1);
 	if (getcwd(pwd, sizeof(pwd)) == NULL)
-		err(1, getcwd1);
+		err(EXIT_FAILURE, getcwd1);
 	if (strcmp(pwd, prefix) != 0)
-		errx(1, strcmp1);
+		errx(EXIT_FAILURE, strcmp1);
 
 	if (mkdir(dir, 0777) == -1)
-		err(1, mkdir2);
+		err(EXIT_FAILURE, mkdir2);
 	thechdir(dir, 

CVS commit: src/tests/modules/k_helper3

2012-04-16 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 17 05:18:54 UTC 2012

Modified Files:
src/tests/modules/k_helper3: k_helper3.c

Log Message:
Adjust.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/modules/k_helper3/k_helper3.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/modules/k_helper3/k_helper3.c
diff -u src/tests/modules/k_helper3/k_helper3.c:1.1 src/tests/modules/k_helper3/k_helper3.c:1.2
--- src/tests/modules/k_helper3/k_helper3.c:1.1	Fri Apr 13 07:05:32 2012
+++ src/tests/modules/k_helper3/k_helper3.c	Tue Apr 17 05:18:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: k_helper3.c,v 1.1 2012/04/13 07:05:32 jruoho Exp $ */
+/*	$NetBSD: k_helper3.c,v 1.2 2012/04/17 05:18:54 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: k_helper3.c,v 1.1 2012/04/13 07:05:32 jruoho Exp $);
+__RCSID($NetBSD: k_helper3.c,v 1.2 2012/04/17 05:18:54 jruoho Exp $);
 
 #include sys/module.h
 
@@ -82,10 +82,11 @@ load(const char *fmt, ...)
 	errno = serrno = 0;
 
 	rv = modctl(MODCTL_LOAD, ml);
-	serrno = errno;
 
-	if (rv != -1)
-		(void)modctl(MODCTL_UNLOAD, filename);
+	if (rv != 0)
+		serrno = errno;
+
+	(void)modctl(MODCTL_UNLOAD, filename);
 
 	free(propsstr);
 



CVS commit: src

2012-04-14 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Apr 14 12:21:46 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.sbin: Makefile
Added Files:
src/tests/usr.sbin/tcpdump: Makefile t_tcpdump.sh

Log Message:
Add a test case for PR kern/46328 (tested naively with tcpdump(8)).


To generate a diff of this commit:
cvs rdiff -u -r1.463 -r1.464 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.73 -r1.74 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/tcpdump/Makefile \
src/tests/usr.sbin/tcpdump/t_tcpdump.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.463 src/distrib/sets/lists/tests/mi:1.464
--- src/distrib/sets/lists/tests/mi:1.463	Tue Apr 10 02:39:34 2012
+++ src/distrib/sets/lists/tests/mi	Sat Apr 14 12:21:45 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.463 2012/04/10 02:39:34 jruoho Exp $
+# $NetBSD: mi,v 1.464 2012/04/14 12:21:45 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3240,6 +3240,9 @@
 ./usr/tests/usr.sbin/mtree/d_merge_C_M.out	tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/mtree/d_merge_C_M_S.out	tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/mtree/t_mtree		tests-usr.sbin-tests	atf
+./usr/tests/usr.sbin/tcpdump			tests-usr.sbin-tests
+./usr/tests/usr.sbin/tcpdump/Atffile		tests-usr.sbin-tests	atf
+./usr/tests/usr.sbin/tcpdump/t_tcpdump		tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/traceroute			tests-usr.sbin-tests
 ./usr/tests/usr.sbin/traceroute/Atffile		tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/traceroute/t_traceroute	tests-usr.sbin-tests	atf

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.73 src/etc/mtree/NetBSD.dist.tests:1.74
--- src/etc/mtree/NetBSD.dist.tests:1.73	Sat Apr 14 02:48:44 2012
+++ src/etc/mtree/NetBSD.dist.tests	Sat Apr 14 12:21:46 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.73 2012/04/14 02:48:44 pgoyette Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.74 2012/04/14 12:21:46 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -298,4 +298,5 @@
 ./usr/tests/usr.bin/xlint/lint1
 ./usr/tests/usr.sbin
 ./usr/tests/usr.sbin/mtree
+./usr/tests/usr.sbin/tcpdump
 ./usr/tests/usr.sbin/traceroute

Index: src/tests/usr.sbin/Makefile
diff -u src/tests/usr.sbin/Makefile:1.2 src/tests/usr.sbin/Makefile:1.3
--- src/tests/usr.sbin/Makefile:1.2	Sat Mar 17 16:33:16 2012
+++ src/tests/usr.sbin/Makefile	Sat Apr 14 12:21:45 2012
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2012/03/17 16:33:16 jruoho Exp $
+# $NetBSD: Makefile,v 1.3 2012/04/14 12:21:45 jruoho Exp $
 .include bsd.own.mk
 
 TESTSDIR=   ${TESTSBASE}/usr.sbin
 
-TESTS_SUBDIRS+= mtree traceroute
+TESTS_SUBDIRS+= mtree tcpdump traceroute
 
 .include bsd.test.mk

Added files:

Index: src/tests/usr.sbin/tcpdump/Makefile
diff -u /dev/null src/tests/usr.sbin/tcpdump/Makefile:1.1
--- /dev/null	Sat Apr 14 12:21:46 2012
+++ src/tests/usr.sbin/tcpdump/Makefile	Sat Apr 14 12:21:45 2012
@@ -0,0 +1,9 @@
+# $NetBS$
+
+.include bsd.own.mk
+
+TESTSDIR=	${TESTSBASE}/usr.sbin/tcpdump
+
+TESTS_SH=	t_tcpdump
+
+.include bsd.test.mk
Index: src/tests/usr.sbin/tcpdump/t_tcpdump.sh
diff -u /dev/null src/tests/usr.sbin/tcpdump/t_tcpdump.sh:1.1
--- /dev/null	Sat Apr 14 12:21:46 2012
+++ src/tests/usr.sbin/tcpdump/t_tcpdump.sh	Sat Apr 14 12:21:45 2012
@@ -0,0 +1,59 @@
+# $NetBSD: t_tcpdump.sh,v 1.1 2012/04/14 12:21:45 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

CVS commit: src/tests/usr.sbin/tcpdump

2012-04-14 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Apr 14 12:43:06 UTC 2012

Modified Files:
src/tests/usr.sbin/tcpdump: Makefile

Log Message:
Fix RCS string.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/tcpdump/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.sbin/tcpdump/Makefile
diff -u src/tests/usr.sbin/tcpdump/Makefile:1.1 src/tests/usr.sbin/tcpdump/Makefile:1.2
--- src/tests/usr.sbin/tcpdump/Makefile:1.1	Sat Apr 14 12:21:45 2012
+++ src/tests/usr.sbin/tcpdump/Makefile	Sat Apr 14 12:43:05 2012
@@ -1,4 +1,4 @@
-# $NetBS$
+# $NetBSD: Makefile,v 1.2 2012/04/14 12:43:05 jruoho Exp $
 
 .include bsd.own.mk
 



CVS commit: src/tests/usr.sbin/tcpdump

2012-04-14 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sat Apr 14 15:13:58 UTC 2012

Modified Files:
src/tests/usr.sbin/tcpdump: t_tcpdump.sh

Log Message:
Add few more NICs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/tcpdump/t_tcpdump.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.sbin/tcpdump/t_tcpdump.sh
diff -u src/tests/usr.sbin/tcpdump/t_tcpdump.sh:1.1 src/tests/usr.sbin/tcpdump/t_tcpdump.sh:1.2
--- src/tests/usr.sbin/tcpdump/t_tcpdump.sh:1.1	Sat Apr 14 12:21:45 2012
+++ src/tests/usr.sbin/tcpdump/t_tcpdump.sh	Sat Apr 14 15:13:57 2012
@@ -1,4 +1,4 @@
-# $NetBSD: t_tcpdump.sh,v 1.1 2012/04/14 12:21:45 jruoho Exp $
+# $NetBSD: t_tcpdump.sh,v 1.2 2012/04/14 15:13:57 jruoho Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,7 +41,7 @@ promiscuous_head() {
 
 promiscuous_body() {
 
-	ifs=lo0 age0 ath0 bge0 re0 sk0 iwn0 wm0 wpi0
+	ifs=lo0 age0 ath0 bge0 dge0 re0 rtk0 sip0 sk0 iwn0 vr0 wm0 wpi0
 
 	for i in $ifs; do
 



CVS commit: src

2012-04-13 Thread Jukka Ruohonen
+ * 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.
+ */
+#include sys/cdefs.h
+__RCSID($NetBSD: k_helper3.c,v 1.1 2012/04/13 07:05:32 jruoho Exp $);
+
+#include sys/module.h
+
+#include assert.h
+#include errno.h
+#include stdarg.h
+#include stdio.h
+#include stdlib.h
+#include string.h
+
+#include prop/proplib.h
+
+static int load(const char *, ...);
+
+/*
+ * A program that loads a module and returns the errno(2) from modctl(8).
+ */
+int
+main(int argc, char *argv[])
+{
+	assert(argc == 3);
+
+	return load(argv[1], argv[2]);
+}
+
+static __printflike(1, 2) int
+load(const char *fmt, ...)
+{
+	char filename[MAXPATHLEN], *propsstr;
+	prop_dictionary_t props;
+	modctl_load_t ml;
+	int serrno, rv;
+	va_list ap;
+
+	props = prop_dictionary_create();
+	propsstr = prop_dictionary_externalize(props);
+	assert(propsstr != NULL);
+	prop_object_release(props);
+
+	va_start(ap, fmt);
+	(void)vsnprintf(filename, sizeof(filename), fmt, ap);
+	va_end(ap);
+
+	ml.ml_filename = filename;
+	ml.ml_flags = 0;
+	ml.ml_props = propsstr;
+	ml.ml_propslen = strlen(propsstr);
+
+	printf(Loading module %s\n, filename);
+	errno = serrno = 0;
+
+	rv = modctl(MODCTL_LOAD, ml);
+	serrno = errno;
+
+	if (rv != -1)
+		(void)modctl(MODCTL_UNLOAD, filename);
+
+	free(propsstr);
+
+	return serrno;
+}



CVS commit: src/tests/lib/libc/gen

2012-04-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 11 06:45:16 UTC 2012

Modified Files:
src/tests/lib/libc/gen: t_fpsetmask.c

Log Message:
As it turned out, the fpsetmask(3) tests were unnecessarily skipped on Qemu.
Thus, remove xfails that do not trigger.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/t_fpsetmask.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/t_fpsetmask.c
diff -u src/tests/lib/libc/gen/t_fpsetmask.c:1.5 src/tests/lib/libc/gen/t_fpsetmask.c:1.6
--- src/tests/lib/libc/gen/t_fpsetmask.c:1.5	Tue Apr 10 12:43:06 2012
+++ src/tests/lib/libc/gen/t_fpsetmask.c	Wed Apr 11 06:45:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fpsetmask.c,v 1.5 2012/04/10 12:43:06 jruoho Exp $ */
+/*	$NetBSD: t_fpsetmask.c,v 1.6 2012/04/11 06:45:16 jruoho Exp $ */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -295,13 +295,7 @@ sigfpe(int s, siginfo_t *si, void *c)
 	{\
 		if (strcmp(atf_config_get(atf_arch), macppc) == 0)	\
 			atf_tc_expect_fail(PR port-macppc/46319);	\
-		if (system(cpuctl identify 0 | grep -q QEMU) == 0)	\
-			atf_tc_expect_fail(PR misc/44767);		\
-		if (system(cpuctl identify 0 | grep -q			\
-		  'cpu0: Intel Pentium II (Klamath) (686-class), id 0x633')\
-		== 0)		\
-			atf_tc_expect_fail(PR misc/44767 		\
-(heuristic match));			\
+	\
 		m(t##_ops);		\
 	}
 



CVS commit: src/tests/lib/libc/gen

2012-04-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 11 10:18:26 UTC 2012

Modified Files:
src/tests/lib/libc/gen: t_fpsetmask.c

Log Message:
Revisit the previous: fails on qemu/amd64 but not qemu/i386.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/gen/t_fpsetmask.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/t_fpsetmask.c
diff -u src/tests/lib/libc/gen/t_fpsetmask.c:1.6 src/tests/lib/libc/gen/t_fpsetmask.c:1.7
--- src/tests/lib/libc/gen/t_fpsetmask.c:1.6	Wed Apr 11 06:45:16 2012
+++ src/tests/lib/libc/gen/t_fpsetmask.c	Wed Apr 11 10:18:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fpsetmask.c,v 1.6 2012/04/11 06:45:16 jruoho Exp $ */
+/*	$NetBSD: t_fpsetmask.c,v 1.7 2012/04/11 10:18:25 jruoho Exp $ */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -296,6 +296,10 @@ sigfpe(int s, siginfo_t *si, void *c)
 		if (strcmp(atf_config_get(atf_arch), macppc) == 0)	\
 			atf_tc_expect_fail(PR port-macppc/46319);	\
 	\
+		if (strcmp(atf_config_get(atf_arch), amd64) == 0 	\
+		system(cpuctl identify 0 | grep -q QEMU) == 0)	\
+			atf_tc_expect_fail(PR misc/44767);		\
+	\
 		m(t##_ops);		\
 	}
 



CVS commit: src/tests/lib/libc/gen

2012-04-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 11 16:18:39 UTC 2012

Modified Files:
src/tests/lib/libc/gen: t_fpsetmask.c

Log Message:
Flip previous (i386/qemu fails, not the amd64/qemu).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/gen/t_fpsetmask.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/gen/t_fpsetmask.c
diff -u src/tests/lib/libc/gen/t_fpsetmask.c:1.7 src/tests/lib/libc/gen/t_fpsetmask.c:1.8
--- src/tests/lib/libc/gen/t_fpsetmask.c:1.7	Wed Apr 11 10:18:25 2012
+++ src/tests/lib/libc/gen/t_fpsetmask.c	Wed Apr 11 16:18:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fpsetmask.c,v 1.7 2012/04/11 10:18:25 jruoho Exp $ */
+/*	$NetBSD: t_fpsetmask.c,v 1.8 2012/04/11 16:18:39 jruoho Exp $ */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -296,7 +296,7 @@ sigfpe(int s, siginfo_t *si, void *c)
 		if (strcmp(atf_config_get(atf_arch), macppc) == 0)	\
 			atf_tc_expect_fail(PR port-macppc/46319);	\
 	\
-		if (strcmp(atf_config_get(atf_arch), amd64) == 0 	\
+		if (strcmp(atf_config_get(atf_arch), i386) == 0 	\
 		system(cpuctl identify 0 | grep -q QEMU) == 0)	\
 			atf_tc_expect_fail(PR misc/44767);		\
 	\



CVS commit: src/tests/lib/libc/stdio

2012-04-11 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 11 16:21:43 UTC 2012

Modified Files:
src/tests/lib/libc/stdio: t_printf.c

Log Message:
Reduce the number of snprintf(3) invocations, as sparc/qemu timeouts.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/stdio/t_printf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/stdio/t_printf.c
diff -u src/tests/lib/libc/stdio/t_printf.c:1.7 src/tests/lib/libc/stdio/t_printf.c:1.8
--- src/tests/lib/libc/stdio/t_printf.c:1.7	Sun Mar 18 08:13:57 2012
+++ src/tests/lib/libc/stdio/t_printf.c	Wed Apr 11 16:21:42 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_printf.c,v 1.7 2012/03/18 08:13:57 jruoho Exp $ */
+/* $NetBSD: t_printf.c,v 1.8 2012/04/11 16:21:42 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -147,7 +147,7 @@ ATF_TC_BODY(snprintf_float, tc)
 
 	time(now);
 	srand(now);
-	for (size_t i = 0; i  100; i++) {
+	for (size_t i = 0; i  1; i++) {
 		ul = rand();
 		uh = rand();
 		u.bits = (uint64_t)uh  32 | ul;



  1   2   3   4   5   6   7   8   9   10   >