Source-Changes-HG archive

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

[src/trunk]: src/tests/kernel/kqueue In the "modify" test case, immediately a...



details:   https://anonhg.NetBSD.org/src/rev/b156dce21461
branches:  trunk
changeset: 989977:b156dce21461
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Oct 22 13:53:20 2021 +0000

description:
In the "modify" test case, immediately after modifying the timer, validate
that its associated knote in the kernel has actually been deactivated.

diffstat:

 tests/kernel/kqueue/t_timer.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 38b4c4215131 -r b156dce21461 tests/kernel/kqueue/t_timer.c
--- a/tests/kernel/kqueue/t_timer.c     Fri Oct 22 13:32:28 2021 +0000
+++ b/tests/kernel/kqueue/t_timer.c     Fri Oct 22 13:53:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_timer.c,v 1.2 2021/10/22 04:49:24 thorpej Exp $ */
+/* $NetBSD: t_timer.c,v 1.3 2021/10/22 13:53:20 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_timer.c,v 1.2 2021/10/22 04:49:24 thorpej Exp $");
+__RCSID("$NetBSD: t_timer.c,v 1.3 2021/10/22 13:53:20 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/event.h>
@@ -208,6 +208,12 @@
        EV_SET(&event[0], 1, EVFILT_TIMER, EV_ADD, 0, 4000, NULL);
        ATF_REQUIRE(kevent(kq, event, 1, NULL, 0, NULL) == 0);
 
+       /*
+        * Before we sleep, verify that the knote for this timer is
+        * no longer activated.
+        */
+       ATF_REQUIRE(kevent(kq, NULL, 0, event, 1, &ts) == 0);
+
        sleepts.tv_sec = 5;
        sleepts.tv_nsec = 0;
        ATF_REQUIRE(nanosleep(&sleepts, NULL) == 0);



Home | Main Index | Thread Index | Old Index