import time
import errno
import sys
+import platform
+from distutils.version import LooseVersion
from tempfile import NamedTemporaryFile
from contextlib import contextmanager
from util import (wait_for_mount, umount, cleanup, base_cmdline,
if not cache:
syscall_test_cmd = [ os.path.join(basename, 'test', 'test_syscalls'),
mnt_dir, ':' + src_dir ]
+ # unlinked testfiles check fails without kernel fix
+ # "fuse: fix illegal access to inode with reused nodeid"
+ # so opt-in for this test from kernel 5.14
+ if LooseVersion(platform.release()) >= '5.14':
+ syscall_test_cmd.append('-u')
subprocess.check_call(syscall_test_cmd)
except:
cleanup(mount_process, mnt_dir)
static unsigned int testnum = 0;
static unsigned int select_test = 0;
static unsigned int skip_test = 0;
+static unsigned int unlinked_test = 0;
#define MAX_ENTRIES 1024
#define MAX_TESTS 100
int res, err = 0;
int num = testnum;
+ if (!unlinked_test)
+ return 0;
+
testnum = 0;
while (testnum < num) {
fd = next_test->fd;
umask(0);
if (argc < 2 || argc > 4) {
- fprintf(stderr, "usage: %s testdir [:realdir] [[-]test#]\n", argv[0]);
+ fprintf(stderr, "usage: %s testdir [:realdir] [[-]test#] [-u]\n", argv[0]);
return 1;
}
basepath = argv[1];
} else {
if (arg[0] == '-') {
arg++;
- skip_test = strtoul(arg, &endptr, 10);
+ if (arg[0] == 'u') {
+ unlinked_test = 1;
+ endptr = arg + 1;
+ } else {
+ skip_test = strtoul(arg, &endptr, 10);
+ }
} else {
select_test = strtoul(arg, &endptr, 10);
}
if (arg[0] == '\0' || *endptr != '\0') {
- fprintf(stderr, "invalid number: '%s'\n", arg);
+ fprintf(stderr, "invalid option: '%s'\n", argv[a]);
return 1;
}
}