Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/puffs Add test case for PR kern/44093 (fixed alread...



details:   https://anonhg.NetBSD.org/src/rev/8df037aa0900
branches:  trunk
changeset: 758790:8df037aa0900
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Nov 15 20:39:00 2010 +0000

description:
Add test case for PR kern/44093 (fixed already, but tested to fail
without fix applied).

diffstat:

 tests/fs/puffs/t_basic.c |  47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 1 deletions(-)

diffs (67 lines):

diff -r 55390c92f1a4 -r 8df037aa0900 tests/fs/puffs/t_basic.c
--- a/tests/fs/puffs/t_basic.c  Mon Nov 15 20:37:21 2010 +0000
+++ b/tests/fs/puffs/t_basic.c  Mon Nov 15 20:39:00 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_basic.c,v 1.8 2010/08/27 05:34:46 pooka Exp $        */
+/*     $NetBSD: t_basic.c,v 1.9 2010/11/15 20:39:00 pooka Exp $        */
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -391,6 +391,49 @@
        FSTEST_DESTRUCTOR(tc, puffs, args);
 }
 
+ATF_TC(signals);
+ATF_TC_HEAD(signals, tc)
+{
+
+       atf_tc_set_md_var(tc, "descr", "Checks that sending a signal can "
+           "cause an interrupt to puffs wait");
+}
+
+extern struct proc *rumpns_initproc;
+extern void rumpns_psignal(struct proc *, int);
+extern void rumpns_sigclearall(struct proc *, void *, void *);
+ATF_TC_BODY(signals, tc)
+{
+       struct stat sb;
+       void *args;
+
+       rump_boot_setsigmodel(RUMP_SIGMODEL_RECORD);
+
+       FSTEST_CONSTRUCTOR(tc, puffs, args);
+       FSTEST_ENTER();
+       RL(rump_sys_stat(".", &sb));
+
+       /* send SIGUSR1, should not affect puffs ops */
+       rump_schedule();
+       rumpns_psignal(rumpns_initproc, SIGUSR1);
+       rump_unschedule();
+       RL(rump_sys_stat(".", &sb));
+
+       /* send SIGTERM, should get EINTR */
+       rump_schedule();
+       rumpns_psignal(rumpns_initproc, SIGTERM);
+       rump_unschedule();
+       ATF_REQUIRE_ERRNO(EINTR, rump_sys_stat(".", &sb) == -1);
+
+       /* clear sigmask so that we can unmount */
+       rump_schedule();
+       rumpns_sigclearall(rumpns_initproc, NULL, NULL);
+       rump_unschedule();
+
+       FSTEST_EXIT();
+       FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
@@ -406,5 +449,7 @@
        ATF_TP_ADD_TC(tp, reclaim_hardlink);
        ATF_TP_ADD_TC(tp, unlink_accessible);
 
+       ATF_TP_ADD_TC(tp, signals);
+
        return atf_no_error();
 }



Home | Main Index | Thread Index | Old Index