From ca3cf5fe14bed658890bac643cced054932fcb51 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 1 Oct 2026 11:09:35 -0700 Subject: [PATCH] fuse3: Fix ptest for the new test runner libfuse 3.18.3 replaced its pytest based tests with shell test cases driven by test/run-tests.py, so the pytest based run-ptest collected no tests at all. - Run test/run-tests.py from run-ptest and turn its result lines into ptest PASS/FAIL/SKIP lines. Use a run directory under the canonical /tmp, since some test filesystems mirror the real tree and cannot follow the /var/tmp symlink. - Install fuse_config.h, which the runner reads from the build tree. - Replace the pytest dependencies with the python3 modules the runner uses, and add coreutils and util-linux-losetup for dd status=none and losetup --show, which busybox does not support. - Do not print strerror(0) in test_syscalls, musl's "No error information" is flagged as suspicious output by the runner. All 87 tests now run on qemux86-64 musl: 80 pass, 7 skip. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- ...est_syscalls-Do-not-print-strerror-0.patch | 36 +++++++++++++++++++ meta-oe/recipes-support/fuse/fuse3/run-ptest | 22 +++++++++++- meta-oe/recipes-support/fuse/fuse3_3.18.3.bb | 20 +++++++++-- 3 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 meta-oe/recipes-support/fuse/fuse3/0001-test_syscalls-Do-not-print-strerror-0.patch diff --git a/meta-oe/recipes-support/fuse/fuse3/0001-test_syscalls-Do-not-print-strerror-0.patch b/meta-oe/recipes-support/fuse/fuse3/0001-test_syscalls-Do-not-print-strerror-0.patch new file mode 100644 index 0000000000..eab67c623a --- /dev/null +++ b/meta-oe/recipes-support/fuse/fuse3/0001-test_syscalls-Do-not-print-strerror-0.patch @@ -0,0 +1,36 @@ +From 75186b0a019645a2822c9d567464bb142cc8882a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 1 Oct 2026 10:42:51 -0700 +Subject: [PATCH] test_syscalls: Do not print strerror(0) + +test_open_acc() prints strerror() of the expected error, which is 0 for +the cases that should succeed. glibc returns "Success" for it, but musl +returns "No error information", and run-tests.py treats the word "error" +in the output as a failure: + + FAIL examples/passthrough-base suspicious output: script.out: ... 49 [open_acc(O_RDONLY) mode: 0600 message: 'No error information'] START + +Print "Success" when no error is expected. + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + test/test_syscalls.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/test/test_syscalls.c b/test/test_syscalls.c +index 115eab8..f849e7b 100644 +--- a/test/test_syscalls.c ++++ b/test/test_syscalls.c +@@ -1335,8 +1335,10 @@ static int do_test_open_acc(int flags, const char *flags_str, int mode, int err) + int res; + int fd; + ++ /* strerror(0) is "Success" on glibc but "No error information" on ++ * musl, which the test runner flags as a suspicious word. */ + start_test("open_acc(%s) mode: 0%03o message: '%s'", flags_str, mode, +- strerror(err)); ++ err ? strerror(err) : "Success"); + unlink(testfile); + res = create_testfile(testfile, data, datalen); + if (res == -1) diff --git a/meta-oe/recipes-support/fuse/fuse3/run-ptest b/meta-oe/recipes-support/fuse/fuse3/run-ptest index b63c4de0d9..b8295bbce9 100644 --- a/meta-oe/recipes-support/fuse/fuse3/run-ptest +++ b/meta-oe/recipes-support/fuse/fuse3/run-ptest @@ -1,3 +1,23 @@ #!/bin/sh -pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}' +# Run the libfuse test suite. The ptest directory mirrors the meson build +# tree (example/, test/, util/, fuse_config.h) that test/run-tests.py expects. +# Each finished test is reported as +# + 1.234s PASS notify/prune 0.12s +# so print it as is and add the ptest result line after it. +cd "$(dirname "$0")" + +# Some test filesystems mirror the real tree but cannot follow symlinks, so +# keep the run directory off paths like /var/tmp, which is a symlink to +# volatile/tmp. run-tests.py creates the directory and removes it when done. +run_dir="$(readlink -f /tmp)/fuse-tests-$$" + +python3 test/run-tests.py --build-dir "$(pwd)" --run-dir "$run_dir" 2>&1 | awk ' +{ print } +/^\+ *[0-9.]+s +(PASS|FAIL|SKIP) / { + line = $0 + sub(/^\+ *[0-9.]+s +/, "", line) + split(line, f, " ") + printf "%s: %s\n", f[1], f[2] + fflush() +}' diff --git a/meta-oe/recipes-support/fuse/fuse3_3.18.3.bb b/meta-oe/recipes-support/fuse/fuse3_3.18.3.bb index 75dde98a7c..1e4b86a47a 100644 --- a/meta-oe/recipes-support/fuse/fuse3_3.18.3.bb +++ b/meta-oe/recipes-support/fuse/fuse3_3.18.3.bb @@ -31,14 +31,25 @@ LDFLAGS:append:toolchain-clang:riscv32 = " -latomic" SRC_URI += " \ file://run-ptest \ file://fuse3.conf \ + file://0001-test_syscalls-Do-not-print-strerror-0.patch \ " -#python3-compile for filecmp module +# test/run-tests.py needs python3-asyncio for concurrent.futures, +# python3-compile for filecmp, python3-io for socket/tempfile and +# python3-shell for shlex. The test cases use dd status=none and +# losetup --show, which busybox does not support. RDEPENDS:${PN}-ptest += " \ + python3-asyncio \ python3-compile \ - python3-pytest \ - python3-looseversion \ + python3-core \ + python3-ctypes \ + python3-io \ + python3-json \ + python3-resource \ + python3-shell \ bash \ + coreutils \ file \ + util-linux-losetup \ " RRECOMMENDS:${PN}-ptest += " kernel-module-cuse" @@ -66,6 +77,9 @@ do_install_ptest() { do cp -rf $e ${D}${PTEST_PATH}/test done + + # test/run-tests.py reads the build configuration from the build tree + install -m 0644 ${B}/fuse_config.h ${D}${PTEST_PATH}/ } DEPENDS = "udev"