t_snapshot_log.c revision 272343
1272343Sngie/* $NetBSD: t_snapshot_log.c,v 1.2 2013/02/06 09:05:01 hannken 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 18272343Sngie#include "../../h_macros.h" 19272343Sngie 20272343Sngie#define IMGNAME "ffs.img" 21272343Sngie#define NEWFS "newfs -F -s 10000 " 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 static int flags = MNT_LOG; 30272343Sngie 31272343Sngie uargs.fspec = __UNCONST(fspec); 32272343Sngie 33272343Sngie if (rump_sys_mount(MOUNT_FFS, 34272343Sngie path, flags, &uargs, sizeof(uargs)) == -1) 35272343Sngie atf_tc_fail_errno("mount ffs %s", path); 36272343Sngie flags = 0; 37272343Sngie} 38272343Sngie 39272343Sngiestatic void 40272343Sngiebegin(void) 41272343Sngie{ 42272343Sngie 43272343Sngie /* empty */ 44272343Sngie} 45272343Sngie 46272343Sngie#include "../common/snapshot.c" 47