aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)AuthorLines
2025-07-16Add statx supportJoanne Koong-0/+49
This commit adds libfuse support for FUSE_STATX requests on linux distributions. Currently, statx is only supported on linux. To make the interface a ergonomic as possible (eg using native 'struct statx' vs 'struct fuse_statx'), this implementation gates the 'struct statx' changes by #ifdef linux. Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
2025-06-27license: s/COPYING/GPL2.txt, s/COPYING.LIB/LGPL2.txtizxl007-5/+5
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
2025-06-18tests: example: add new test for increment epochLuis Henriques-1/+6
This patch modifies the notify_inval_entry.c example so that it includes an extra option to use fuse_lowlevel_notify_increment_epoch(). The test test_notify_inval_entry() was also modified to test this extra option. Signed-off-by: Luis Henriques <luis@igalia.com>
2025-06-12tests: Add an exception for output "error"Bernd Schubert-2/+5
The sigterm test triggers debug output like dev unique: 6, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 1808 unique: 6, success, outsize: 96 dev unique: 8, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 1808 exit_handler called with sig 15 fuse: session exited, terminating workers unique: 8, error: -2 (No such file or directory), outsize: 16 Which then triggers test failures, because the test was acting on the word 'error'. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-05-20conn->want conversion: Fix fuse_apply_conn_info_opts()Bernd Schubert-40/+57
fuse_apply_conn_info_opts() was applying to 'want_ext', which would cause conflicts with 'want' if the application applied its own flags to 'conn->want'. Solution is: - to move fuse_{set,unset,get}_feature_flag and convert_to_conn_want_ext() to fuse_lowlevel.c and to define them as part of the public API, although convert_to_conn_want_ext() should not be used - it is currently needed to be a public function due as it needs to be defined for the tests. Related to https://github.com/libfuse/libfuse/issues/1171 and https://github.com/libfuse/libfuse/pull/1172. Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28env variables to override default io-uring enable and q-depthBernd Schubert-0/+7
We want to especially test with and without io-uring being enabled. Ideally without modifying all tests - that is what the env variable can be used for. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-28fuse: Add ring creationBernd Schubert-0/+6
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-24Fix test/test_examples.py::test_passthroughBernd Schubert-6/+51
The test had multiple issues - default passthrough_ll timeout was used - the created file was then not listed if timeout was not passed yet - mnt_name was actually point to src_dir, file comparison of stat, etc succeeded, because the same file was compared. Switching to the right dir made stat to always fail, because st_dev is different for source and mount. I.e. the test must not compare all stat values. Not sure how this test ever passed, but in a very slow debug VM with lots of kernel debug options enabled, the default passthrough_ll timeout it systematically failed. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-24Fix multi-threaded fuse session exitBernd Schubert-0/+216
Issue with previous code was that fuse_session_exit() didn't wake up the semaphore in fuse_loop_mt.c. Lock, semaphore and all uses of checking for "exited" are now moved to struct fuse_session to have it available for the signal handler. This also removes internal fuse_session_reset() calls, as that makes testing hard. From git history I also don't see why it was added. Closes: https://github.com/libfuse/libfuse/issues/997 Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-04-16conn: prevent duplicate flag conversion in high-level interfaceBernd Schubert-13/+210
The high-level interface triggers flag conversion twice: once in the high-level init and once in the low-level init. This caused false "both 'want' and 'want_ext' are set" errors when using fuse_set_feature_flag() or fuse_unset_feature_flag(). The existing check for duplicate conversion only worked when 32-bit flags were set directly. When using the preferred flag manipulation functions, conn->want and the lower 32 bits of conn->want_ext would differ, triggering the error. Fix this by synchronizing conn->want with the lower 32 bits of conn->want_ext after conversion, ensuring consistent state for subsequent calls. Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-03-24fuse: Fix want flag conversionBernd Schubert-1/+156
32-bit conn->want flags been left to be ABI compatible to 3.10, even though the so version was changed. The more recent way is to use fuse_set_feature_flag(), which will use conn->want_ext. Given that we now have two flags (want and want_ext), we need to convert and that brought several issues - If the application sets conn->want, that needs to be set into the lower 32 bit of conn->want_ext. As the application might actually unset values, it really has to be a copy and not just 'or' - fixed now. - convert_to_conn_want_ext() actually needs to check for _modified_ conn->want and conn->want_ext - convert_to_conn_want_ext() must consider being called from high and lowlevel interfact, with different want_ext_default and want_default values. It is only a failure, if the application changed both, conn->want and conn->want_ext. This function was failing in issue #1171, because high level fuse_fs_init() was changing values and then lowlevel do_init() was incorrectly failing on that. This also adds a new test (test_want_conversion) and sets values into example/{hello.c,hello_ll.c} Also some more internal users of conn->want are converted to fuse_{set,unset}_feature_flag(). Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-03-24test/test_write_cache.c: Reformat with clang-formatBernd Schubert-204/+212
The file is going to be updated - should be more conform Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-18Fix a typo in test/ci-build.sh (ct vs cat)Bernd Schubert-1/+1
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-18tests: Re-enable mknod and mkfifo tests on FreeBSDVassili Tchersky-6/+0
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18tests: Disable tests with TMP_FILE on FreeBSDVassili Tchersky-0/+4
Not supported yet on this platform. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283179 Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-17ci-build test: Add a 32-bit compilation testBernd Schubert-0/+17
That was missing so far. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2025-02-17tests: Skip the ioctl test for x86 cross compilationBernd Schubert-0/+13
Probably some weird corner case in cross compilation, for now we ignore this. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-02-10Build fixes for -OgBernd Schubert-1/+1
Cleaning... 18 files. [35/69] Compiling C object example/passthrough_ll.p/passthrough_ll.c.o ../example/passthrough_ll.c: In function ‘lo_opendir’: ../example/passthrough_ll.c:666:20: warning: ‘fd’ may be used uninitialized [-Wmaybe-uninitialized] 666 | if (fd != -1) | ^ ../example/passthrough_ll.c:637:13: note: ‘fd’ was declared here 637 | int fd; | ^~ [38/69] Compiling C object test/test_syscalls.p/test_syscalls.c.o ../test/test_syscalls.c: In function ‘test_seekdir’: ../test/test_syscalls.c:804:16: warning: ‘de’ may be used uninitialized [-Wmaybe-uninitialized] 804 | while (de) | ^~ ../test/test_syscalls.c:776:24: note: ‘de’ was declared here 776 | struct dirent *de; | ^~ These are actually valid. Signed-off-by: Bernd Schubert <bschubert@ddn.com>
2025-01-03Fix libfuse build with FUSE_USE_VERSION 30Amir Goldstein-0/+6
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
2024-12-30Add 64-bit conn::{capable,want}_ext fieldsBernd Schubert-1/+1
The previous fields are left for ABI compatibility, although it is not beautiful to add that complexity when we have to increase the so-version as we had ABI breakage anyway. example/printcap is simplified to use an array, as every line would have needed to be modified anyway. Missing 'FUSE_CAP_PASSTHROUGH' was added. Signed-off-by: Bernd Schubert <bernd@bsbernd.com>
2024-12-17tests: Add debug messages to some tests and umountBernd Schubert-15/+97
On my nfs mount the tests were hanging and it was impossible to diagnoze what is actually the issue. Also get rid of 'looseversion' python package dependency, as that package is not in ubuntu - add a handcode kernel version parser.
2024-11-27support FUSE_TMPFILE in the low level APIHorst Birthelmer-0/+101
Note that name hashes and using paths as parameters makes it very hard to support anonymous files in the high level API. Known Issues: - tests have to bail out when O_TMPFILE is not supported. This will always be the case with high level passthrough implementations. - test_create_and_link_tmpfile has to be skipped due to unidentified problems with github runner
2024-06-25Use off_t instead of loff_tCismonX-3/+1
Since we're already enforcing 64-bit off_t, using loff_t makes no difference. Also loff_t is Linux-only, which breaks compatibility for *BSD.
2024-03-27Install all test/build python packages from requirements.txtAshley Pittman-12/+3
Have GitHub actions setup python on runners and install all python dependencies via pip. Signed-off-by: Ashley Pittman <ashley@pittman.co.uk>
2024-03-20ci-build.sh: Fix checking for function arguments (#909)Bernd Schubert-1/+1
Checking for an emtpy string actually doesn't work for $@, so just check for number of arguments. Co-authored-by: Bernd Schubert <bschubert@ddn.com>
2024-03-20/test_ctests / test_notify1: Print cmdline on failureBernd Schubert-0/+1
Tests sometimes fail with pytest.fail('file system process terminated prematurely') And it is not clear what actually happens.
2024-03-20ci-build.sh: Add back test without versioned symbolsBernd Schubert-6/+15
Commit b1cdc497 ("ci-build.sh: Run ASAN and UBSAN at the same time") also accidentally removed the test for versioned symbols. Also export clang/clang++ to make sure new shells get it.
2024-03-20Build clang/sanitized build firstBernd Schubert-37/+45
This was stalling - easier to check what happens when it fails fast. And in general, sanitized builds are faster than valgrind and detect almost as much errors as valgrind (same level would be achieved with MSAN, but that is hard to use), so failures can be detected faster whan sanitizers run first.
2024-03-20Add back s-bit for compiled fusermountBernd Schubert-0/+8
This is also needed by some tests and was accidentally removed in commit aab146eea8877ee744a1b5a0da8bbbf31d14bad1
2024-03-20Fix test failures: Create missing mount dirBernd Schubert-2/+14
Tests were failing because mount dir was missing. Unclear to me why this became only recently an issue (github internal - out of the sudden tests were hanging).
2024-03-20ci-build.sh: Reduce pytest --maxfail from 99 to 1Bernd Schubert-1/+3
We want to see errors - reduce allowed errors. With --maxfail=99 tests out of the sudden started to hang in github, without a change in libfuse (I had actually tested to previous release tags). With --maxfail=1 pytest aborts and we see failing github. Also increase python log level to NOTSET - NOTSET should print all messages. Also use "pytest" has wrapper for "python3 -m"
2024-03-07Merge pull request #901 from bsbernd/posix_spawnBernd Schubert-25/+33
Switch from fork to posix_spawn
2024-03-07ci-build.sh: Always install and add s-bit for fusermount3Bernd Schubert-6/+14
As per pull #898, fusermount3 had a severe issue that should have been detected by ASAN. I guess tests used the system default and not the sanitized binary. Order of execution of fusermount3 is to try 1) full install path if that fails 2) just fusermount3 So tests should be fixed by installing libfuse, setting the s-bit on fusermount3 and then to run the tests.
2024-03-07ci-build.sh: Run ASAN and UBSAN at the same timeBernd Schubert-20/+20
Also set halt_on_error=1 to make UBSAN to fail if it would find something.
2024-03-06Fix undefined loff_t in test_write_cache.c on alpineBernd Schubert-0/+2
This fixes #899. Seems that Alpine (and maybe Fedora) need _GNU_SOURCE to get loff_t.
2024-02-26Fix tests/test_write_cache in write back mode (#892)Bernd Schubert-8/+33
This test could fail whenever a something (kernel, userspace) decides to flush in between of two 2048B writes. These two writes are supposed to be merged into a single 4906 byte write by the kernel writeback cache, but _sometimes_ the test fails because 2048 byte writes get through. Fixes #882 Solution here is a modification how the test works - instead of requiring an exact aggregation of 2x2048B into 4096B, it now writes 64x2048B and requires in write-back modes the number of received writes requests is lower than 64 - we can expect that at least some writes get aggregated, but we do know how many. Co-authored-by: Bernd Schubert <bschubert@ddn.com>
2024-01-29make FUSE_CAP_EXPIRE_ONLY test depend on available cap and not on versionHereThereBeDragons-2/+2
2023-12-17Allow *xattr operations on root directory (ino 1)amitgeron-2/+3
2023-07-01Reduce default write size by halfNikolaus Rath-1/+1
Hopefully this will reduce test flakiness on CI.
2023-07-01Add missing include.Nikolaus Rath-0/+1
2023-06-30Make expire only function fail if no kernel support (#789)HereThereBeDragons-0/+2
2023-05-11Fix issue #746. (#782)Peri-0/+173
Added a secondary check in fuse_lib_unlink() after hide_node() to check again under a lock if the (now hidden) file is still open. If not then delete it. This should synchronise fuse_lib_unlink() with fuse_lib_release(), when nullpath_ok is set.
2023-04-12Disable leak suppression (#773)Matthias Görgens-10/+0
2023-04-12Fuse mount: make auto_unmount compatible with suid/dev mount options (#762)Matthias Görgens-0/+31
* Fuse mount: make auto_unmount compatible with suid/dev mount options > When you run as root, fuse normally does not call fusermount but uses > the mount system call directly. When you specify auto_unmount, it goes > through fusermount instead. However, fusermount is a setuid binary that > is normally called by regular users, so it cannot in general accept suid > or dev options. In this patch, we split up how fuse mounts as root when `auto_unmount` is specified. First, we mount using system calls directly, then we reach out to fusermount to set up auto_unmount only (with no actual mounting done in fusermount). Fixes: #148
2023-04-11Migrate away from deprecated distutilsMatthias Goergens-3/+3
Before: ``` =============================== warnings summary =============================== test/test_ctests.py:12 /tmp/libfuse-build-mB50ZC/build-gcc-9/test/test_ctests.py:12: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.version import LooseVersion -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ```
2023-04-11Fix typoMatthias Goergens-1/+1
2023-04-07Fix PytestReturnNotNoneWarningMatthias Goergens-2/+4
``` test_examples.py::test_printcap /usr/local/lib/python3.9/dist-packages/_pytest/python.py:199: PytestReturnNotNoneWarning: Expected None, but test_examples.py::test_printcap returned ((7, 38), {'FUSE_CAP_READDIRPLUS_AUTO', 'FUSE_CAP_ASYNC_DIO', 'FUSE_CAP_SPLICE_READ', 'FUSE_CAP_CACHE_SYMLINKS', 'FUSE_CAP_IOCTL_DIR', 'FUSE_CAP_NO_OPENDIR_SUPPORT', 'FUSE_CAP_NO_OPEN_SUPPORT', 'FUSE_CAP_POSIX_LOCKS', 'FUSE_CAP_READDIRPLUS', 'FUSE_CAP_POSIX_ACL', 'FUSE_CAP_ATOMIC_O_TRUNC', 'FUSE_CAP_SPLICE_MOVE', 'FUSE_CAP_EXPORT_SUPPORT', 'FUSE_CAP_FLOCK_LOCKS', 'FUSE_CAP_EXPLICIT_INVAL_DATA', 'FUSE_CAP_EXPIRE_ONLY', 'FUSE_CAP_DONT_MASK', 'FUSE_CAP_WRITEBACK_CACHE', 'FUSE_CAP_AUTO_INVAL_DATA', 'FUSE_CAP_PARALLEL_DIROPS', 'FUSE_CAP_SPLICE_WRITE', 'FUSE_CAP_ASYNC_READ'}), which will be an error in a future version of pytest. Did you mean to use `assert` instead of `return`? warnings.warn( ```
2023-04-07Fix deprecated @pytest.mark.hookwrapperMatthias Goergens-1/+1
``` PytestDeprecationWarning: The hookimpl pytest_pyfunc_call uses old-style configuration options (marks or attributes). Please use the pytest.hookimpl(hookwrapper=True) decorator instead to configure the hooks. See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers @pytest.mark.hookwrapper ```
2023-04-07Fix meson deprecation warningMatthias Goergens-2/+2
Also for rest of CI
2023-04-07Upgrade meson version in CIMatthias Goergens-2/+1