FILESYSTEM IN USERSPACE (FUSE) development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: bernd@bsbernd.com
Cc: fuse-devel@lists.linux.dev
Subject: Re: [PATCH 09/10] test: mount the service examples through fuservicemount3
Date: Fri, 25 Sep 2026 15:25:12 -0700	[thread overview]
Message-ID: <20260925222512.GW6253@frogsfrogsfrogs> (raw)
In-Reply-To: <20260925-mount-service-bound-open-v1-9-bbf1a84c7995@bsbernd.com>

On Fri, Sep 25, 2026 at 12:23:37AM +0200, Bernd Schubert via B4 Relay wrote:
> From: Bernd Schubert <bernd@bsbernd.com>
> 
> No test ran service_ll, service_hl or null in service mode. No test
> checked that mount.fuse3 mounts through a listening service socket, and
> runs the filesystem program when the socket refuses the connection.
> 
> Assisted-by: LLM
> Signed-off-by: Bernd Schubert <bernd@bsbernd.com>

These are a reasonable set of simple tests to make sure that service
discovery and startup work correctly.  Thanks for writing these tests;
I suppose I had become over-reliant on testing all this via fstests.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  test/cases/lib/service-example.sh      | 62 ++++++++++++++++++++++++++++++++++
>  test/cases/mount/service-hl.sh         |  7 ++++
>  test/cases/mount/service-ll.sh         |  7 ++++
>  test/cases/mount/service-mount-fuse.sh | 31 +++++++++++++++++
>  test/cases/mount/service-null.sh       | 33 ++++++++++++++++++
>  5 files changed, 140 insertions(+)
> 
> diff --git a/test/cases/lib/service-example.sh b/test/cases/lib/service-example.sh
> new file mode 100644
> index 000000000000..878b379b8b16
> --- /dev/null
> +++ b/test/cases/lib/service-example.sh
> @@ -0,0 +1,62 @@
> +# lib/service-example.sh - body for the service_ll / service_hl cases.
> +#
> +# Caller sets FS_NAME and LAUNCH before sourcing:
> +#   FS_NAME   service_ll | service_hl
> +#   LAUNCH    fuservicemount3 | mount_fuse
> +#
> +# The file the example serves has to read back as the image, and what is
> +# written through the mount has to reach the image.
> +
> +_fuse_no_mount_needed=1
> +. "$TEST_LIB/common.sh"
> +
> +# Before the gates: a misspelled FS_NAME would otherwise skip as "not built"
> +case ${FS_NAME:-} in
> +service_ll | service_hl) ;;
> +*) _fail "unknown FS_NAME '${FS_NAME:-}'" ;;
> +esac
> +case ${LAUNCH:-} in
> +fuservicemount3 | mount_fuse) ;;
> +*) _fail "unknown LAUNCH '${LAUNCH:-}'" ;;
> +esac
> +
> +_require_linux "fuservicemount3"
> +_require_root
> +_require_fuse_device
> +_require_binary util/fuservicemount3
> +_require_binary "example/$FS_NAME"
> +[ "$LAUNCH" != mount_fuse ] || _require_binary util/mount.fuse3
> +
> +. "$TEST_LIB/service.sh"
> +
> +service_setup "test-$FS_NAME-$$"
> +img=$TEST_SRC/img
> +old=$TEST_TMP/old
> +new=$TEST_TMP/new
> +
> +# The size has to be a multiple of the page size
> +head -c 1048576 /dev/urandom >"$old"
> +head -c 1048576 /dev/urandom >"$new"
> +cp "$old" "$img"
> +
> +service_start "$TEST_LOGDIR/fs-$FS_NAME.out" "$FUSE_EXAMPLE_DIR/$FS_NAME"
> +case $LAUNCH in
> +fuservicemount3)
> +	"$FUSE_UTIL_DIR/fuservicemount3" "$img" "$TEST_MNT" \
> +		-t "fuse.$service_subtype" ||
> +		_fail "fuservicemount3 did not mount $FS_NAME"
> +	;;
> +mount_fuse)
> +	"$FUSE_UTIL_DIR/mount.fuse3" "$service_subtype#$img" "$TEST_MNT" ||
> +		_fail "mount.fuse3 did not mount $FS_NAME"
> +	;;
> +esac
> +
> +_assert_fstype "$TEST_MNT" "fuse.$service_subtype" fuse
> +_assert_file_eq "$TEST_MNT/single_file" "$old"
> +dd if="$new" of="$TEST_MNT/single_file" bs=64k conv=notrunc,fsync status=none
> +
> +umount "$TEST_MNT"
> +service_wait_exit
> +_assert_eq "$service_rc" 0 "$FS_NAME exit status"
> +_assert_file_eq "$img" "$new"
> diff --git a/test/cases/mount/service-hl.sh b/test/cases/mount/service-hl.sh
> new file mode 100755
> index 000000000000..6db3add3a5d1
> --- /dev/null
> +++ b/test/cases/mount/service-hl.sh
> @@ -0,0 +1,7 @@
> +#!/usr/bin/env bash
> +# GROUP: mount
> +
> +FS_NAME=service_hl
> +LAUNCH=fuservicemount3
> +
> +. "$TEST_LIB/service-example.sh"
> diff --git a/test/cases/mount/service-ll.sh b/test/cases/mount/service-ll.sh
> new file mode 100755
> index 000000000000..036553889f7a
> --- /dev/null
> +++ b/test/cases/mount/service-ll.sh
> @@ -0,0 +1,7 @@
> +#!/usr/bin/env bash
> +# GROUP: mount
> +
> +FS_NAME=service_ll
> +LAUNCH=fuservicemount3
> +
> +. "$TEST_LIB/service-example.sh"
> diff --git a/test/cases/mount/service-mount-fuse.sh b/test/cases/mount/service-mount-fuse.sh
> new file mode 100755
> index 000000000000..6bc95240c772
> --- /dev/null
> +++ b/test/cases/mount/service-mount-fuse.sh
> @@ -0,0 +1,31 @@
> +#!/usr/bin/env bash
> +# GROUP: mount
> +#
> +# mount.fuse3 mounts through the service when its socket listens, and execs a
> +# program named after the type when the socket refuses the connection.
> +
> +_fuse_no_mount_needed=1
> +. "$TEST_LIB/common.sh"
> +
> +_require_binary example/hello
> +
> +FS_NAME=service_ll
> +LAUNCH=mount_fuse
> +
> +. "$TEST_LIB/service-example.sh"
> +
> +fallback=test-fallback-$$
> +service_setup "$fallback"
> +
> +# Bound but never listening, so connect() gets ECONNREFUSED
> +python3 -c 'import socket, sys
> +socket.socket(socket.AF_UNIX, socket.SOCK_SEQPACKET).bind(sys.argv[1])' \
> +	"$service_sock"
> +
> +mkdir "$TEST_TMP/bin"
> +ln -s "$FUSE_EXAMPLE_DIR/hello" "$TEST_TMP/bin/$fallback"
> +export PATH="$TEST_TMP/bin:$PATH"
> +
> +fuse_mount_helper "$fallback" >/dev/null
> +_assert_listdir "$TEST_MNT" hello
> +fuse_umount
> diff --git a/test/cases/mount/service-null.sh b/test/cases/mount/service-null.sh
> new file mode 100755
> index 000000000000..b89107ae3a40
> --- /dev/null
> +++ b/test/cases/mount/service-null.sh
> @@ -0,0 +1,33 @@
> +#!/usr/bin/env bash
> +# GROUP: mount
> +#
> +# The null example mounts through fuservicemount3 on a regular file.
> +# null has no backing file and mounts on a regular file, so it does not use
> +# lib/service-example.sh.
> +
> +_fuse_no_mount_needed=1
> +. "$TEST_LIB/common.sh"
> +
> +_require_linux "fuservicemount3"
> +_require_root
> +_require_fuse_device
> +_require_binary util/fuservicemount3
> +_require_binary example/null
> +
> +. "$TEST_LIB/service.sh"
> +
> +service_setup "test-null-$$"
> +mnt_file=$TEST_TMP/file
> +_at_exit "umount -l '$mnt_file' 2>/dev/null"
> +printf 'dummy' >"$mnt_file"
> +
> +service_start "$TEST_LOGDIR/fs-null.out" "$FUSE_EXAMPLE_DIR/null"
> +# null takes no source, only the mount point
> +"$FUSE_UTIL_DIR/fuservicemount3" "$mnt_file" -t "fuse.$service_subtype" ||
> +	_fail "fuservicemount3 did not mount null"
> +
> +_check fuse_test_null_roundtrip "$mnt_file"
> +
> +umount "$mnt_file"
> +service_wait_exit
> +_assert_eq "$service_rc" 0 "null exit status"
> 
> -- 
> 2.53.0
> 
> 
> 

  reply	other threads:[~2026-09-25 22:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 22:23 [PATCH 00/10] libfuse: Add mount service safety checks and tests Bernd Schubert via B4 Relay
2026-09-24 22:23 ` [PATCH 01/10] mount_service: move the command line check into arg_in_cmdline() Bernd Schubert via B4 Relay
2026-09-25 21:40   ` Darrick J. Wong
2026-09-24 22:23 ` [PATCH 02/10] mount_service: open only paths named on the command line Bernd Schubert via B4 Relay
2026-09-25 22:05   ` Darrick J. Wong
2026-09-28  9:19     ` Bernd Schubert
2026-09-24 22:23 ` [PATCH 03/10] mount_service: refuse OPEN after the MNTPT request Bernd Schubert via B4 Relay
2026-09-25 22:07   ` Darrick J. Wong
2026-09-28  9:21     ` Bernd Schubert
2026-09-24 22:23 ` [PATCH 04/10] util: give fuservicemount3 an absolute build-tree runpath Bernd Schubert via B4 Relay
2026-09-25 22:09   ` Darrick J. Wong
2026-09-24 22:23 ` [PATCH 05/10] mount.fuse: free the options on the service mount return path Bernd Schubert via B4 Relay
2026-09-25 22:10   ` Darrick J. Wong
2026-09-24 22:23 ` [PATCH 06/10] example/single_file: take no sector size from a regular backing file Bernd Schubert via B4 Relay
2026-09-25 22:13   ` Darrick J. Wong
2026-09-24 22:23 ` [PATCH 07/10] test: check which files fuservicemount3 opens for the server Bernd Schubert via B4 Relay
2026-09-24 22:23 ` [PATCH 08/10] test: check what fuservicemount3 refuses Bernd Schubert via B4 Relay
2026-09-24 22:23 ` [PATCH 09/10] test: mount the service examples through fuservicemount3 Bernd Schubert via B4 Relay
2026-09-25 22:25   ` Darrick J. Wong [this message]
2026-09-28  9:27     ` Bernd Schubert
2026-09-24 22:23 ` [PATCH 10/10] test: run mkfs.ext4 through the service examples Bernd Schubert via B4 Relay
2026-09-25 22:27   ` Darrick J. Wong
2026-09-28  9:30     ` Bernd Schubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260925222512.GW6253@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=bernd@bsbernd.com \
    --cc=fuse-devel@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox