NetBSD Problem Report #49644

From www@NetBSD.org  Thu Feb  5 13:21:27 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 20F54A650D
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  5 Feb 2015 13:21:27 +0000 (UTC)
Message-Id: <20150205132125.B76E8A65B9@mollari.NetBSD.org>
Date: Thu,  5 Feb 2015 13:21:25 +0000 (UTC)
From: isaki@pastel-flower.jp
Reply-To: isaki@pastel-flower.jp
To: gnats-bugs@NetBSD.org
Subject: tests/lib/libc/sys/t_kevent failed on many arch
X-Send-Pr-Version: www-1.0

>Number:         49644
>Category:       bin
>Synopsis:       tests/lib/libc/sys/t_kevent failed on many arch
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 05 13:25:00 +0000 2015
>Closed-Date:    Thu Feb 05 13:59:02 +0000 2015
>Last-Modified:  Thu Feb 05 14:00:00 +0000 2015
>Originator:     Tetsuya Isaki
>Release:        NetBSD-current (2015/02/03)
>Organization:
>Environment:
NetBSD x68k.local 7.99.4 NetBSD 7.99.4 (GENERIC) #0: Thu Feb  5 15:13:36 JST 2015  isaki@XXXXXXXX:/var/obj/current/x68k/obj/sys/arch/x68k/compile/GENERIC x68k
>Description:
tests/lib/libc/sys/t_kevent:kqueue_unsupported_fd failed
abnormally if the kernel does not have 'pseudo-device drvctl'.

Here is the log of atf-report (on x68k):
| lib/libc/sys/t_kevent (217/592): 3 test cases
|     kevent_zerotimer: [0.841000s] Passed.
|     kqueue_desc_passing: [1.074400s] Skipped: PR kern/46523
|     kqueue_unsupported_fd: [0.937650s] Failed: /autobuild/7/src/tests/lib/libc/sys/t_kevent.c:158: fd != -1 not met


kqueue_unsupported_fd test will try to open /dev/drvctl, but
/dev/drvctl is only prepared to GENERIC with the following
architectures.  So in these architectures, the kqueue_unsupported_fd
test is "not executed", not "executed and failed."

  % cd /usr/src/sys/arch
  % grep -r drvctl */conf/GENERIC | grep -v #
  amd64/conf/GENERIC:pseudo-device        drvctl
  hppa/conf/GENERIC:pseudo-device drvctl
  i386/conf/GENERIC:pseudo-device drvctl
  macppc/conf/GENERIC:pseudo-device   drvctl
  ofppc/conf/GENERIC:pseudo-device        drvctl
  sandpoint/conf/GENERIC:pseudo-device    drvctl
  sparc64/conf/GENERIC:pseudo-device      drvctl

>How-To-Repeat:
Remove 'pseudo-device drvctl' from your kernel config,
and boot with the kernel.

# cd /usr/tests/lib/libc/gen
# atf-report t_kevent | atf-report

>Fix:
(although I don't know whether it's possible to replace from
/dev/drvctl to other devices.. ,)
if the test really needs /dev/drvctl, How about this patch?
Opening /dev/drvctl returns ENXIO(device not configured) when
it is not present in the kernel and it skips this test normally.

Index: tests/lib/libc/sys/t_kevent.c
===================================================================
RCS file: /cvsroot/src/tests/lib/libc/sys/t_kevent.c,v
retrieving revision 1.6
diff -u -r1.6 t_kevent.c
--- tests/lib/libc/sys/t_kevent.c	29 Nov 2012 09:13:44 -0000	1.6
+++ tests/lib/libc/sys/t_kevent.c	5 Feb 2015 12:45:27 -0000
@@ -153,8 +153,14 @@
 	struct kevent ev;

 	fd = open(DRVCTLDEV, O_RDONLY);
-	if (fd == -1 && errno == ENOENT)
-		atf_tc_skip("no " DRVCTLDEV " available for testing");
+	if (fd == -1) {
+		switch (errno) {
+		case ENOENT:
+		case ENXIO:
+			atf_tc_skip("no " DRVCTLDEV " available for testing");
+			break;
+		}
+	}
 	ATF_REQUIRE(fd != -1);
 	ATF_REQUIRE((kq = kqueue()) != -1);


It is only changing the state of the test from "not executed" to
"skip normally."
Or please revise the test to not use /dev/drvctl...

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/49644: tests/lib/libc/sys/t_kevent failed on many arch
Date: Thu, 5 Feb 2015 14:38:46 +0100

 Looks good, please commit!

 Martin

State-Changed-From-To: open->closed
State-Changed-By: isaki@NetBSD.org
State-Changed-When: Thu, 05 Feb 2015 13:59:02 +0000
State-Changed-Why:
Commited.


From: "Tetsuya Isaki" <isaki@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49644 CVS commit: src/tests/lib/libc/sys
Date: Thu, 5 Feb 2015 13:55:37 +0000

 Module Name:	src
 Committed By:	isaki
 Date:		Thu Feb  5 13:55:37 UTC 2015

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

 Log Message:
 Skip kqueue_unsupported_fd test if /dev/drvctl is not configured
 in the kernel.  PR bin/49644.

 XXX Ideally, it's better to modify to use more generic device file.


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

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

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.