@samitouri / QOSamiQemu / commits / 951227d375

iotests: skip FUSE tests when FUSE is not usable

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_fuse_error() 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 <den@openvz.org> CC: Kevin Wolf <kwolf@redhat.com> CC: Hanna Reitz <hreitz@redhat.com> Message-ID: <20260715103451.1930909-3-den@openvz.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Denis V. Lunev committed Jul 15, 2026 at 12:34 UTC 951227d37554b16a7d0155ad053f348408ddb876
4 files changed +23 -6
tests/qemu-iotests/common.rc
+14
@@ -981,6 +981,20 @@ _require_drivers()
981 done
982 }
983
984 +# Skip if FUSE is unusable: not compiled in, or the export failed to
985 +# mount. $1 is the failing 'block-export-add' reply.
986 +_notrun_on_fuse_error()
987 +{
988 + case "$1" in
989 + *"Parameter 'type' does not accept value 'fuse'"*)
990 + _notrun "No FUSE support"
991 + ;;
992 + *"Failed to mount FUSE session"*)
993 + _notrun "FUSE not usable in this environment"
994 + ;;
995 + esac
996 +}
997 +
998 # Check that we have a file system that allows huge (but very sparse) files
999 #
1000 _require_large_file()
tests/qemu-iotests/tests/file-io-error
+1 -3
@@ -89,9 +89,7 @@ output=$(_send_qemu_cmd $QEMU_HANDLE \
89 'return' \
90 | grep -v 'option allow_other only allowed if')
91
92 -if echo "$output" | grep -q "Parameter 'type' does not accept value 'fuse'"; then
93 - _notrun 'No FUSE support'
94 -fi
92 +_notrun_on_fuse_error "$output"
93 echo "$output"
94
95 echo
tests/qemu-iotests/tests/fuse-allow-other
+2
@@ -77,6 +77,8 @@ fuse_export_add()
77 _notrun "allow_other not supported"
78 fi
79
80 + _notrun_on_fuse_error "$output"
81 +
82 echo "$output"
83 }
84
tests/qemu-iotests/tests/fuse-mmap-shared
+6 -3
@@ -28,9 +28,12 @@ def test_fuse_support(mount_point):
28 })
29 test_qsd.stop()
30 if 'error' in res:
31 - assert (res['error']['desc'] ==
32 - "Parameter 'type' does not accept value 'fuse'")
33 - iotests.notrun('No FUSE support')
31 + desc = res['error']['desc']
32 + if desc == "Parameter 'type' does not accept value 'fuse'":
33 + iotests.notrun('No FUSE support')
34 + if 'Failed to mount FUSE session' in desc:
35 + iotests.notrun('FUSE not usable in this environment')
36 + assert False, desc
37
38 # Shared mmap when using direct IO is only supported for Linux kernels >= 6.6
39 # with commit e78662e818f94 ("fuse: add a new fuse init flag to relax