CVS commit: src/tests/fs/union

2017-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr 14 01:30:38 UTC 2017

Modified Files:
src/tests/fs/union: t_pr.c

Log Message:
Gotta mark crashes on signal separately from failures...


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/fs/union/t_pr.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/union/t_pr.c
diff -u src/tests/fs/union/t_pr.c:1.11 src/tests/fs/union/t_pr.c:1.12
--- src/tests/fs/union/t_pr.c:1.11	Wed Apr 12 15:12:55 2017
+++ src/tests/fs/union/t_pr.c	Fri Apr 14 01:30:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pr.c,v 1.11 2017/04/12 15:12:55 riastradh Exp $	*/
+/*	$NetBSD: t_pr.c,v 1.12 2017/04/14 01:30:38 riastradh Exp $	*/
 
 #include 
 #include 
@@ -63,7 +63,7 @@ ATF_TC_BODY(multilayer2, tc)
 {
 	struct union_args unionargs;
 
-	atf_tc_expect_fail("PR kern/2423");
+	atf_tc_expect_signal(-1, "PR kern/2423");
 
 	rump_init();
 
@@ -103,7 +103,7 @@ ATF_TC_BODY(cyclic, tc)
 {
 	struct union_args unionargs;
 
-	atf_tc_expect_fail("PR kern/3645");
+	atf_tc_expect_signal(-1, "PR kern/3645");
 
 	rump_init();
 
@@ -133,7 +133,7 @@ ATF_TC_BODY(cyclic2, tc)
 {
 	struct union_args unionargs;
 
-	atf_tc_expect_fail("PR kern/4597");
+	atf_tc_expect_signal(-1, "PR kern/4597");
 
 	rump_init();
 



CVS commit: src/tests/fs/union

2017-03-26 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Mar 26 18:26:05 UTC 2017

Modified Files:
src/tests/fs/union: t_pr.c

Log Message:
Add failing test cases for PRs kern/2423, kern/3645, kern/4597


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/fs/union/t_pr.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/union/t_pr.c
diff -u src/tests/fs/union/t_pr.c:1.9 src/tests/fs/union/t_pr.c:1.10
--- src/tests/fs/union/t_pr.c:1.9	Fri Jan 13 21:30:40 2017
+++ src/tests/fs/union/t_pr.c	Sun Mar 26 18:26:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pr.c,v 1.9 2017/01/13 21:30:40 christos Exp $	*/
+/*	$NetBSD: t_pr.c,v 1.10 2017/03/26 18:26:05 maya Exp $	*/
 
 #include 
 #include 
@@ -53,6 +53,109 @@ ATF_TC_BODY(multilayer, tc)
 	rump_sys_mount(MOUNT_UNION, "/Tunion", 0,,sizeof(unionargs));
 }
 
+ATF_TC(multilayer2);
+ATF_TC_HEAD(multilayer2, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "mount_union twice then unmount");
+}
+
+ATF_TC_BODY(multilayer2, tc)
+{
+	struct union_args unionargs;
+
+	rump_init();
+
+	if (rump_sys_mkdir("/Tunion", 0777) == -1)
+		atf_tc_fail_errno("mkdir mp1");
+	if (rump_sys_mkdir("/Tunion2", 0777) == -1)
+		atf_tc_fail_errno("mkdir mp2");
+	if (rump_sys_mkdir("/Tunion2/A", 0777) == -1)
+		atf_tc_fail_errno("mkdir A");
+	if (rump_sys_mkdir("/Tunion2/B", 0777) == -1)
+		atf_tc_fail_errno("mkdir B");
+
+	unionargs.target = __UNCONST("/Tunion2/A");
+	unionargs.mntflags = UNMNT_ABOVE;
+
+	if (rump_sys_mount(MOUNT_UNION, "/Tunion", 0,
+	, sizeof(unionargs)) == -1)
+		atf_tc_fail_errno("union mount");
+	if (rump_sys_mkdir("/Tunion2/A/A", 0777) == -1)
+		atf_tc_fail_errno("mkdir A/A");
+
+	unionargs.target = __UNCONST("/Tunion2/A/A");
+	unionargs.mntflags = UNMNT_ABOVE;
+
+	rump_sys_mount(MOUNT_UNION, "/Tunion", 0,,sizeof(unionargs));
+
+	rump_sys_unmount("/Tunion/A", 0);
+}
+
+ATF_TC(cyclic);
+ATF_TC_HEAD(cyclic, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "cyclic mount_union");
+}
+
+ATF_TC_BODY(cyclic, tc)
+{
+	struct union_args unionargs;
+
+	rump_init();
+
+	if (rump_sys_mkdir("/Tunion", 0777) == -1)
+		atf_tc_fail_errno("mkdir mp1");
+	if (rump_sys_mkdir("/Tunion/A", 0777) == -1)
+		atf_tc_fail_errno("mkdir mp2");
+
+	unionargs.target = __UNCONST("/Tunion/A");
+	unionargs.mntflags = UNMNT_ABOVE;
+
+	if (rump_sys_mount(MOUNT_UNION, "/Tunion/A", 0,
+	, sizeof(unionargs)) == -1)
+		atf_tc_fail_errno("union mount");
+
+	if (rump_sys_mkdir("/Tunion/A/A", 0777) == -1)
+		atf_tc_fail_errno("mkdir failed");
+}
+
+ATF_TC(cyclic2);
+ATF_TC_HEAD(cyclic2, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "cyclic mount_union");
+}
+
+ATF_TC_BODY(cyclic2, tc)
+{
+	struct union_args unionargs;
+
+	rump_init();
+
+	if (rump_sys_mkdir("/Tunion", 0777) == -1)
+		atf_tc_fail_errno("mkdir mp1");
+	if (rump_sys_mkdir("/Tunion/A", 0777) == -1)
+		atf_tc_fail_errno("mkdir mp2");
+	if (rump_sys_mkdir("/Tunion/B", 0777) == -1)
+		atf_tc_fail_errno("mkdir mp3");
+
+	unionargs.target = __UNCONST("/Tunion/A");
+	unionargs.mntflags = UNMNT_ABOVE;
+
+	if (rump_sys_mount(MOUNT_UNION, "/Tunion/B", 0,
+	, sizeof(unionargs)) == -1)
+		atf_tc_fail_errno("union mount");
+
+	unionargs.target = __UNCONST("/Tunion/B");
+	unionargs.mntflags = UNMNT_ABOVE;
+
+	if (rump_sys_mount(MOUNT_UNION, "/Tunion/A", 0,
+	, sizeof(unionargs)) == -1)
+		atf_tc_fail_errno("union mount2");
+
+	if (rump_sys_mkdir("/Tunion/A/A", 0777) == -1)
+		atf_tc_fail_errno("mkdir failed");
+}
+
 ATF_TC(devnull1);
 ATF_TC_HEAD(devnull1, tc)
 {
@@ -123,6 +226,9 @@ ATF_TC_BODY(devnull2, tc)
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, multilayer);
+	ATF_TP_ADD_TC(tp, multilayer2);
+	ATF_TP_ADD_TC(tp, cyclic);
+	ATF_TP_ADD_TC(tp, cyclic2);
 	ATF_TP_ADD_TC(tp, devnull1);
 	ATF_TP_ADD_TC(tp, devnull2);
 



CVS commit: src/tests/fs/union

2011-01-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jan 12 17:16:24 UTC 2011

Modified Files:
src/tests/fs/union: t_basic.c

Log Message:
Simplify test: there's no reason to mount 2x ffs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/union/t_basic.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/union/t_basic.c
diff -u src/tests/fs/union/t_basic.c:1.5 src/tests/fs/union/t_basic.c:1.6
--- src/tests/fs/union/t_basic.c:1.5	Sun Nov  7 17:51:18 2010
+++ src/tests/fs/union/t_basic.c	Wed Jan 12 17:16:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_basic.c,v 1.5 2010/11/07 17:51:18 jmmv Exp $	*/
+/*	$NetBSD: t_basic.c,v 1.6 2011/01/12 17:16:24 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -59,9 +59,7 @@
 }
 
 #define IMG1 atf1.img
-#define IMG2 atf2.img
 #define DEV1 /dev/fs1
-#define DEV2 /dev/fs2
 #define newfs_base newfs -F -s 1 
 
 ATF_TC_BODY(basic, tc)
@@ -72,12 +70,9 @@
 
 	if (system(newfs_base IMG1) == -1)
 		atf_tc_fail_errno(create img1);
-	if (system(newfs_base IMG2) == -1)
-		atf_tc_fail_errno(create img2);
 
 	rump_init();
-rump_pub_etfs_register(DEV1, IMG1, RUMP_ETFS_BLK);
-rump_pub_etfs_register(DEV2, IMG2, RUMP_ETFS_BLK);
+	rump_pub_etfs_register(DEV1, IMG1, RUMP_ETFS_BLK);
 
 	if (rump_sys_mkdir(/mp1, 0777) == -1)
 		atf_tc_fail_errno(mp1);
@@ -89,11 +84,6 @@
 	if (rump_sys_mount(MOUNT_FFS, /mp1, 0, args, sizeof(args)) == -1)
 		atf_tc_fail_errno(could not mount ffs1);
 
-	memset(args, 0, sizeof(args));
-	args.fspec = __UNCONST(DEV2);
-	if (rump_sys_mount(MOUNT_FFS, /mp2, 0, args, sizeof(args)) == -1)
-		atf_tc_fail_errno(could not mount tmpfs2);
-
 	xput_tfile(/mp1/tensti);
 	memset(unionargs, 0, sizeof(unionargs));
 



CVS commit: src/tests/fs/union

2010-07-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Jul  3 12:08:37 UTC 2010

Modified Files:
src/tests/fs/union: t_pr.c

Log Message:
Add xfail tests for two cases described in PR kern/43560.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/union/t_pr.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/union/t_pr.c
diff -u src/tests/fs/union/t_pr.c:1.3 src/tests/fs/union/t_pr.c:1.4
--- src/tests/fs/union/t_pr.c:1.3	Sat Jul  3 08:18:30 2010
+++ src/tests/fs/union/t_pr.c	Sat Jul  3 12:08:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pr.c,v 1.3 2010/07/03 08:18:30 jmmv Exp $	*/
+/*	$NetBSD: t_pr.c,v 1.4 2010/07/03 12:08:37 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -71,9 +71,74 @@
 	rump_sys_mount(MOUNT_UNION, /Tunion, 0,unionargs,sizeof(unionargs));
 }
 
+ATF_TC(devnull1);
+ATF_TC_HEAD(devnull1, tc)
+{
+	atf_tc_set_md_var(tc, descr, mount_union -b and 
+	'echo x  /un/null');
+}
+
+ATF_TC_BODY(devnull1, tc)
+{
+	struct union_args unionargs;
+	int fd;
+
+	rump_init();
+
+	if (rump_sys_mkdir(/mp, 0777) == -1)
+		atf_tc_fail_errno(mkdir mp);
+
+	unionargs.target = __UNCONST(/dev);
+	unionargs.mntflags = UNMNT_BELOW;
+
+	if (rump_sys_mount(MOUNT_UNION, /mp, 0,
+	unionargs, sizeof(unionargs)) == -1)
+		atf_tc_fail_errno(union mount);
+
+	fd = rump_sys_open(/mp/null, O_WRONLY | O_CREAT | O_TRUNC);
+
+	atf_tc_expect_fail(PR kern/43560);
+	if (fd == -1)
+		atf_tc_fail_errno(open);
+}
+
+ATF_TC(devnull2);
+ATF_TC_HEAD(devnull2, tc)
+{
+	atf_tc_set_md_var(tc, descr, mount_union -b and 
+	'echo x  /un/null');
+}
+
+ATF_TC_BODY(devnull2, tc)
+{
+	struct union_args unionargs;
+	int fd;
+
+	rump_init();
+
+	if (rump_sys_mkdir(/mp, 0777) == -1)
+		atf_tc_fail_errno(mkdir mp);
+
+	unionargs.target = __UNCONST(/dev);
+	unionargs.mntflags = UNMNT_BELOW;
+
+	if (rump_sys_mount(MOUNT_UNION, /mp, 0,
+	unionargs, sizeof(unionargs)) == -1)
+		atf_tc_fail_errno(union mount);
+
+	fd = rump_sys_open(/mp/null, O_WRONLY | O_CREAT | O_APPEND);
+	if (fd == -1)
+		atf_tc_fail_errno(open);
+
+	atf_tc_expect_signal(-1, PR kern/43560);
+	rump_sys_write(fd, fd, sizeof(fd));
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, multilayer);
+	ATF_TP_ADD_TC(tp, devnull1);
+	ATF_TP_ADD_TC(tp, devnull2);
 
 	return atf_no_error();
 }



CVS commit: src/tests/fs/union

2010-07-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Jul  3 12:10:35 UTC 2010

Modified Files:
src/tests/fs/union: t_pr.c

Log Message:
Remove ufs mount where not necessary due to rumpfs now supporting
VOP_WHITEOUT.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/fs/union/t_pr.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/union/t_pr.c
diff -u src/tests/fs/union/t_pr.c:1.4 src/tests/fs/union/t_pr.c:1.5
--- src/tests/fs/union/t_pr.c:1.4	Sat Jul  3 12:08:37 2010
+++ src/tests/fs/union/t_pr.c	Sat Jul  3 12:10:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pr.c,v 1.4 2010/07/03 12:08:37 pooka Exp $	*/
+/*	$NetBSD: t_pr.c,v 1.5 2010/07/03 12:10:35 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -16,7 +16,6 @@
 #include rump/rump_syscalls.h
 
 #include miscfs/union/union.h
-#include ufs/ufs/ufsmount.h
 
 #include ../../h_macros.h
 
@@ -24,28 +23,13 @@
 ATF_TC_HEAD(multilayer, tc)
 {
 	atf_tc_set_md_var(tc, descr, mount_union -b twice);
-	atf_tc_set_md_var(tc, use.fs, true);
 }
 
-#define IMG1 atf1.img
-#define DEV1 /dev/fs1
-#define newfs_base newfs -F -s 1 
-
 ATF_TC_BODY(multilayer, tc)
 {
-	struct ufs_args args;
 	struct union_args unionargs;
 
-	if (system(newfs_base IMG1) == -1)
-		atf_tc_fail_errno(create img1);
-
 	rump_init();
-rump_pub_etfs_register(DEV1, IMG1, RUMP_ETFS_BLK);
-
-	memset(args, 0, sizeof(args));
-	args.fspec = __UNCONST(DEV1);
-	if (rump_sys_mount(MOUNT_FFS, /, 0, args, sizeof(args)) == -1)
-		atf_tc_fail_errno(could not mount root);
 
 	if (rump_sys_mkdir(/Tunion, 0777) == -1)
 		atf_tc_fail_errno(mkdir mp1);
@@ -66,7 +50,6 @@
 	unionargs.target = __UNCONST(/Tunion2/B);
 	unionargs.mntflags = UNMNT_BELOW;
 
-	/* BADABOOM */
 	/* atf_tc_expect_signal(-1, PR kern/23986); */
 	rump_sys_mount(MOUNT_UNION, /Tunion, 0,unionargs,sizeof(unionargs));
 }



CVS commit: src/tests/fs/union

2010-07-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Jul  3 12:23:04 UTC 2010

Modified Files:
src/tests/fs/union: t_pr.c

Log Message:
enhance fail check


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/union/t_pr.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/union/t_pr.c
diff -u src/tests/fs/union/t_pr.c:1.5 src/tests/fs/union/t_pr.c:1.6
--- src/tests/fs/union/t_pr.c:1.5	Sat Jul  3 12:10:35 2010
+++ src/tests/fs/union/t_pr.c	Sat Jul  3 12:23:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pr.c,v 1.5 2010/07/03 12:10:35 pooka Exp $	*/
+/*	$NetBSD: t_pr.c,v 1.6 2010/07/03 12:23:04 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -81,8 +81,12 @@
 	fd = rump_sys_open(/mp/null, O_WRONLY | O_CREAT | O_TRUNC);
 
 	atf_tc_expect_fail(PR kern/43560);
-	if (fd == -1)
-		atf_tc_fail_errno(open);
+	if (fd == -1  errno == EROFS)
+		atf_tc_fail(open returned EROFS);
+	else if (fd == -1)
+		atf_tc_fail_errno(open fail);
+
+	atf_tc_expect_pass();
 }
 
 ATF_TC(devnull2);



CVS commit: src/tests/fs/union

2010-07-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat Jul  3 13:37:23 UTC 2010

Modified Files:
src/tests/fs/union: t_pr.c

Log Message:
Improve previous a bit more: now it works correctly in all cases
with or without xfail.

There is still room for improvement, though: with xfail the
errno != EROFS branch does not report why open failed.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/union/t_pr.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/union/t_pr.c
diff -u src/tests/fs/union/t_pr.c:1.6 src/tests/fs/union/t_pr.c:1.7
--- src/tests/fs/union/t_pr.c:1.6	Sat Jul  3 12:23:04 2010
+++ src/tests/fs/union/t_pr.c	Sat Jul  3 13:37:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pr.c,v 1.6 2010/07/03 12:23:04 pooka Exp $	*/
+/*	$NetBSD: t_pr.c,v 1.7 2010/07/03 13:37:22 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -81,12 +81,13 @@
 	fd = rump_sys_open(/mp/null, O_WRONLY | O_CREAT | O_TRUNC);
 
 	atf_tc_expect_fail(PR kern/43560);
-	if (fd == -1  errno == EROFS)
+	if (fd == -1  errno == EROFS) {
 		atf_tc_fail(open returned EROFS);
-	else if (fd == -1)
+	} else if (fd == -1) {
+		atf_tc_expect_pass();
 		atf_tc_fail_errno(open fail);
+	}
 
-	atf_tc_expect_pass();
 }
 
 ATF_TC(devnull2);



CVS commit: src/tests/fs/union

2010-06-30 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jun 30 14:10:14 UTC 2010

Modified Files:
src/tests/fs/union: t_pr.c

Log Message:
Test no longer fails with rev. 1.62 of src/sys/fs/union/union_vfsops.c.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/union/t_pr.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/union/t_pr.c
diff -u src/tests/fs/union/t_pr.c:1.1 src/tests/fs/union/t_pr.c:1.2
--- src/tests/fs/union/t_pr.c:1.1	Tue Jun 29 15:25:28 2010
+++ src/tests/fs/union/t_pr.c	Wed Jun 30 14:10:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_pr.c,v 1.1 2010/06/29 15:25:28 pooka Exp $	*/
+/*	$NetBSD: t_pr.c,v 1.2 2010/06/30 14:10:14 hannken Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -25,7 +25,7 @@
 {
 	atf_tc_set_md_var(tc, descr, mount_union -b twice);
 	atf_tc_set_md_var(tc, use.fs, true);
-	atf_tc_set_md_var(tc, xfail, PR kern/23986);
+	/* atf_tc_set_md_var(tc, xfail, PR kern/23986); */
 }
 
 #define IMG1 atf1.img



CVS commit: src/tests/fs/union

2010-06-29 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jun 29 15:25:28 UTC 2010

Modified Files:
src/tests/fs/union: Makefile
Added Files:
src/tests/fs/union: t_pr.c

Log Message:
xfail test for problem described in PR kern/23986


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/union/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/union/t_pr.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/union/Makefile
diff -u src/tests/fs/union/Makefile:1.1 src/tests/fs/union/Makefile:1.2
--- src/tests/fs/union/Makefile:1.1	Mon Mar 29 18:19:19 2010
+++ src/tests/fs/union/Makefile	Tue Jun 29 15:25:28 2010
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.1 2010/03/29 18:19:19 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2010/06/29 15:25:28 pooka Exp $
 #
 
 TESTSDIR=	${TESTSBASE}/fs/union
 WARNS=		4
 
-TESTS_C=	t_basic
+TESTS_C=	t_basic t_pr
 
 LDADD+=	-lrumpfs_union -lrumpvfs_layerfs -lrumpfs_ffs		# fs drivers
 LDADD+=	-lrumpdev_disk -lrumpdev# disk device

Added files:

Index: src/tests/fs/union/t_pr.c
diff -u /dev/null src/tests/fs/union/t_pr.c:1.1
--- /dev/null	Tue Jun 29 15:25:28 2010
+++ src/tests/fs/union/t_pr.c	Tue Jun 29 15:25:28 2010
@@ -0,0 +1,79 @@
+/*	$NetBSD: t_pr.c,v 1.1 2010/06/29 15:25:28 pooka Exp $	*/
+
+#include sys/types.h
+#include sys/mount.h
+
+#include atf-c.h
+#include err.h
+#include errno.h
+#include fcntl.h
+#include stdio.h
+#include unistd.h
+#include string.h
+#include stdlib.h
+
+#include rump/rump.h
+#include rump/rump_syscalls.h
+
+#include miscfs/union/union.h
+#include ufs/ufs/ufsmount.h
+
+#include ../../h_macros.h
+
+ATF_TC(multilayer);
+ATF_TC_HEAD(multilayer, tc)
+{
+	atf_tc_set_md_var(tc, descr, mount_union -b twice);
+	atf_tc_set_md_var(tc, use.fs, true);
+	atf_tc_set_md_var(tc, xfail, PR kern/23986);
+}
+
+#define IMG1 atf1.img
+#define DEV1 /dev/fs1
+#define newfs_base newfs -F -s 1 
+
+ATF_TC_BODY(multilayer, tc)
+{
+	struct ufs_args args;
+	struct union_args unionargs;
+
+	if (system(newfs_base IMG1) == -1)
+		atf_tc_fail_errno(create img1);
+
+	rump_init();
+rump_pub_etfs_register(DEV1, IMG1, RUMP_ETFS_BLK);
+
+	memset(args, 0, sizeof(args));
+	args.fspec = __UNCONST(DEV1);
+	if (rump_sys_mount(MOUNT_FFS, /, 0, args, sizeof(args)) == -1)
+		atf_tc_fail_errno(could not mount root);
+
+	if (rump_sys_mkdir(/Tunion, 0777) == -1)
+		atf_tc_fail_errno(mkdir mp1);
+	if (rump_sys_mkdir(/Tunion2, 0777) == -1)
+		atf_tc_fail_errno(mkdir mp2);
+	if (rump_sys_mkdir(/Tunion2/A, 0777) == -1)
+		atf_tc_fail_errno(mkdir A);
+	if (rump_sys_mkdir(/Tunion2/B, 0777) == -1)
+		atf_tc_fail_errno(mkdir B);
+
+	unionargs.target = __UNCONST(/Tunion2/A);
+	unionargs.mntflags = UNMNT_BELOW;
+
+	if (rump_sys_mount(MOUNT_UNION, /Tunion, 0,
+	unionargs, sizeof(unionargs)) == -1)
+		atf_tc_fail_errno(union mount);
+
+	unionargs.target = __UNCONST(/Tunion2/B);
+	unionargs.mntflags = UNMNT_BELOW;
+
+	/* BADABOOM */
+	rump_sys_mount(MOUNT_UNION, /Tunion, 0,unionargs,sizeof(unionargs));
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+	ATF_TP_ADD_TC(tp, multilayer);
+
+	return atf_no_error();
+}



CVS commit: src/tests/fs/union

2010-05-01 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sat May  1 10:43:31 UTC 2010

Modified Files:
src/tests/fs/union: t_basic.c

Log Message:
fix !USE_ATF case


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/union/t_basic.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/union/t_basic.c
diff -u src/tests/fs/union/t_basic.c:1.1 src/tests/fs/union/t_basic.c:1.2
--- src/tests/fs/union/t_basic.c:1.1	Mon Mar 29 18:19:19 2010
+++ src/tests/fs/union/t_basic.c	Sat May  1 10:43:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_basic.c,v 1.1 2010/03/29 18:19:19 pooka Exp $	*/
+/*	$NetBSD: t_basic.c,v 1.2 2010/05/01 10:43:31 pooka Exp $	*/
 
 #include sys/types.h
 #include sys/mount.h
@@ -28,7 +28,7 @@
 	atf_tc_set_md_var(tc, descr, basic union functionality: two views);
 }
 #else
-#define atf_tc_fail(a, ...) errx(1, __VA_ARGS__)
+#define atf_tc_fail(...) errx(1, __VA_ARGS__)
 #endif
 
 #define MSTR magic bus