t_mount.c revision 1.6 1 1.6 pooka /* $NetBSD: t_mount.c,v 1.6 2010/07/19 16:22:05 pooka Exp $ */
2 1.1 njoly
3 1.1 njoly /*
4 1.1 njoly * Adapted for rump and atf from a testcase supplied
5 1.1 njoly * by Hubert Feyrer on netbsd-users@
6 1.1 njoly */
7 1.1 njoly
8 1.1 njoly #include <atf-c.h>
9 1.1 njoly
10 1.1 njoly #define IMGNAME "image.ffs"
11 1.1 njoly #define IMGSIZE (96 * 512)
12 1.1 njoly
13 1.1 njoly #define MNTDIR "/mnt"
14 1.1 njoly
15 1.6 pooka #include "../common/h_fsmacros.h"
16 1.6 pooka
17 1.1 njoly ATF_TC(48Kimage);
18 1.1 njoly ATF_TC_HEAD(48Kimage, tc)
19 1.1 njoly {
20 1.1 njoly atf_tc_set_md_var(tc, "descr", "mount small 48K ffs image");
21 1.1 njoly atf_tc_set_md_var(tc, "use.fs", "true");
22 1.1 njoly }
23 1.1 njoly
24 1.1 njoly ATF_TC_BODY(48Kimage, tc)
25 1.1 njoly {
26 1.1 njoly void *tmp;
27 1.1 njoly
28 1.5 njoly if (ffs_fstest_newfs(tc, &tmp, IMGNAME, IMGSIZE) != 0)
29 1.1 njoly atf_tc_fail("newfs failed");
30 1.1 njoly
31 1.3 pooka atf_tc_expect_fail("PR kern/43573");
32 1.5 njoly if (ffs_fstest_mount(tc, tmp, MNTDIR, 0) != 0) {
33 1.1 njoly atf_tc_fail("mount failed");
34 1.2 jmmv }
35 1.3 pooka atf_tc_expect_pass();
36 1.3 pooka
37 1.5 njoly if (ffs_fstest_unmount(tc, MNTDIR, 0) != 0)
38 1.1 njoly atf_tc_fail("unmount failed");
39 1.1 njoly
40 1.5 njoly if (ffs_fstest_delfs(tc, tmp) != 0)
41 1.1 njoly atf_tc_fail("delfs failed");
42 1.1 njoly }
43 1.1 njoly
44 1.1 njoly ATF_TP_ADD_TCS(tp)
45 1.1 njoly {
46 1.1 njoly ATF_TP_ADD_TC(tp, 48Kimage);
47 1.1 njoly return atf_no_error();
48 1.1 njoly }
49