Module Name: src Committed By: pooka Date: Thu Nov 11 14:50:58 UTC 2010
Modified Files: src/tests/kernel: t_posix_fadvise.c Log Message: Add expected failure test for posix_fadvise() panic reported by yamt on source-changes-d. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/kernel/t_posix_fadvise.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/kernel/t_posix_fadvise.c diff -u src/tests/kernel/t_posix_fadvise.c:1.1 src/tests/kernel/t_posix_fadvise.c:1.2 --- src/tests/kernel/t_posix_fadvise.c:1.1 Fri Feb 20 21:39:57 2009 +++ src/tests/kernel/t_posix_fadvise.c Thu Nov 11 14:50:58 2010 @@ -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 }