Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/ffs * convert 48k fs image test to FSTEST_CON/DESTRO



details:   https://anonhg.NetBSD.org/src/rev/055bdfe838b9
branches:  trunk
changeset: 756995:055bdfe838b9
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Aug 09 19:34:59 2010 +0000

description:
* convert 48k fs image test to FSTEST_CON/DESTRO
* make sure hugeblocksize doesn't accidentally succeed

diffstat:

 tests/fs/ffs/t_mount.c |  22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diffs (53 lines):

diff -r bffaa72d967a -r 055bdfe838b9 tests/fs/ffs/t_mount.c
--- a/tests/fs/ffs/t_mount.c    Mon Aug 09 19:32:26 2010 +0000
+++ b/tests/fs/ffs/t_mount.c    Mon Aug 09 19:34:59 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_mount.c,v 1.8 2010/08/09 17:42:26 pooka Exp $        */
+/*     $NetBSD: t_mount.c,v 1.9 2010/08/09 19:34:59 pooka Exp $        */
 
 /*
  * Basic tests for mounting
@@ -12,11 +12,7 @@
 
 #include <atf-c.h>
 
-#define IMGNAME "image.ffs"
-#define IMGSIZE (96 * 512)
-
-#define MNTDIR  "/mnt"
-
+#define FSTEST_IMGSIZE (96 * 512)
 #include "../common/h_fsmacros.h"
 
 #include <sys/types.h>
@@ -42,20 +38,11 @@
 {
        void *tmp;
 
-       if (ffs_fstest_newfs(tc, &tmp, IMGNAME, IMGSIZE, NULL) != 0)
-               atf_tc_fail("newfs failed");
-
        atf_tc_expect_fail("PR kern/43573");
-       if (ffs_fstest_mount(tc, tmp, MNTDIR, 0) != 0) {
-               atf_tc_fail("mount failed");
-       }
+       FSTEST_CONSTRUCTOR(tc, ffs, tmp);
        atf_tc_expect_pass();
 
-       if (ffs_fstest_unmount(tc, MNTDIR, 0) != 0)
-               atf_tc_fail("unmount failed");
-
-       if (ffs_fstest_delfs(tc, tmp) != 0)
-               atf_tc_fail("delfs failed");
+       FSTEST_DESTRUCTOR(tc, ffs, tmp);
 }
 
 ATF_TC(fsbsize2big);
@@ -95,6 +82,7 @@
        /* mount succeeded?  bad omen.  confirm we're in trouble.  */
        if (rump_sys_mount(MOUNT_FFS, "/mp", 0, &args, sizeof(args)) != -1) {
                rump_sys_statvfs1("/mp", &svb, ST_WAIT);
+               atf_tc_fail("not expecting to be alive");
        }
 
        /* otherwise we're do-ne */



Home | Main Index | Thread Index | Old Index