2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 18:07:57 +00:00

zdtm: check enabled file systems

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Andrew Vagin 2016-04-28 19:53:00 +03:00 committed by Pavel Emelyanov
parent c58802edbf
commit aee6cca66a
4 changed files with 48 additions and 0 deletions

View File

@ -233,6 +233,7 @@ TST_DIR = \
mnt_ext_dev \ mnt_ext_dev \
mntns_deleted \ mntns_deleted \
unlink_regular00 \ unlink_regular00 \
mnt_enablefs \
TST_DIR_FILE = \ TST_DIR_FILE = \
chroot \ chroot \

View File

@ -0,0 +1,43 @@
#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;
}

View File

@ -0,0 +1,3 @@
#!/bin/sh
unshare -m --propagation private mount -t nfsd nfsd /mnt

View File

@ -0,0 +1 @@
{'flavor': 'ns', 'feature': 'mnt_id', "flags": "suid", "opts" : "--enable-fs nfsd" }