1314817Sngie/*	$NetBSD: t_snapshot_v2.c,v 1.3 2017/01/13 21:30:39 christos Exp $	*/
2272343Sngie
3272343Sngie#include <sys/types.h>
4272343Sngie#include <sys/mount.h>
5272343Sngie
6272343Sngie#include <rump/rump.h>
7272343Sngie#include <rump/rump_syscalls.h>
8272343Sngie
9272343Sngie#include <ufs/ufs/ufsmount.h>
10272343Sngie
11272343Sngie#include <atf-c.h>
12272343Sngie#include <fcntl.h>
13272343Sngie#include <stdio.h>
14272343Sngie#include <stdlib.h>
15272343Sngie#include <string.h>
16272343Sngie#include <unistd.h>
17272343Sngie
18314817Sngie#include "h_macros.h"
19272343Sngie
20272343Sngie#define IMGNAME "ffs.img"
21272343Sngie#define NEWFS "newfs -F -s 10000 -O 2 " IMGNAME
22272343Sngie#define FSCK "fsck_ffs -fn -F"
23272343Sngie#define BAKNAME "/mnt/le_snapp"
24272343Sngie
25272343Sngiestatic void
26272343Sngiemount_diskfs(const char *fspec, const char *path)
27272343Sngie{
28272343Sngie	struct ufs_args uargs;
29272343Sngie
30272343Sngie	uargs.fspec = __UNCONST(fspec);
31272343Sngie
32272343Sngie	if (rump_sys_mount(MOUNT_FFS, path, 0, &uargs, sizeof(uargs)) == -1)
33272343Sngie		atf_tc_fail_errno("mount ffs %s", path);
34272343Sngie}
35272343Sngie
36272343Sngiestatic void
37272343Sngiebegin(void)
38272343Sngie{
39272343Sngie
40272343Sngie	/* empty */
41272343Sngie}
42272343Sngie
43272343Sngie#include "../common/snapshot.c"
44