Source-Changes-HG archive

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

[src/trunk]: src/tests/kernel Add expected failure test for posix_fadvise() p...



details:   https://anonhg.NetBSD.org/src/rev/403a5fc874d9
branches:  trunk
changeset: 758619:403a5fc874d9
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Nov 11 14:50:58 2010 +0000

description:
Add expected failure test for posix_fadvise() panic reported by yamt
on source-changes-d.

diffstat:

 tests/kernel/t_posix_fadvise.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r 7383581e80a9 -r 403a5fc874d9 tests/kernel/t_posix_fadvise.c
--- a/tests/kernel/t_posix_fadvise.c    Thu Nov 11 14:50:54 2010 +0000
+++ b/tests/kernel/t_posix_fadvise.c    Thu Nov 11 14:50:58 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_posix_fadvise.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
+/* $NetBSD: t_posix_fadvise.c,v 1.2 2010/11/11 14:50:58 pooka Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_posix_fadvise.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
+__RCSID("$NetBSD: t_posix_fadvise.c,v 1.2 2010/11/11 14:50:58 pooka Exp $");
 
 #include <sys/fcntl.h>
 
@@ -70,6 +70,9 @@
 
 #include "../h_macros.h"
 
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
 ATF_TC(posix_fadvise);
 ATF_TC_HEAD(posix_fadvise, tc)
 {
@@ -80,11 +83,15 @@
        int fd = STDIN_FILENO;
        int pipe_fds[2];
        int badfd = 10;
+       int rfd;
        int ret;
 
        (void)close(badfd);
        RL(pipe(pipe_fds));
 
+       rump_init();
+       RL(rfd = rump_sys_open("/a_file", O_CREAT, 0666));
+
        /*
         * it's hard to check if posix_fadvise is working properly.
         * only check return values here.
@@ -110,6 +117,8 @@
        CE(posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED), 0);
        CE(posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED), 0);
        CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE), 0);
+       atf_tc_expect_signal(-1, "http://mail-index.netbsd.org/source-changes-d/2010/11/11/msg002508.html";);
+       CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_DONTNEED), 0);
 #undef CE
 }
 



Home | Main Index | Thread Index | Old Index