Source-Changes-HG archive

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

[src/trunk]: src/tests/fs add test for PR kern/43503



details:   https://anonhg.NetBSD.org/src/rev/f4b128700c52
branches:  trunk
changeset: 755911:f4b128700c52
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Jun 28 09:45:06 2010 +0000

description:
add test for PR kern/43503

diffstat:

 tests/fs/Makefile     |   4 +-
 tests/fs/lfs/Atffile  |   6 +++++
 tests/fs/lfs/Makefile |  13 ++++++++++
 tests/fs/lfs/t_pr.c   |  61 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 82 insertions(+), 2 deletions(-)

diffs (108 lines):

diff -r 87005c877f5d -r f4b128700c52 tests/fs/Makefile
--- a/tests/fs/Makefile Mon Jun 28 01:43:39 2010 +0000
+++ b/tests/fs/Makefile Mon Jun 28 09:45:06 2010 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.10 2010/06/14 14:51:41 pooka Exp $
+# $NetBSD: Makefile,v 1.11 2010/06/28 09:45:06 pooka Exp $
 
 .include <bsd.own.mk>
 
 TESTSDIR=      ${TESTSBASE}/fs
 
-SUBDIR+=       ffs kernfs msdosfs nullfs ptyfs puffs tmpfs umapfs union
+SUBDIR+=       ffs kernfs lfs msdosfs nullfs ptyfs puffs tmpfs umapfs union
 
 FILES= h_funcs.subr
 FILESDIR= ${TESTSDIR}
diff -r 87005c877f5d -r f4b128700c52 tests/fs/lfs/Atffile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fs/lfs/Atffile      Mon Jun 28 09:45:06 2010 +0000
@@ -0,0 +1,6 @@
+Content-Type: application/X-atf-atffile; version="1"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2010/06/28 09:45:06 pooka Exp $"
+
+prop: test-suite = "NetBSD"
+
+tp-glob: t_*
diff -r 87005c877f5d -r f4b128700c52 tests/fs/lfs/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fs/lfs/Makefile     Mon Jun 28 09:45:06 2010 +0000
@@ -0,0 +1,13 @@
+#      $NetBSD: Makefile,v 1.1 2010/06/28 09:45:06 pooka Exp $
+#
+
+TESTSDIR=      ${TESTSBASE}/fs/lfs
+WARNS=         4
+
+TESTS_C=       t_pr
+
+LDADD+=-lrumpfs_lfs -lrumpfs_ffs                               # fs drivers
+LDADD+=-lrumpdev_disk -lrumpdev                                        # disk device
+LDADD+=-lrumpvfs -lrump -lrumpuser -lpthread                   # base
+
+.include <bsd.test.mk>
diff -r 87005c877f5d -r f4b128700c52 tests/fs/lfs/t_pr.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fs/lfs/t_pr.c       Mon Jun 28 09:45:06 2010 +0000
@@ -0,0 +1,61 @@
+/*     $NetBSD: t_pr.c,v 1.1 2010/06/28 09:45:06 pooka Exp $   */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+
+#include <atf-c.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include <ufs/ufs/ufsmount.h>
+
+#include "../../h_macros.h"
+
+ATF_TC(mknod);
+ATF_TC_HEAD(mknod, tc)
+{
+
+       atf_tc_set_md_var(tc, "descr", "mknod(2) hangs on LFS (PR kern/43503)");
+       atf_tc_set_md_var(tc, "timeout", "1");
+       atf_tc_set_md_var(tc, "use.fs", "true");
+       //atf_tc_set_md_var(tc, "xfail", "PR kern/43503");
+}
+
+#define IMGNAME "disk.img"
+#define FAKEBLK "/dev/blk"
+ATF_TC_BODY(mknod, tc)
+{
+       struct ufs_args args;
+
+       /* hmm, maybe i should fix newfs_lfs instead? */
+       if (system("newfs_lfs -D -F -s 10000 ./" IMGNAME) == -1)
+               atf_tc_fail_errno("newfs failed");
+
+       memset(&args, 0, sizeof(args));
+       args.fspec = __UNCONST(FAKEBLK);
+
+       rump_init();
+       if (rump_sys_mkdir("/mp", 0777) == -1)
+               atf_tc_fail_errno("cannot create mountpoint");
+       rump_pub_etfs_register(FAKEBLK, IMGNAME, RUMP_ETFS_BLK);
+       if (rump_sys_mount(MOUNT_LFS, "/mp", 0, &args, sizeof(args)) == -1)
+               atf_tc_fail_errno("rump_sys_mount failed");
+
+       if (rump_sys_mknod("/mp/node", S_IFCHR | 0777, 0) == -1)
+               atf_tc_fail_errno("mknod failed");
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+       ATF_TP_ADD_TC(tp, mknod);
+       return 0;
+}



Home | Main Index | Thread Index | Old Index