svn commit: r309469 - in stable/11: . contrib/netbsd-tests/kernel/kqueue contrib/netbsd-tests/kernel/kqueue/read etc/mtree tests/sys/kqueue tests/sys/kqueue/libkqueue
Ngie Cooper
ngie at FreeBSD.org
Sat Dec 3 02:55:21 UTC 2016
Author: ngie
Date: Sat Dec 3 02:55:19 2016
New Revision: 309469
URL: https://svnweb.freebsd.org/changeset/base/309469
Log:
MFC r304797,r305467,r305468,r305483:
r304797 (by jmmv):
Make use of Kyua's work directories.
Change the vnode tests to use the current directory when creating temporary
files, which we can assume is a volatile work directory, and then make the
kqueue_test.sh driver _not_ abandon the directory created by Kyua.
This makes the various kqueue tests independent of each other, and ensures
the temporary file is cleaned up on failure.
Problem spotted by asomers@ when reviewing D4254.
r305467:
Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...
This is being done to clearly distinguish the libkqueue tests
from the (soon to be imported) NetBSD tests.
r305468:
Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...
proc2_test must be skipped because the invariant tested
(`ke.fflags & NOTE_TRACKERR`) doesn't pass.
r305483:
Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
format specifier for pointers when printing them out with printf(3)
Pointyhat to: ngie
Added:
stable/11/tests/sys/kqueue/libkqueue/
- copied from r305467, head/tests/sys/kqueue/libkqueue/
Replaced:
stable/11/tests/sys/kqueue/Makefile
- copied, changed from r305467, head/tests/sys/kqueue/Makefile
Deleted:
stable/11/tests/sys/kqueue/Makefile.depend
stable/11/tests/sys/kqueue/common.h
stable/11/tests/sys/kqueue/config.h
stable/11/tests/sys/kqueue/kqueue_test.sh
stable/11/tests/sys/kqueue/main.c
stable/11/tests/sys/kqueue/proc.c
stable/11/tests/sys/kqueue/read.c
stable/11/tests/sys/kqueue/signal.c
stable/11/tests/sys/kqueue/timer.c
stable/11/tests/sys/kqueue/user.c
stable/11/tests/sys/kqueue/vnode.c
Modified:
stable/11/ObsoleteFiles.inc
stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c
stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c
stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c
stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c
stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c
stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c
stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c
stable/11/etc/mtree/BSD.tests.dist
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/ObsoleteFiles.inc
==============================================================================
--- stable/11/ObsoleteFiles.inc Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/ObsoleteFiles.inc Sat Dec 3 02:55:19 2016 (r309469)
@@ -51,6 +51,9 @@ OLD_FILES+=usr/share/man/man4/hv_vss.4.g
OLD_FILES+=usr/share/man/man4/hv_ata_pci_disengage.4.gz
# 20161015: remove link to removed m_getclr(9) macro
OLD_FILES+=usr/share/man/man9/m_getclr.9.gz
+# 20160906: libkqueue tests moved to /usr/tests/sys/kqueue/libkqueue
+OLD_FILES+=usr/tests/sys/kqueue/kqtest
+OLD_FILES+=usr/tests/sys/kqueue/kqueue_test
# 20160703: POSIXify locales with variants
OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE
OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -78,7 +78,11 @@ ATF_TC_BODY(fifo, tc)
RL(n = kevent(kq, NULL, 0, event, 1, NULL));
(void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, "
+#ifdef __FreeBSD__
+ "data: %" PRIdPTR "\n", n, event[0].filter, event[0].flags,
+#else
"data: %" PRId64 "\n", n, event[0].filter, event[0].flags,
+#endif
event[0].fflags, event[0].data);
ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ);
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -111,7 +111,11 @@ ATF_TC_BODY(file, tc)
num += n;
(void)printf("kevent num %d flags: %#x, fflags: %#x, data: "
+#ifdef __FreeBSD__
+ "%" PRIdPTR "\n", n, event[0].flags, event[0].fflags,
+#else
"%" PRId64 "\n", n, event[0].flags, event[0].fflags,
+#endif
event[0].data);
if (event[0].data < 0)
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -67,7 +67,11 @@ ATF_TC_BODY(pipe, tc)
RL(n = kevent(kq, NULL, 0, event, 1, NULL));
(void)printf("kevent num %d flags: %#x, fflags: %#x, data: "
+#ifdef __FreeBSD__
+ "%" PRIdPTR "\n", n, event[0].flags, event[0].fflags, event[0].data);
+#else
"%" PRId64 "\n", n, event[0].flags, event[0].fflags, event[0].data);
+#endif
RL(n = read(fds[0], buffer, event[0].data));
buffer[n] = '\0';
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -103,7 +103,11 @@ h_check(bool check_master)
RL(n = kevent(kq, NULL, 0, event, 1, NULL));
(void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, "
+#ifdef __FreeBSD__
+ "data: %" PRIdPTR "\n", n, event[0].filter, event[0].flags,
+#else
"data: %" PRId64 "\n", n, event[0].filter, event[0].flags,
+#endif
event[0].fflags, event[0].data);
ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ);
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -139,7 +139,11 @@ ATF_TC_BODY(proc1, tc)
printf(" NOTE_FORK");
}
if (event[0].fflags & NOTE_CHILD)
+#ifdef __FreeBSD__
+ printf(" NOTE_CHILD, parent = %" PRIdPTR, event[0].data);
+#else
printf(" NOTE_CHILD, parent = %" PRId64, event[0].data);
+#endif
printf("\n");
}
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif
#include <sys/event.h>
#include <sys/time.h>
#include <sys/types.h>
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -32,6 +32,9 @@
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif
#include <sys/event.h>
#include <sys/time.h>
#include <sys/types.h>
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $");
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif
#include <sys/event.h>
#include <sys/ioctl.h>
#include <sys/param.h>
@@ -60,9 +63,13 @@ ATF_TC_HEAD(sig, tc)
ATF_TC_BODY(sig, tc)
{
struct timespec timeout;
+#ifdef __NetBSD__
struct kfilter_mapping km;
+#endif
struct kevent event[1];
+#ifdef __NetBSD__
char namebuf[32];
+#endif
pid_t pid, child;
int kq, n, num, status;
@@ -84,16 +91,22 @@ ATF_TC_BODY(sig, tc)
RL(kq = kqueue());
+#ifdef __NetBSD__
(void)strlcpy(namebuf, "EVFILT_SIGNAL", sizeof(namebuf));
km.name = namebuf;
RL(ioctl(kq, KFILTER_BYNAME, &km));
(void)printf("got %d as filter number for `%s'.\n", km.filter, km.name);
+#endif
/* ignore the signal to avoid taking it for real */
REQUIRE_LIBC(signal(SIGUSR1, SIG_IGN), SIG_ERR);
event[0].ident = SIGUSR1;
+#ifdef __NetBSD__
event[0].filter = km.filter;
+#else
+ event[0].filter = EVFILT_SIGNAL;
+#endif
event[0].flags = EV_ADD | EV_ENABLE;
RL(kevent(kq, event, 1, NULL, 0, NULL));
@@ -117,7 +130,11 @@ ATF_TC_BODY(sig, tc)
if (n == 0)
continue;
+#ifdef __FreeBSD__
+ (void)printf("sig: kevent flags: 0x%x, data: %" PRIdPTR " (# "
+#else
(void)printf("sig: kevent flags: 0x%x, data: %" PRId64 " (# "
+#endif
"times signal posted)\n", event[0].flags, event[0].data);
}
Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c
==============================================================================
--- stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c Sat Dec 3 02:55:19 2016 (r309469)
@@ -1,3 +1,6 @@
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif
#include <sys/event.h>
#include <sys/stat.h>
#include <sys/time.h>
Modified: stable/11/etc/mtree/BSD.tests.dist
==============================================================================
--- stable/11/etc/mtree/BSD.tests.dist Sat Dec 3 02:48:55 2016 (r309468)
+++ stable/11/etc/mtree/BSD.tests.dist Sat Dec 3 02:55:19 2016 (r309469)
@@ -419,6 +419,8 @@
..
..
kqueue
+ libkqueue
+ ..
..
mac
bsdextended
Copied and modified: stable/11/tests/sys/kqueue/Makefile (from r305467, head/tests/sys/kqueue/Makefile)
==============================================================================
--- head/tests/sys/kqueue/Makefile Tue Sep 6 08:45:29 2016 (r305467, copy source)
+++ stable/11/tests/sys/kqueue/Makefile Sat Dec 3 02:55:19 2016 (r309469)
@@ -1,8 +1,20 @@
# $FreeBSD$
+TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel/kqueue
+
TESTSDIR= ${TESTSBASE}/sys/kqueue
BINDIR= ${TESTSDIR}
+NETBSD_ATF_TESTS_C= proc1_test
+# XXX: fails `ke.fflags & NOTE_TRACKERR` invariant
+#NETBSD_ATF_TESTS_C+= proc2_test
+NETBSD_ATF_TESTS_C+= proc3_test
+NETBSD_ATF_TESTS_C+= sig_test
+NETBSD_ATF_TESTS_C+= vnode_test
+
+WARNS?= 3
+
TESTS_SUBDIRS+= libkqueue
+.include <netbsd-tests.test.mk>
.include <bsd.test.mk>
More information about the svn-src-stable
mailing list