2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00
Files
criu/test/zdtm/static/mnt_enablefs.c
Andrew Vagin aee6cca66a zdtm: check enabled file systems
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-27 13:31:43 +03:00

44 lines
752 B
C

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <linux/limits.h>
#include "zdtmtst.h"
const char *test_doc = "Check enabled file systems (--enable-fs)";
const char *test_author = "Andrei Vagin <avagin@virtuozzo.com>";
char *dirname;
TEST_OPTION(dirname, string, "directory name", 1);
int main(int argc, char **argv)
{
char fname[PATH_MAX];
test_init(argc, argv);
mkdir(dirname, 0777);
if (mount("zdtm_nfsd", dirname, "nfsd", 0, NULL) == -1) {
pr_perror("mount");
return -1;
}
snprintf(fname, sizeof(fname), "%s/exports", dirname);
test_daemon();
test_waitsig();
if (access(fname, F_OK))
fail();
pass();
return 0;
}