Am 10.07.2026 um 18:13 hat Denis V. Lunev geschrieben:
> file-io-error, fuse-allow-other and fuse-mmap-shared skip only when
> FUSE is not compiled in. When FUSE is built in but unusable at run
> time (no /dev/fuse access, fusermount lacking permissions), the
> export fails to mount with "Failed to mount FUSE session to export"
> and the tests report a spurious failure instead of skipping, like
> NBD tests already do for missing NBD support.
>
> Add _notrun_on_no_fuse() to common.rc and use it in the shell tests.
> fuse-mmap-shared is Python, so it gets an equivalent inline check.
>
> Signed-off-by: Denis V. Lunev <[email protected]>
> CC: Kevin Wolf <[email protected]>
> CC: Hanna Reitz <[email protected]>
> ---
> tests/qemu-iotests/common.rc | 14 ++++++++++++++
> tests/qemu-iotests/tests/file-io-error | 4 +---
> tests/qemu-iotests/tests/fuse-allow-other | 2 ++
> tests/qemu-iotests/tests/fuse-mmap-shared | 9 ++++++---
> 4 files changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index 298bc483e0..62a2bc146b 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -981,6 +981,20 @@ _require_drivers()
> done
> }
>
> +# Skip if FUSE is unusable: not compiled in, or the export failed to
> +# mount. $1 is the failing 'block-export-add' reply.
> +_notrun_on_no_fuse()
I'm not completely happy with the name, though this is not a blocker.
My first thought was to keep the name consistent with the other
functions in common.rc and have something like _require_fuse. On second
thoughts, this is probably confusing because it's different from the
existing _require_* functions in that it takes an error message from the
test case instead of doing its own probing.
So maybe at least remove the double negative? _notrun_on_fuse_error
sounds slightly better to me.
> +{
> + case "$1" in
> + *"Parameter 'type' does not accept value 'fuse'"*)
> + _notrun "No FUSE support"
> + ;;
> + *"Failed to mount FUSE session"*)
> + _notrun "FUSE not usable in this environment"
> + ;;
> + esac
> +}
> +
Adding these checks is a good idea, of course.
Kevin