t_mount.c revision 1.1 1 /* $NetBSD: t_mount.c,v 1.1 2010/06/30 21:54:56 njoly 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 atf_tc_set_md_var(tc, "xfail", "No PR yet");
23 }
24
25 ATF_TC_BODY(48Kimage, tc)
26 {
27 void *tmp;
28
29 if (ffs_newfs(&tmp, IMGNAME, IMGSIZE) != 0)
30 atf_tc_fail("newfs failed");
31
32 if (ffs_mount(tmp, MNTDIR, 0) != 0)
33 atf_tc_fail("mount failed");
34 if (ffs_unmount(MNTDIR, 0) != 0)
35 atf_tc_fail("unmount failed");
36
37 if (ffs_delfs(tmp) != 0)
38 atf_tc_fail("delfs failed");
39 }
40
41 ATF_TP_ADD_TCS(tp)
42 {
43 ATF_TP_ADD_TC(tp, 48Kimage);
44 return atf_no_error();
45 }
46