2010-07-30 20:15:05 +04:00
|
|
|
/* $NetBSD: t_mount.c,v 1.7 2010/07/30 16:15:05 pooka Exp $ */
|
2010-07-01 01:54:56 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Adapted for rump and atf from a testcase supplied
|
|
|
|
* by Hubert Feyrer on netbsd-users@
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <atf-c.h>
|
|
|
|
|
|
|
|
#define IMGNAME "image.ffs"
|
|
|
|
#define IMGSIZE (96 * 512)
|
|
|
|
|
|
|
|
#define MNTDIR "/mnt"
|
|
|
|
|
2010-07-19 20:22:05 +04:00
|
|
|
#include "../common/h_fsmacros.h"
|
|
|
|
|
2010-07-01 01:54:56 +04:00
|
|
|
ATF_TC(48Kimage);
|
|
|
|
ATF_TC_HEAD(48Kimage, tc)
|
|
|
|
{
|
|
|
|
atf_tc_set_md_var(tc, "descr", "mount small 48K ffs image");
|
|
|
|
atf_tc_set_md_var(tc, "use.fs", "true");
|
|
|
|
}
|
|
|
|
|
|
|
|
ATF_TC_BODY(48Kimage, tc)
|
|
|
|
{
|
|
|
|
void *tmp;
|
|
|
|
|
2010-07-30 20:15:05 +04:00
|
|
|
if (ffs_fstest_newfs(tc, &tmp, IMGNAME, IMGSIZE, NULL) != 0)
|
2010-07-01 01:54:56 +04:00
|
|
|
atf_tc_fail("newfs failed");
|
|
|
|
|
2010-07-05 21:12:48 +04:00
|
|
|
atf_tc_expect_fail("PR kern/43573");
|
2010-07-13 19:50:31 +04:00
|
|
|
if (ffs_fstest_mount(tc, tmp, MNTDIR, 0) != 0) {
|
2010-07-01 01:54:56 +04:00
|
|
|
atf_tc_fail("mount failed");
|
2010-07-05 20:34:41 +04:00
|
|
|
}
|
2010-07-05 21:12:48 +04:00
|
|
|
atf_tc_expect_pass();
|
|
|
|
|
2010-07-13 19:50:31 +04:00
|
|
|
if (ffs_fstest_unmount(tc, MNTDIR, 0) != 0)
|
2010-07-01 01:54:56 +04:00
|
|
|
atf_tc_fail("unmount failed");
|
|
|
|
|
2010-07-13 19:50:31 +04:00
|
|
|
if (ffs_fstest_delfs(tc, tmp) != 0)
|
2010-07-01 01:54:56 +04:00
|
|
|
atf_tc_fail("delfs failed");
|
|
|
|
}
|
|
|
|
|
|
|
|
ATF_TP_ADD_TCS(tp)
|
|
|
|
{
|
|
|
|
ATF_TP_ADD_TC(tp, 48Kimage);
|
|
|
|
return atf_no_error();
|
|
|
|
}
|