Skip to contentSkip to conversation

librelp: Skip tls-ossl-connect-failure-vg.sh when libtool is missing

PATCH New Khem Raj 1 participant 2 messages Oct 1

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 librelp: Skip tls-ossl-connect-failure-vg.sh when libtool is missing

The test added in 1.13 runs the sender through ${srcdir}/../libtool, which only exists in the build tree. In ptest the sender cannot start and the test fails with exit status 127. Skip it like the other valgrind tests already do when libtool is not available.

AI-Generated: Uses Claude Code

---
 ...ssl-connect-failure-vg.sh-without-li.patch | 36 +++++++++++++++++++
 .../recipes-extended/rsyslog/librelp_1.13.bb  |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0001-tests-skip-tls-ossl-connect-failure-vg.sh-without-li.patch
meta-oe/recipes-extended/rsyslog/librelp/0001-tests-skip-tls-ossl-connect-failure-vg.sh-without-li.patch new file +36 -0
new file mode 100644
index 0000000000..903c6a5bcc
@@ -0,0 +1,36 @@
+From 1bd587299f7578f4e08242eb45282933b8c10b36 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 1 Oct 2026 10:31:31 -0700
+Subject: [PATCH] tests: skip tls-ossl-connect-failure-vg.sh without libtool
+
+The test runs the sender through ${srcdir}/../libtool, which only exists
+in a build tree. When the test suite is installed and run elsewhere, as
+with ptest, the sender cannot be started and the test fails with:
+
+  tls-ossl-connect-failure-vg.sh: line 22: .../tests/../libtool: No such file or directory
+  unexpected sender exit status 127 (expected authentication failure)
+
+The other valgrind tests already skip in this case through
+startup_receiver_valgrind(). Skip this one as well.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tests/tls-ossl-connect-failure-vg.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/tls-ossl-connect-failure-vg.sh b/tests/tls-ossl-connect-failure-vg.sh
+index d67378d..08bf018 100755
+--- a/tests/tls-ossl-connect-failure-vg.sh
++++ b/tests/tls-ossl-connect-failure-vg.sh
+@@ -9,6 +9,10 @@ if ! ./have_tlslib "openssl"; then
+ 	echo "OpenSSL support is not available"
+ 	exit 77
+ fi
++if [ ! -x "${srcdir}/../libtool" ]; then
++	echo "libtool not available, cannot run under valgrind"
++	exit 77
++fi
+
+ export errorlog="error.$LIBRELP_DYN.log"
+ export TLSLIB="-l openssl"
meta-oe/recipes-extended/rsyslog/librelp_1.13.bb +1 -0
index 479905f728..b7d64fcb9d 100644
@@ -8,6 +8,7 @@ DEPENDS = "gmp libidn zlib"
 
 SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=main;tag=v${PV} \
            file://run-ptest \
+           file://0001-tests-skip-tls-ossl-connect-failure-vg.sh-without-li.patch \
 "
 
 SRCREV = "bedc657e519568b25f611c8efc83eab6ac1068e9"
author
#1 lore raw

PATCH 2/2 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

---
 ...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
meta-oe/recipes-support/fuse/fuse3/0001-test_syscalls-Do-not-print-strerror-0.patch new file +36 -0
new file mode 100644
index 0000000000..eab67c623a
@@ -0,0 +1,36 @@
+From 75186b0a019645a2822c9d567464bb142cc8882a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+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 <[email protected]>
+---
+ 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)
meta-oe/recipes-support/fuse/fuse3/run-ptest +21 -1
index b63c4de0d9..b8295bbce9 100644
@@ -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()
+}'
meta-oe/recipes-support/fuse/fuse3_3.18.3.bb +17 -3
index 75dde98a7c..1e4b86a47a 100644
@@ -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"