Remove building with NOCRYPTO option
[minix.git] / tests / fs / msdosfs / t_snapshot.c
blob8b5708f843a38277e6834ff820898157188c7b6b
1 /* $NetBSD: t_snapshot.c,v 1.3 2014/06/10 13:15:18 martin Exp $ */
3 #include <sys/types.h>
4 #include <sys/mount.h>
6 #include <rump/rump.h>
7 #include <rump/rump_syscalls.h>
9 #include <fs/tmpfs/tmpfs_args.h>
10 #include <msdosfs/msdosfsmount.h>
12 #include <atf-c.h>
13 #include <err.h>
14 #include <fcntl.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <string.h>
18 #include <unistd.h>
20 #include "../../h_macros.h"
22 #define IMGNAME "msdosfs.img"
23 #define NEWFS "newfs_msdos -C 5M " IMGNAME
24 #define FSCK "fsck_msdos -fn"
25 #define BAKNAME "/stor/snap"
27 static void
28 mount_diskfs(const char *fspec, const char *path)
30 struct msdosfs_args margs;
32 memset(&margs, 0, sizeof(margs));
33 margs.fspec = __UNCONST(fspec);
34 margs.version = MSDOSFSMNT_VERSION;
36 if (rump_sys_mount(MOUNT_MSDOS, path, 0, &margs, sizeof(margs)) == -1)
37 err(1, "mount msdosfs %s", path);
40 static void
41 begin(void)
43 struct tmpfs_args targs = { .ta_version = TMPFS_ARGS_VERSION, };
45 if (rump_sys_mkdir("/stor", 0777) == -1)
46 atf_tc_fail_errno("mkdir /stor");
47 if (rump_sys_mount(MOUNT_TMPFS, "/stor", 0, &targs,sizeof(targs)) == -1)
48 atf_tc_fail_errno("mount storage");
51 #include "../common/snapshot.c"