Module Name:    src
Committed By:   pooka
Date:           Sun Apr 26 15:15:38 UTC 2009

Modified Files:
        src/tests/fs/ffs: Makefile t_renamerace.c
        src/tests/fs/tmpfs: Makefile t_renamerace.c

Log Message:
Use rump_sys_mount() instead of ukfs_mount().  Just a few more
steps and we can have a switch for if we want to run tests against
a rump kernel or a real kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/ffs/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/ffs/t_renamerace.c
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/tmpfs/Makefile
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/tmpfs/t_renamerace.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/fs/ffs/Makefile
diff -u src/tests/fs/ffs/Makefile:1.2 src/tests/fs/ffs/Makefile:1.3
--- src/tests/fs/ffs/Makefile:1.2	Tue Apr 14 10:20:22 2009
+++ src/tests/fs/ffs/Makefile	Sun Apr 26 15:15:38 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2009/04/14 10:20:22 pooka Exp $
+#	$NetBSD: Makefile,v 1.3 2009/04/26 15:15:38 pooka Exp $
 #
 
 TESTSDIR=	${TESTSBASE}/fs/ffs
@@ -6,7 +6,7 @@
 
 TESTS_C=	t_renamerace
 
-LDADD.t_renamerace+=	-lukfs -lrumpfs_ffs -lrumpfs_ufs -lrumpvfs -lrump
+LDADD.t_renamerace+=	-lrumpfs_ffs -lrumpfs_ufs -lrumpvfs -lrump
 LDADD.t_renamerace+=	-lrumpuser -lpthread
 
 .include <bsd.test.mk>

Index: src/tests/fs/ffs/t_renamerace.c
diff -u src/tests/fs/ffs/t_renamerace.c:1.3 src/tests/fs/ffs/t_renamerace.c:1.4
--- src/tests/fs/ffs/t_renamerace.c:1.3	Tue Apr 14 10:19:39 2009
+++ src/tests/fs/ffs/t_renamerace.c	Sun Apr 26 15:15:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.3 2009/04/14 10:19:39 pooka Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.4 2009/04/26 15:15:38 pooka Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -19,7 +19,6 @@
 
 #include <rump/rump.h>
 #include <rump/rump_syscalls.h>
-#include <rump/ukfs.h>
 
 #include <ufs/ufs/ufsmount.h>
 
@@ -66,7 +65,6 @@
 {
 	struct ufs_args args;
 	char cmd[256];
-	struct ukfs *fs;
 	pthread_t pt1, pt2;
 
 #if 0
@@ -87,14 +85,12 @@
 	memset(&args, 0, sizeof(args));
 	args.fspec = image;
 
-	ukfs_init();
-	fs = ukfs_mount(MOUNT_FFS, "ffs", UKFS_DEFAULTMP,
-	    MNT_LOG, &args, sizeof(args));
-	if (fs == NULL)
+	rump_init();
+	if (rump_sys_mount(MOUNT_FFS, "/", MNT_LOG, &args, sizeof(args)) == -1)
 		atf_tc_fail_errno("ukfs_mount failed");
 
-	pthread_create(&pt1, NULL, w1, fs);
-	pthread_create(&pt2, NULL, w2, fs);
+	pthread_create(&pt1, NULL, w1, NULL);
+	pthread_create(&pt2, NULL, w2, NULL);
 
 	sleep(10);
 
@@ -102,7 +98,7 @@
 	pthread_join(pt1, NULL);
 	pthread_join(pt2, NULL);
 
-	ukfs_release(fs, 0);
+	rump_sys_unmount("/", MNT_FORCE); /* XXX: MNT_FORCE */
 }
 
 ATF_TC_CLEANUP(renamerace, tc)

Index: src/tests/fs/tmpfs/Makefile
diff -u src/tests/fs/tmpfs/Makefile:1.4 src/tests/fs/tmpfs/Makefile:1.5
--- src/tests/fs/tmpfs/Makefile:1.4	Tue Apr 14 10:20:22 2009
+++ src/tests/fs/tmpfs/Makefile	Sun Apr 26 15:15:38 2009
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2009/04/14 10:20:22 pooka Exp $
+# $NetBSD: Makefile,v 1.5 2009/04/26 15:15:38 pooka Exp $
 
 TESTSDIR=	${TESTSBASE}/fs/tmpfs
 WARNS=		4
@@ -31,7 +31,7 @@
 
 TESTS_C+=	t_renamerace
 
-LDADD.t_renamerace+= -lukfs -lrumpfs_tmpfs -lrumpvfs -lrump -lrumpuser -lpthread
+LDADD.t_renamerace+= -lrumpfs_tmpfs -lrumpvfs -lrump -lrumpuser -lpthread
 
 FILES=		h_funcs.subr
 FILESDIR=	${TESTSDIR}

Index: src/tests/fs/tmpfs/t_renamerace.c
diff -u src/tests/fs/tmpfs/t_renamerace.c:1.5 src/tests/fs/tmpfs/t_renamerace.c:1.6
--- src/tests/fs/tmpfs/t_renamerace.c:1.5	Tue Apr 14 10:19:39 2009
+++ src/tests/fs/tmpfs/t_renamerace.c	Sun Apr 26 15:15:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.5 2009/04/14 10:19:39 pooka Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.6 2009/04/26 15:15:38 pooka Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -18,7 +18,6 @@
 
 #include <rump/rump.h>
 #include <rump/rump_syscalls.h>
-#include <rump/ukfs.h>
 
 #include <fs/tmpfs/tmpfs_args.h>
 
@@ -58,21 +57,18 @@
 ATF_TC_BODY(renamerace, tc)
 {
 	struct tmpfs_args args;
-	struct ukfs *fs;
 	pthread_t pt1, pt2;
 
 	memset(&args, 0, sizeof(args));
 	args.ta_version = TMPFS_ARGS_VERSION;
 	args.ta_root_mode = 0777;
 
-	ukfs_init();
-	fs = ukfs_mount(MOUNT_TMPFS, "tmpfs", UKFS_DEFAULTMP, 0,
-	    &args, sizeof(args));
-	if (fs == NULL)
+	rump_init();
+	if (rump_sys_mount(MOUNT_TMPFS, "/", 0, &args, sizeof(args)) == -1)
 		atf_tc_fail_errno("could not mount tmpfs");
 
-	pthread_create(&pt1, NULL, w1, fs);
-	pthread_create(&pt2, NULL, w2, fs);
+	pthread_create(&pt1, NULL, w1, NULL);
+	pthread_create(&pt2, NULL, w2, NULL);
 
 	sleep(10);
 }

Reply via email to