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