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 problem described by yamt i...
details: https://anonhg.NetBSD.org/src/rev/c7aa11d51d6b
branches: trunk
changeset: 758669:c7aa11d51d6b
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Nov 12 17:33:28 2010 +0000
description:
Add test case for problem described by yamt in PR kern/44086.
"large writes with PUFFS_KFLAG_NOCACHE_PAGE ends up with EIO"
diffstat:
tests/fs/puffs/Makefile | 6 +++-
tests/fs/puffs/t_io.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+), 2 deletions(-)
diffs (92 lines):
diff -r 2c4542d4c5e1 -r c7aa11d51d6b tests/fs/puffs/Makefile
--- a/tests/fs/puffs/Makefile Fri Nov 12 17:31:41 2010 +0000
+++ b/tests/fs/puffs/Makefile Fri Nov 12 17:33:28 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2010/07/31 17:11:45 pooka Exp $
+# $NetBSD: Makefile,v 1.12 2010/11/12 17:33:28 pooka Exp $
#
.include <bsd.own.mk>
@@ -9,6 +9,7 @@
TESTS_C= t_basic
TESTS_C+= t_fuzz
+TESTS_C+= t_io
VFSTESTDIR != cd ${.CURDIR}/../common && ${PRINTOBJDIR}
LDADD+=-L${VFSTESTDIR} -lvfstest
@@ -20,7 +21,8 @@
LDADD+= -lrump -lrumpuser -lpthread
# required by -DPUFFSDUMP
-#LDADD+= -lpuffs -lutil
+LDADD+= -lpuffs -lutil
+CPPFLAGS+= -I/home/pooka/src/curpuffs/libpuffs
WARNS=2
diff -r 2c4542d4c5e1 -r c7aa11d51d6b tests/fs/puffs/t_io.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fs/puffs/t_io.c Fri Nov 12 17:33:28 2010 +0000
@@ -0,0 +1,61 @@
+/* $NetBSD: t_io.c,v 1.1 2010/11/12 17:33:28 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <puffs.h>
+#include <puffsdump.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+#include "../common/h_fsmacros.h"
+
+#define MAKEOPTS(...) \
+ char *theopts[] = {NULL, "-s", __VA_ARGS__, "dtfs", "n/a", NULL}
+
+ATF_TC(nocache);
+ATF_TC_HEAD(nocache, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests large i/o without page cache");
+}
+
+ATF_TC_BODY(nocache, tc)
+{
+ MAKEOPTS("-o", "nopagecache");
+ char data[1024*1024];
+ void *args;
+ int fd;
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+ FSTEST_ENTER();
+
+ RL(fd = rump_sys_open("afile", O_CREAT | O_RDWR, 0755));
+ RL(rump_sys_write(fd, data, sizeof(data)));
+ rump_sys_close(fd);
+
+ FSTEST_EXIT();
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, nocache);
+
+ return atf_no_error();
+}
Home |
Main Index |
Thread Index |
Old Index