Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/vfs Instead of hardcoding fs list just try to mount...



details:   https://anonhg.NetBSD.org/src/rev/9515327203ea
branches:  trunk
changeset: 760766:9515327203ea
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jan 12 21:45:39 2011 +0000

description:
Instead of hardcoding fs list just try to mount union and skip all
file systems which return EOPNOTSUPP.

diffstat:

 tests/fs/vfs/t_union.c |  18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diffs (46 lines):

diff -r 41dcde1780f7 -r 9515327203ea tests/fs/vfs/t_union.c
--- a/tests/fs/vfs/t_union.c    Wed Jan 12 21:30:50 2011 +0000
+++ b/tests/fs/vfs/t_union.c    Wed Jan 12 21:45:39 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_union.c,v 1.1 2011/01/12 21:13:27 pooka Exp $        */
+/*     $NetBSD: t_union.c,v 1.2 2011/01/12 21:45:39 pooka Exp $        */
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -22,9 +22,6 @@
 
 #define MSTR "magic bus"
 
-#define HAS_WHITEOUT (FSTYPE_FFS(tc) || FSTYPE_FFSLOG(tc) ||   \
-    FSTYPE_LFS(tc) || FSTYPE_RUMPFS(tc))
-
 static void
 xput_tfile(const char *mp, const char *path)
 {
@@ -74,10 +71,6 @@
        struct dirent *dp;
        int error, fd, dsize;
 
-       if (!HAS_WHITEOUT) {
-               atf_tc_skip("file system does not support VOP_WHITEOUT");
-       }
-
        snprintf(lowerpath, sizeof(lowerpath), "%s.lower", mp);
 
        RL(rump_sys_mkdir(lowerpath, 0777));
@@ -91,8 +84,13 @@
        unionargs.mntflags = UNMNT_BELOW;
 
        if (rump_sys_mount(MOUNT_UNION, mp, 0,
-           &unionargs, sizeof(unionargs)) == -1)
-               atf_tc_fail_errno("union mount");
+           &unionargs, sizeof(unionargs)) == -1) {
+               if (errno == EOPNOTSUPP) {
+                       atf_tc_skip("fs does not support VOP_WHITEOUT");
+               } else {
+                       atf_tc_fail_errno("union mount");
+               }
+       }
 
        /* first, test we can read the old file from the new namespace */
        error = xread_tfile(mp, TFILE);



Home | Main Index | Thread Index | Old Index