import subprocess
import pytest
import platform
+import sys
from distutils.version import LooseVersion
from util import (wait_for_mount, umount, cleanup, base_cmdline,
safe_sleep, basename, fuse_test_marker)
pytestmark = fuse_test_marker()
+@pytest.mark.skipif('bsd' in sys.platform,
+ reason='writeback requires Linux')
@pytest.mark.parametrize("writeback", (False, True))
def test_write_cache(tmpdir, writeback):
if writeback and LooseVersion(platform.release()) < '3.14':
subprocess.check_call(cmdline)
-@pytest.mark.parametrize("name",
- ('notify_inval_inode',
- 'notify_store_retrieve'))
+names = [ 'notify_inval_inode' ]
+if sys.platform == 'linux':
+ names.append('notify_store_retrieve')
+@pytest.mark.parametrize("name", names)
@pytest.mark.parametrize("notify", (True, False))
def test_notify1(tmpdir, name, notify):
mnt_dir = str(tmpdir)
import filecmp
import time
import errno
+import sys
from tempfile import NamedTemporaryFile
from contextlib import contextmanager
from util import (wait_for_mount, umount, cleanup, base_cmdline,
__ctr[0] += 1
return 'testfile_%d' % __ctr[0]
+options = [ [] ]
+if sys.platform == 'linux':
+ options.append(['-o', 'clone_fd'])
+@pytest.mark.parametrize("options", options)
@pytest.mark.parametrize("name", ('hello', 'hello_ll'))
-@pytest.mark.parametrize("options", ([], ['-o', 'clone_fd']))
def test_hello(tmpdir, name, options):
mnt_dir = str(tmpdir)
cmdline = base_cmdline + \
else:
umount(mount_process, mnt_dir)
-@pytest.mark.skipif(
- not os.path.exists(pjoin(basename, 'example', 'passthrough_ll')),
- reason='example not compiled')
+@pytest.mark.skipif('bsd' in sys.platform,
+ reason='not supported under BSD')
@pytest.mark.parametrize("writeback", (False, True))
@pytest.mark.parametrize("debug", (False, True))
def test_passthrough_ll(tmpdir, writeback, debug, capfd):
capfd.register_output(r'^ unique: [0-9]+, error: -[0-9]+ .+$',
count=0)
+ # test_syscalls prints "No error" under FreeBSD
+ capfd.register_output(r"^ \d\d \[[^\]]+ message: 'No error: 0'\]",
+ count=0)
+
mnt_dir = str(tmpdir.mkdir('mnt'))
src_dir = str(tmpdir.mkdir('src'))
return 0;
}
+#ifndef __FreeBSD__
static int test_mknod(void)
{
int err = 0;
success();
return 0;
}
+#endif
#define test_open(exist, flags, mode) do_test_open(exist, flags, #flags, mode)
return 0;
}
+#ifndef __FreeBSD__
static int test_mkfifo(void)
{
int res;
success();
return 0;
}
+#endif
static int test_mkdir(void)
{
err += test_create();
err += test_create_unlink();
- err += test_mknod();
err += test_symlink();
err += test_link();
err += test_link2();
+#ifndef __FreeBSD__
+ err += test_mknod();
err += test_mkfifo();
+#endif
err += test_mkdir();
err += test_rename_file();
err += test_rename_dir();