mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-19 16:16:48 +00:00
Unit tests (29 new in tests/tests.cpp): - str::eq() and str::startswith() char* nullptr safety - str::from() u64/s64/int suffix parsing (K/M/G/T, overflow, invalid) - num::humanize() byte formatting (0, 512, 1K, 1M, 1G, 1T, non-exact) - RmdirErr priority error accumulation (ENOTEMPTY/EEXIST override rules) - HashSet inline-to-heap growth, empty string, and large insertion - fs::inode algorithm switching (valid/invalid names, passthrough raw ino, distinct inodes across algorithms) - RND::rand64() bounds (range, max, shrink_to_rand_elem) - Branches::Impl copy and move assignment re-links default_minfreespace Integration tests (5 new in tests/): - TEST_policy_lup: LUP policy create and search - TEST_rmdir_enotempty_priority: rmdir returns ENOTEMPTY for non-empty dirs - TEST_open_after_unlink: read/write via fd after unlink - TEST_api_xattr: mergerfs xattr API (fullpath, relpath, basepath, allpaths) - TEST_movefile_enospc: moveonenospc configuration round-trip Also: remove xattr nosys checks from TEST_cfg_xattr_modes, reformat integration test scripts to use temp_dir/cleanup_dir helpers, and minor parameter alignment changes in fuse_getxattr, fuse_init, fuse_rename.
POSIX Soft Conformance Suite
This directory contains integration tests that exercise mergerfs FUSE operations and compare behavior against equivalent native syscalls on a local filesystem.
The suite is "soft POSIX": it focuses on practical parity for return values,
errno, and key side effects, including common error paths.
Run with:
python3 tests/run-tests /mnt/mergerfs/
Coverage Matrix
access->TEST_posix_accesschmod/fchmod->TEST_posix_chmod,TEST_use_fchmod_after_unlinkchown/fchown->TEST_posix_chown,TEST_use_fchown_after_unlinkcreate/mknod->TEST_posix_create_mknodgetattr/fgetattr->TEST_posix_getattr_fgetattr,TEST_use_fstat_after_unlinkopen/read/write->TEST_posix_open_read_write,TEST_o_directflush/release/fsync/fsyncdir->TEST_posix_fsync_flushreleaseclose semantics ->TEST_posix_releasereleasedirclose semantics ->TEST_posix_releasedirtruncate/ftruncate->TEST_posix_truncate_ftruncate,TEST_use_ftruncate_after_unlinkutimens/futimens->TEST_posix_utimens,TEST_use_futimens_after_unlinkfallocate->TEST_use_fallocate_after_unlinkcopy_file_range->TEST_posix_copy_file_rangeioctl->TEST_posix_ioctlpoll->TEST_posix_polltmpfile(O_TMPFILE) ->TEST_posix_tmpfilebmap(viaFIBMAPioctl parity) ->TEST_posix_bmapreadlink->TEST_readlink_semanticslink/symlink->TEST_posix_link_symlinkmkdir/rmdir->TEST_posix_mkdir_rmdirunlink/rename->TEST_posix_unlink_rename,TEST_unlink_renamestatfs->TEST_posix_statfsstatx->TEST_posix_statxsyncfs->TEST_posix_syncfsflock/lock->TEST_posix_lockingsetxattr/getxattr/listxattr/removexattr->TEST_posix_xattr- xattr object/flag matrix (
file,dir, symlinkl*, create/replace) ->TEST_posix_xattr_matrix - xattr mode runtime toggles (
passthrough/noattr/nosys) ->TEST_cfg_xattr_modes - statfs mode and statfs-ignore runtime toggles ->
TEST_cfg_statfs_ignore - EXDEV fallback runtime toggles for link/rename ->
TEST_cfg_link_rename_exdev readdir(+ seek/tell behavior) ->TEST_posix_readdirreaddir_plussemantic parity (list+stat and readdir policy toggles) ->TEST_posix_readdir_plus- lifecycle (
init/destroy) harness check ->TEST_mount_lifecycle - hidden temp exposure checks ->
TEST_no_fuse_hidden
Error Conditions Emphasized
Across tests, parity checks include combinations of:
ENOENTENOTDIREEXISTENOTEMPTYEISDIREBADF- privilege-sensitive outcomes (for example
EPERM) where applicable
Notes
- Some behavior is runtime/environment dependent (kernel, mount options, uid/gid, capabilities). Tests compare mergerfs to native behavior in the same runtime to keep assertions robust.
- The xattr test uses a
user.*key and assumes user xattrs are enabled.