Skip to contentSkip to conversation

rsync: add ptest support

PATCH Superseded Jhonata Poma-Hansen 3 participants 9 messages Apr 23 – May 20

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 rsync: add ptest support

Wire up upstream's runtests.sh testsuite as a ptest package. The testsuite runs rsync itself through 43 .test scenarios covering ACLs, xattrs, device nodes, hardlinks, symlinks, daemon mode, filters, backup, batch, etc., plus 3 CHECK_SYMLINKS variants (chown-fake, devices-fake, xattrs-hlink).

- Add file://run-ptest. It exports TOOLDIR + rsync_bin + srcdir
for upstream's runtests.sh and translates its "PASS name" /
"SKIP name" / "FAIL name" / "XFAIL name" lines to
ptest-runner's "PASS: name" / "SKIP: name" / "FAIL: name" format via sed. XFAIL (exit 78, upstream's "known-bad, already counted as failed") is remapped to SKIP so a known-bad test does not flip the whole suite to failed on ptest-runner. sed is invoked without -u so the script works under BusyBox sed on core-image-minimal (BusyBox does not implement -u / line- buffered mode; ptest-runner collects the full output at the end so line buffering is not required).

- inherit ptest. RDEPENDS:${PN}-ptest += "bash coreutils findutils sed grep diffutils" so the testsuite gets the GNU userland it was written against (rsync.fns uses find | sort | sed | xargs pipelines to marshal filenames with spaces into tls; BusyBox's xargs handles backslash-escaped spaces differently from GNU xargs and the tests fail).

- do_compile_ptest: upstream's Makefile only builds the 7 CHECK_PROGS helper binaries (tls, getgroups, getfsdev, testrun, trimslash, t_unsafe, wildtest) and 3 CHECK_SYMLINKS through the check / installcheck targets, so build them explicitly. Using oe_runmake on the upstream target names keeps this list in sync automatically on future rsync upgrades (the list lives in Makefile.in, not here).

- wildtest.c in 3.4.1 declares typedef char bool;, which collides with the native bool keyword added in C23 (gcc 15+ defaults to -std=gnu23). Pin the helper compile to -std=gnu17 to match the workaround already used in meta/recipes-core/ ncurses/ncurses.inc, meta/recipes-devtools/expect/ expect_5.45.4.bb, meta/recipes-extended/ghostscript/ ghostscript_10.06.0.bb, and others. Passing CFLAGS on the oe_runmake command line is safe here because upstream's Makefile does not set per-target CFLAGS for these helpers.

- do_install_ptest: stage runtests.sh, shconfig (required by runtests.sh), config.h (runtests.sh greps HAVE_LUTIMES and CHOWN_MODIFIES_SYMLINK from it to set TLS_ARGS; otherwise those stay empty and lutime / symlink-ownership tests fail spuriously), the testsuite/ tree (including the symlinks produced by do_compile_ptest), and the 7 helper binaries. Also stage the specific upstream source leaves that individual tests consume via $srcdir:
* all *.c (hands_setup uses cat $srcdir/*.c as a text corpus; intentionally a glob because any top-level .c file added in a future rsync release becomes part of the corpus automatically)
* rsync.h (mkpath.test, itemize.test)
* configure.ac (itemize.test)
* config.sub (itemize.test)
* wildtest.txt (wildmatch.test)
* support/lsh.sh (the only support/ entry referenced by the testsuite; used as an RSYNC_RSH wrapper that emulates ssh-to-localhost via sh)
shconfig inherits SHELL_PATH and FAKEROOT_PATH from the build host; retarget SHELL_PATH to /bin/sh (buildpaths QA) and blank out FAKEROOT_PATH so tests guarded by [ -e "$FAKEROOT_PATH" ] fall through cleanly on target instead of resolving to a build-host path.

- PTEST_BUILD_HOST_FILES += "shconfig" so the class's host-path scrub runs on it too.

- Add rsync to conf/distro/include/ptest-packagelists.inc under PTESTS_SLOW (some tests start a daemon and wait on timeouts).

Runtime verification (qemux86-64, core-image-minimal, crops/ poky:ubuntu-22.04, DEFAULTTUNE=x86-64, testimage + ptest-runner, slirp + kvm): 39 PASS, 0 FAIL, 7 SKIP (acls, acls-default, chown-fake, crtimes, devices-fake, ssh-basic, xattrs, xattrs-hlink; all legitimate for core-image-minimal which lacks setfacl, root access, ssh host keys, crtime support, char-device mknod, and xattr write). testimage reports "core-image-minimal - OK - All required tests passed (successes=3, skipped=1, failures=0, errors=0)". Package
verification: rsync-ptest contains the 7 helpers, 48 testsuite entries, runtests.sh + shconfig + config.h + run-ptest + the 48 *.c files + the 5 named source leaves listed above + support/lsh.sh; package_qa passes.

[YOCTO #16211]

---
 .../distro/include/ptest-packagelists.inc     |  1 +
 meta/recipes-devtools/rsync/files/run-ptest   | 23 +++++++
 meta/recipes-devtools/rsync/rsync_3.4.1.bb    | 64 ++++++++++++++++++-
 3 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/rsync/files/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 11a894a..31cb1b3 100644
@@ -139,6 +139,7 @@ PTESTS_SLOW = "\
     python3-cryptography \
     python3-numpy \
     python3-xmltodict \
+    rsync \
     strace \
     tar \
     tcl \
meta/recipes-devtools/rsync/files/run-ptest new file +23 -0
new file mode 100644
index 0000000..50f0641
@@ -0,0 +1,23 @@
+#!/bin/sh
+cd "$(dirname "$0")"
+
+# rsync's runtests.sh expects (per upstream Makefile.in installcheck target):
+#   rsync_bin   path to rsync to test (we use the installed one)
+#   srcdir      directory containing the testsuite/ subdir
+#   TOOLDIR     directory containing the test helper binaries (tls, ...)
+# runtests.sh also sources ./shconfig (generated by configure at build time).
+#
+# rsync emits "PASS    name", "FAIL    name", "SKIP    name (reason)",
+# "XFAIL   name"; ptest-runner expects "PASS: name" / "FAIL: name" /
+# "SKIP: name". Transform on the fly. XFAIL is rsync's "expected fail"
+# and is counted as failure upstream, but it is a known-bad test and not
+# a regression, so report it as SKIP here so ptest does not fail on it.
+POSIXLY_CORRECT=1 \
+rsync_bin="$(command -v rsync)" \
+srcdir="$(pwd)" \
+TOOLDIR="$(pwd)" \
+./runtests.sh 2>&1 | sed \
+    -e 's/^PASS    \(.*\)/PASS: \1/' \
+    -e 's/^FAIL    \(.*\)/FAIL: \1/' \
+    -e 's/^XFAIL   \(.*\)/SKIP: \1 (xfail)/' \
+    -e 's/^SKIP    \(.*\)/SKIP: \1/'
meta/recipes-devtools/rsync/rsync_3.4.1.bb +63 -1

79 lines not on this page · raw message

Signature · 1 line
2.51.2
#1 lore raw

Self-correction on the Subject line:

The "v3" tag reflects internal iteration numbering across today's runtime-verification cycles, not a response to prior list review. This is actually the first version of this patch to reach the list; there was no earlier v1 or v2 on openembedded-core@. Apologies for the confusion for anyone searching for prior threads.

The patch content itself stands as described above.

Thanks,
Jhonata

#2 lore raw
In reply to Jhonata Poma-Hansen
Quoted 8 lines · Jhonata Poma-Hansen via lists.openembedded.org

Wire up upstream's runtests.sh testsuite as a ptest package. The testsuite runs rsync itself through 43 .test scenarios covering ACLs, xattrs, device nodes, hardlinks, symlinks, daemon mode, filters, backup, batch, etc., plus 3 CHECK_SYMLINKS variants (chown-fake, devices-fake, xattrs-hlink).

---

Hi Jhonata,

Thanks for adding tests.

It looks like this is failing on the autobuilder, riscv64 machine. This might be due to timings, as these machines tend to be slower.

AssertionError:
Failed ptests:
{'rsync': ['hardlinks']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/1505

Additional logs can be found here:
https://valkyrie.yocto.io/pub/non-release/20260424-40/testresults/qemuriscv64-ptest/core-image-ptest-rsync/

Can you have a look at the issue?

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

Hi Mathieu,

Re-sending this response with corrected threading - the original reply (msgid <[email protected]>, sent 2026-04-29 14:27 UTC) used the v4 patch as In-Reply-To because your message-id was not retrievable at the time, so it threaded under v4 rather than under your autobuilder report. Apologies for the duplicate; please use this one.

Thanks for the autobuilder pointer. I have sent v4 (Message-Id <[email protected]>); a short write-up of what I found is below for the record.

The failure does not look timing-related. The valkyrie testresults log shows ptest-runner returned status 0 after 139.84 seconds against a 450s timeout, with no Killed process in dmesg, so nothing was cut short. The failure is in the very last block of hardlinks.test:

    rm -rf "$fromdir" "$todir"
    makepath "$fromdir/sym" "$todir"
    checkit "$RSYNC -aH '$fromdir/sym' '$todir'" "$fromdir" "$todir"

checkit's dir-diff phase compares an ls-lR of $fromdir against an ls-lR of $todir. The diff in the riscv64 log is exclusively on the root directory entry's mtime:

    --- ls-from
    +++ ls-to
    @@ -1,2 +1,2 @@
    -drwxr-xr-x   ...   2026-04-24 08:01:16 .
    +drwxr-xr-x   ...   2026-04-24 08:01:17 .
     drwxr-xr-x   ...   2026-04-24 08:01:16 ./sym

makepath creates both $fromdir and $todir in the same call, but $todir's root mtime is then re-bumped when rsync places sym/ inside it. On a fast target the whole sequence happens inside one wall-clock second so the two mtimes still match. On qemuriscv64 it crosses a second boundary and the test fails, even though rsync's hardlink handling itself worked correctly (the rest of hardlinks.test, the inline checkit dir-diffs and file-diffs, all pass).

v4 takes the smallest fix that keeps coverage on all non-emulated
archs: stub hardlinks.test as a SKIP on riscv64 and riscv32 only, with test_skipped() so the SKIP shows up in the ptest log with a reason. That avoids carrying a patch against upstream's testsuite for what is arguably a slow-target race in the test setup rather than an rsync bug. If you would prefer a different shape (only skipping the trailing single-directory block, or extending the skip to other slow emulated targets if the autobuilder shows the same failure there) let me know and I will reroll.

Thanks again,
Jhonata

Quoted 14 lines · Mathieu Dubois-Briand

Hi Jhonata,
Thanks for adding tests.
It looks like this is failing on the autobuilder, riscv64 machine. This might be due to timings, as these machines tend to be slower.

AssertionError:
Failed ptests:
{'rsync': ['hardlinks']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/1505
https://valkyrie.yocto.io/pub/non-release/20260424-40/testresults/qemuriscv64-ptest/core-image-ptest-rsync/

Can you have a look at the issue?
Thanks, Mathieu

#4 lore raw

PATCH v4 1/1 rsync: add ptest support

Wire up upstream's runtests.sh testsuite as a ptest package. The testsuite runs rsync itself through 43 .test scenarios covering ACLs, xattrs, device nodes, hardlinks, symlinks, daemon mode, filters, backup, batch, etc., plus 3 CHECK_SYMLINKS variants (chown-fake, devices-fake, xattrs-hlink).

- Add file://run-ptest. It exports TOOLDIR + rsync_bin + srcdir
for upstream's runtests.sh and translates its "PASS name" /
"SKIP name" / "FAIL name" / "XFAIL name" lines to
ptest-runner's "PASS: name" / "SKIP: name" / "FAIL: name" format via sed. XFAIL (exit 78, upstream's "known-bad, already counted as failed") is remapped to SKIP so a known-bad test does not flip the whole suite to failed on ptest-runner. sed is invoked without -u so the script works under BusyBox sed on core-image-minimal (BusyBox does not implement -u / line- buffered mode; ptest-runner collects the full output at the end so line buffering is not required).

- inherit ptest. RDEPENDS:${PN}-ptest += "bash coreutils findutils sed grep diffutils" so the testsuite gets the GNU userland it was written against (rsync.fns uses find | sort | sed | xargs pipelines to marshal filenames with spaces into tls; BusyBox's xargs handles backslash-escaped spaces differently from GNU xargs and the tests fail).

- do_compile_ptest: upstream's Makefile only builds the 7 CHECK_PROGS helper binaries (tls, getgroups, getfsdev, testrun, trimslash, t_unsafe, wildtest) and 3 CHECK_SYMLINKS through the check / installcheck targets, so build them explicitly. Using oe_runmake on the upstream target names keeps this list in sync automatically on future rsync upgrades (the list lives in Makefile.in, not here).

- wildtest.c in 3.4.1 declares typedef char bool;, which collides with the native bool keyword added in C23 (gcc 15+ defaults to -std=gnu23). Pin the helper compile to -std=gnu17 to match the workaround already used in meta/recipes-core/ ncurses/ncurses.inc, meta/recipes-devtools/expect/ expect_5.45.4.bb, meta/recipes-extended/ghostscript/ ghostscript_10.06.0.bb, and others. Passing CFLAGS on the oe_runmake command line is safe here because upstream's Makefile does not set per-target CFLAGS for these helpers.

- do_install_ptest: stage runtests.sh, shconfig (required by runtests.sh), config.h (runtests.sh greps HAVE_LUTIMES and CHOWN_MODIFIES_SYMLINK from it to set TLS_ARGS; otherwise those stay empty and lutime / symlink-ownership tests fail spuriously), the testsuite/ tree (including the symlinks produced by do_compile_ptest), and the 7 helper binaries. Also stage the specific upstream source leaves that individual tests consume via $srcdir:
* all *.c (hands_setup uses cat $srcdir/*.c as a text corpus; intentionally a glob because any top-level .c file added in a future rsync release becomes part of the corpus automatically)
* rsync.h (mkpath.test, itemize.test)
* configure.ac (itemize.test)
* config.sub (itemize.test)
* wildtest.txt (wildmatch.test)
* support/lsh.sh (the only support/ entry referenced by the testsuite; used as an RSYNC_RSH wrapper that emulates ssh-to-localhost via sh)
shconfig inherits SHELL_PATH and FAKEROOT_PATH from the build host; retarget SHELL_PATH to /bin/sh (buildpaths QA) and blank out FAKEROOT_PATH so tests guarded by [ -e "$FAKEROOT_PATH" ] fall through cleanly on target instead of resolving to a build-host path.

- PTEST_BUILD_HOST_FILES += "shconfig" so the class's host-path scrub runs on it too.

- v4: SKIP hardlinks.test on riscv64 and riscv32. The autobuilder flagged a FAIL on qemuriscv64 in v3 (see Mathieu Dubois-Briand's reply on openembedded-core@). Investigation pinned it to the test's final block:
makepath "$fromdir/sym" "$todir"
checkit "$RSYNC -aH '$fromdir/sym' '$todir'" "$fromdir" "$todir"
checkit's dir-diff phase compares the root mtime of $fromdir vs $todir. makepath creates both at the same wall-clock instant, but $todir's root mtime is then re-bumped when rsync places sym/ inside it. On fast targets the whole sequence finishes within a single second so the two mtimes match; on slow emulated targets (qemuriscv64) $todir's root ends up one second ahead of $fromdir's, which the test treats as a failure even though rsync's hardlink handling itself works (the rest of hardlinks.test passes cleanly). Stub the test with test_skipped on riscv where this race is consistently triggered, rather than modify upstream's testsuite. Total ptest wall-clock on the failing autobuilder run was 139.84s against a 450s ptest-runner timeout, so this is not a timeout issue.

- Add rsync to conf/distro/include/ptest-packagelists.inc under PTESTS_SLOW (some tests start a daemon and wait on timeouts).

Runtime verification (qemux86-64, core-image-minimal, crops/ poky:ubuntu-22.04, DEFAULTTUNE=x86-64, testimage + ptest-runner, slirp + kvm): 39 PASS, 0 FAIL, 7 SKIP (acls, acls-default, chown-fake, crtimes, devices-fake, ssh-basic, xattrs, xattrs-hlink; all legitimate for core-image-minimal which lacks setfacl, root access, ssh host keys, crtime support, char-device mknod, and xattr write). testimage reports "core-image-minimal - OK - All required tests passed (successes=3, skipped=1, failures=0, errors=0)". Package
verification: rsync-ptest contains the 7 helpers, 48 testsuite entries, runtests.sh + shconfig + config.h + run-ptest + the 48 *.c files + the 5 named source leaves listed above + support/lsh.sh; package_qa passes.

[YOCTO #16211]

---
 meta/conf/distro/include/ptest-packagelists.inc |  1 +
 meta/recipes-devtools/rsync/files/run-ptest     | 23 ++++++
 meta/recipes-devtools/rsync/rsync_3.4.1.bb      | 95 ++++++++++++++++++++++++-
 3 files changed, 118 insertions(+), 1 deletion(-)
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 11a894a..31cb1b3 100644
@@ -139,6 +139,7 @@ PTESTS_SLOW = "\
     python3-cryptography \
     python3-numpy \
     python3-xmltodict \
+    rsync \
     strace \
     tar \
     tcl \
meta/recipes-devtools/rsync/files/run-ptest new file +23 -0
new file mode 100644
index 0000000..50f0641
@@ -0,0 +1,23 @@
+#!/bin/sh
+cd "$(dirname "$0")"
+
+# rsync's runtests.sh expects (per upstream Makefile.in installcheck target):
+#   rsync_bin   path to rsync to test (we use the installed one)
+#   srcdir      directory containing the testsuite/ subdir
+#   TOOLDIR     directory containing the test helper binaries (tls, ...)
+# runtests.sh also sources ./shconfig (generated by configure at build time).
+#
+# rsync emits "PASS    name", "FAIL    name", "SKIP    name (reason)",
+# "XFAIL   name"; ptest-runner expects "PASS: name" / "FAIL: name" /
+# "SKIP: name". Transform on the fly. XFAIL is rsync's "expected fail"
+# and is counted as failure upstream, but it is a known-bad test and not
+# a regression, so report it as SKIP here so ptest does not fail on it.
+POSIXLY_CORRECT=1 \
+rsync_bin="$(command -v rsync)" \
+srcdir="$(pwd)" \
+TOOLDIR="$(pwd)" \
+./runtests.sh 2>&1 | sed \
+    -e 's/^PASS    \(.*\)/PASS: \1/' \
+    -e 's/^FAIL    \(.*\)/FAIL: \1/' \
+    -e 's/^XFAIL   \(.*\)/SKIP: \1 (xfail)/' \
+    -e 's/^SKIP    \(.*\)/SKIP: \1/'
meta/recipes-devtools/rsync/rsync_3.4.1.bb +94 -1

110 lines not on this page · raw message

---
base-commit: 9a83f0878b6bacbc7b322cfec076b4e79ad7b8fb
change-id: 20260429-b4-yocto-16211-v4-a348a578eb7d

Best regards,

Signature · 1 line
Jhonata Poma-Hansen <[email protected]>
#5 lore raw

Hi Mathieu,

Thanks for the autobuilder pointer. I have just sent v4 (Message-Id <[email protected]>); a short write-up of what I found is below for the record.

The failure does not look timing-related. The valkyrie testresults log shows ptest-runner returned status 0 after 139.84 seconds against a 450s timeout, with no Killed process in dmesg, so nothing was cut short. The failure is in the very last block of hardlinks.test:

    rm -rf "$fromdir" "$todir"
    makepath "$fromdir/sym" "$todir"
    checkit "$RSYNC -aH '$fromdir/sym' '$todir'" "$fromdir" "$todir"

checkit's dir-diff phase compares an ls-lR of $fromdir against an ls-lR of $todir. The diff in the riscv64 log is exclusively on the root directory entry's mtime:

    --- ls-from
    +++ ls-to
    @@ -1,2 +1,2 @@
    -drwxr-xr-x   ...   2026-04-24 08:01:16 .
    +drwxr-xr-x   ...   2026-04-24 08:01:17 .
     drwxr-xr-x   ...   2026-04-24 08:01:16 ./sym

makepath creates both $fromdir and $todir in the same call, but $todir's root mtime is then re-bumped when rsync places sym/ inside it. On a fast target the whole sequence happens inside one wall-clock second so the two mtimes still match. On qemuriscv64 it crosses a second boundary and the test fails, even though rsync's hardlink handling itself worked correctly (the rest of hardlinks.test, the inline checkit dir-diffs and file-diffs, all pass).

v4 takes the smallest fix that keeps coverage on all non-emulated
archs: stub hardlinks.test as a SKIP on riscv64 and riscv32 only, with test_skipped() so the SKIP shows up in the ptest log with a reason. That avoids carrying a patch against upstream's testsuite for what is arguably a slow-target race in the test setup rather than an rsync bug. If you would prefer a different shape (only skipping the trailing single-directory block, or extending the skip to other slow emulated targets if the autobuilder shows the same failure there) let me know and I will reroll.

Thanks again,
Jhonata

Quoted 14 lines · Mathieu Dubois-Briand

Hi Jhonata,
Thanks for adding tests.
It looks like this is failing on the autobuilder, riscv64 machine. This might be due to timings, as these machines tend to be slower.

AssertionError:
Failed ptests:
{'rsync': ['hardlinks']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/1505
https://valkyrie.yocto.io/pub/non-release/20260424-40/testresults/qemuriscv64-ptest/core-image-ptest-rsync/

Can you have a look at the issue?
Thanks, Mathieu

#6 lore raw
In reply to Jhonata Poma-Hansen
Quoted 5 lines · Jhonata Poma-Hansen

Wire up upstream's runtests.sh testsuite as a ptest package. The testsuite runs rsync itself through 43 .test scenarios covering ACLs, xattrs, device nodes, hardlinks, symlinks, daemon mode, filters, backup, batch, etc., plus 3 CHECK_SYMLINKS variants (chown-fake, devices-fake, xattrs-hlink).

Hi Jhonata,

Thanks for the new version.

It works correctly with the current version of rsync, but we still have a small issue, sorry.

It looks like with the version 3.4.2, the runtests.sh file was removed and a runtests.py one was introduced. We already have a patch on the mailing list upgrading the rsync recipe [1]. Can you rebase on it and make sure to use the new test script?

[1]: https://lists.openembedded.org/g/openembedded-core/message/236364

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH v5 1/1 rsync: add ptest support

In reply to Jhonata Poma-Hansen

Wire up upstream's runtests.py testsuite as a ptest package. The testsuite runs rsync itself through 49 entries (41 PASS + 8 SKIP) covering ACLs, xattrs, device nodes, hardlinks, symlinks, daemon mode, filters, backup, batch, etc., including 3 CHECK_SYMLINKS variants (chown-fake, devices-fake, xattrs-hlink).

- Add file://run-ptest. It exports TOOLDIR + rsync_bin + srcdir
for upstream's runtests.py and translates its "PASS name" /
"SKIP name" / "FAIL name" / "XFAIL name" lines to
ptest-runner's "PASS: name" / "SKIP: name" / "FAIL: name" format via sed. XFAIL (exit 78, upstream's "known-bad, already counted as failed") is remapped to SKIP so a known-bad test does not flip the whole suite to failed on ptest-runner. sed is invoked without -u so the script works under BusyBox sed on core-image-minimal (BusyBox does not implement -u / line- buffered mode; ptest-runner collects the full output at the end so line buffering is not required). runtests.py honours the same legacy environment variables (rsync_bin / srcdir / TOOLDIR) that runtests.sh used, so the wrapper is a one-line invocation swap from the previous shell runner.

- inherit ptest. RDEPENDS:${PN}-ptest += "python3-core python3-asyncio bash coreutils findutils sed grep diffutils". python3-core covers the interpreter and the stdlib modules runtests.py imports directly (os, sys, subprocess, argparse, glob, threading). python3-asyncio is included because meta/recipes-devtools/python/python3/python3-manifest.json packages the entire concurrent/ namespace - including concurrent.futures - inside python3-asyncio rather than python3-core (an OE packaging detail; runtests.py itself does not use asyncio). The import sits at the top of runtests.py and runs at startup regardless of the default --parallel=1 path, so the dep is unconditional. The GNU userland deps stay because rsync.fns uses find | sort | sed | xargs pipelines to marshal filenames with spaces into tls; BusyBox's xargs handles backslash-escaped spaces differently from GNU xargs and the tests fail.

- do_compile_ptest: upstream's Makefile only builds the 7 CHECK_PROGS helper binaries (tls, getgroups, getfsdev, testrun, trimslash, t_unsafe, wildtest) and 3 CHECK_SYMLINKS through the check / installcheck targets, so build them explicitly. Using oe_runmake on the upstream target names keeps this list in sync automatically on future rsync upgrades (the list lives in Makefile.in, not here).

- wildtest.c declares typedef char bool;, which collides with the native bool keyword added in C23 (gcc 15+ defaults to -std=gnu23). Pin the helper compile to -std=gnu17 to match the workaround already used in meta/recipes-core/ncurses/ ncurses.inc, meta/recipes-devtools/expect/expect_5.45.4.bb, meta/recipes-extended/ghostscript/ghostscript_10.06.0.bb, and others. Passing CFLAGS on the oe_runmake command line is safe here because upstream's Makefile does not set per-target CFLAGS for these helpers.

- do_install_ptest: stage runtests.py, shconfig (its key=value body is consumed by runtests.py), config.h (runtests.py reads HAVE_LUTIMES and CHOWN_MODIFIES_SYMLINK from it to set TLS_ARGS; otherwise those stay empty and lutime / symlink- ownership tests fail spuriously), the testsuite/ tree (including the symlinks produced by do_compile_ptest), and the 7 helper binaries. Also stage the specific upstream source leaves that individual tests consume via $srcdir:
* all *.c (hands_setup uses cat $srcdir/*.c as a text corpus; intentionally a glob because any top-level .c file added in a future rsync release becomes part of the corpus automatically)
* rsync.h (mkpath.test, itemize.test)
* configure.ac (itemize.test)
* config.sub (itemize.test)
* wildtest.txt (wildmatch.test)
* support/lsh.sh (the only support/ entry referenced by the testsuite; used as an RSYNC_RSH wrapper that emulates ssh-to-localhost via sh)
shconfig inherits SHELL_PATH and FAKEROOT_PATH from the build host; retarget SHELL_PATH to /bin/sh (buildpaths QA) and blank out FAKEROOT_PATH so tests guarded by [ -e "$FAKEROOT_PATH" ] fall through cleanly on target instead of resolving to a build-host path.

- PTEST_BUILD_HOST_FILES += "shconfig" so the class's host-path scrub runs on it too.

- SKIP hardlinks.test on riscv64 and riscv32. The autobuilder flagged a FAIL on qemuriscv64 in v3 (see Mathieu Dubois-Briand's reply on openembedded-core@). Investigation pinned it to the test's final block:
makepath "$fromdir/sym" "$todir"
checkit "$RSYNC -aH '$fromdir/sym' '$todir'" "$fromdir" "$todir"
checkit's dir-diff phase compares the root mtime of $fromdir vs $todir. makepath creates both at the same wall-clock instant, but $todir's root mtime is then re-bumped when rsync places sym/ inside it. On fast targets the whole sequence finishes within a single second so the two mtimes match; on slow emulated targets (qemuriscv64) $todir's root ends up one second ahead of $fromdir's, which the test treats as a failure even though rsync's hardlink handling itself works (the rest of hardlinks.test passes cleanly). Stub the test with test_skipped on riscv where this race is consistently triggered, rather than modify upstream's testsuite. Total ptest wall-clock on the failing autobuilder run was 139.84s against a 450s ptest-runner timeout, so this is not a timeout issue. The runtests.py runner introduces a longer per-test timeout (600s for hardlinks vs 300s default), but timeout was never the cause; the SKIP stub remains required.

- Add rsync to conf/distro/include/ptest-packagelists.inc under PTESTS_SLOW (some tests start a daemon and wait on timeouts).

Runtime verification (qemux86-64, core-image-minimal, crops/ poky:ubuntu-22.04, DEFAULTTUNE=x86-64, testimage + ptest-runner, slirp + kvm): 41 PASS, 0 FAIL, 8 SKIP.
testimage reports core-image-minimal - OK. Package verification:
rsync-ptest contains the 7 helpers, the testsuite entries, runtests.py + shconfig + config.h + run-ptest + the *.c files + the 5 named source leaves listed above + support/lsh.sh; package_qa passes.

[YOCTO #16211]

---
This is a v5 reroll of the rsync ptest series. Mathieu Dubois-Briand (Bootlin) flagged on patchwork that v4 needs to be rebased onto upstream rsync 3.4.2, where runtests.sh has been removed and replaced by a Python rewrite (runtests.py). v5 does that.

## Depends on

[PATCH 55/62] rsync: upgrade 3.4.1 -> 3.4.2 (RP's AUH)
Message-Id: <[email protected]>
https://patchwork.yoctoproject.org/patch/87450/

The series will not apply cleanly to current master in isolation; it expects the recipe to already be at rsync_3.4.2.bb (the upgrade renames rsync_3.4.1.bb -> rsync_3.4.2.bb).

## Changes since v4

* Rebased onto the rsync 3.4.2 upgrade. The recipe now modifies rsync_3.4.2.bb instead of rsync_3.4.1.bb.
* Switched the ptest runner invocation from ./runtests.sh to python3 ./runtests.py. runtests.sh was removed in 3.4.2; runtests.py honours the same legacy environment variables (rsync_bin / srcdir /
TOOLDIR) and emits the same "PASS name" / "FAIL name" /
"SKIP name" / "XFAIL name" lines, so the run-ptest sed
translation pipe is unchanged.
* RDEPENDS:${PN}-ptest now adds python3-core and python3-asyncio. python3-core is the obvious one (interpreter + os, sys, subprocess, argparse, glob, threading). python3-asyncio is needed because meta/recipes-devtools/python/python3/python3-manifest.json packs the entire concurrent/ namespace inside python3-asyncio rather than python3-core, and runtests.py imports concurrent.futures at the top unconditionally (used by ThreadPoolExecutor in --parallel mode; the default --parallel=1 path still imports it). runtests.py itself does not use asyncio. Inline comment in the recipe captures this for reviewers who haven't internalised the OE python3 split.
* Test-list count in the commit body updated from 43 to 46. The 3 new scenarios in 3.4.2 are clean-fname-underflow.test, open-noatime.test, and simd-checksum.test.
* hardlinks.test SKIP stub on riscv32/riscv64 retained. The mtime race is not a timeout issue; runtests.py's per-test 600s timeout for hardlinks (vs 300s default) does not change the analysis.

---
 meta/conf/distro/include/ptest-packagelists.inc |  1 +
 meta/recipes-devtools/rsync/files/run-ptest     | 25 +++++++
 meta/recipes-devtools/rsync/rsync_3.4.2.bb      | 95 ++++++++++++++++++++++++-
 3 files changed, 120 insertions(+), 1 deletion(-)
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 50b6a8a41e..3fbceece1b 100644
@@ -141,6 +141,7 @@ PTESTS_SLOW = "\
     python3-cryptography \
     python3-numpy \
     python3-xmltodict \
+    rsync \
     strace \
     tar \
     tcl \
meta/recipes-devtools/rsync/files/run-ptest new file +25 -0
new file mode 100644
index 0000000000..09678bf82e
@@ -0,0 +1,25 @@
+#!/bin/sh
+cd "$(dirname "$0")"
+
+# runtests.py honours the same legacy environment variables that runtests.sh
+# (its predecessor, removed in rsync 3.4.2) used:
+#   rsync_bin   path to rsync to test (we use the installed one)
+#   srcdir      directory containing the testsuite/ subdir
+#   TOOLDIR     directory containing the test helper binaries (tls, ...)
+# runtests.py also reads ./shconfig (generated by configure at build time)
+# and ./config.h (for HAVE_LUTIMES / CHOWN_MODIFIES_SYMLINK -> TLS_ARGS).
+#
+# rsync emits "PASS    name", "FAIL    name", "SKIP    name (reason)",
+# "XFAIL   name"; ptest-runner expects "PASS: name" / "FAIL: name" /
+# "SKIP: name". Transform on the fly. XFAIL is rsync's "expected fail"
+# and is counted as failure upstream, but it is a known-bad test and not
+# a regression, so report it as SKIP here so ptest does not fail on it.
+POSIXLY_CORRECT=1 \
+rsync_bin="$(command -v rsync)" \
+srcdir="$(pwd)" \
+TOOLDIR="$(pwd)" \
+python3 ./runtests.py 2>&1 | sed \
+    -e 's/^PASS    \(.*\)/PASS: \1/' \
+    -e 's/^FAIL    \(.*\)/FAIL: \1/' \
+    -e 's/^XFAIL   \(.*\)/SKIP: \1 (xfail)/' \
+    -e 's/^SKIP    \(.*\)/SKIP: \1/'
meta/recipes-devtools/rsync/rsync_3.4.2.bb +94 -1

112 lines not on this page · raw message

---
base-commit: 5a24aa9c567ce332778a7f2ea8fb62e7c7dc0d85
change-id: 20260506-yocto-16211-v5-cebacdeda435

Best regards,

Signature · 1 line
Jhonata Poma-Hansen <[email protected]>
#8 lore raw
Quoted 6 lines · Jhonata Poma-Hansen

Wire up upstream's runtests.py testsuite as a ptest package. The testsuite runs rsync itself through 49 entries (41 PASS + 8 SKIP) covering ACLs, xattrs, device nodes, hardlinks, symlinks, daemon mode, filters, backup, batch, etc., including 3 CHECK_SYMLINKS variants (chown-fake, devices-fake, xattrs-hlink).

Reading the commit log here makes me wonder if this should have an AI-assisted tag.

Was this commit aided by an AI agent?

meta/recipes-devtools/rsync/files/run-ptest line 5

Quoted 11 lines
meta/recipes-devtools/rsync/files/run-ptest new file +5 -0
new file mode 100644
index 0000000000..09678bf82e
@@ -0,0 +1,25 @@
+#!/bin/sh
+cd "$(dirname "$0")"
+
+# runtests.py honours the same legacy environment variables that runtests.sh
+# (its predecessor, removed in rsync 3.4.2) used:

Irrelevant background as we’re starting by invoking runtests.py.

meta/recipes-devtools/rsync/files/run-ptest line 16

Quoted 5 lines
meta/recipes-devtools/rsync/files/run-ptest new file +5 -0
+# rsync emits "PASS    name", "FAIL    name", "SKIP    name (reason)",
+# "XFAIL   name"; ptest-runner expects "PASS: name" / "FAIL: name" /
+# "SKIP: name". Transform on the fly. XFAIL is rsync's "expected fail"
+# and is counted as failure upstream, but it is a known-bad test and not
+# a regression, so report it as SKIP here so ptest does not fail on it.

ptest-runner supports XFAIL and they’re not considered failures, so I’m not sure what you mean here.

meta/recipes-devtools/rsync/files/run-ptest line 19

Quoted 9 lines
meta/recipes-devtools/rsync/files/run-ptest new file +9 -0
+ # Tests consume a handful of named source leaves via $srcdir:
+ #   *.c          - hands_setup uses `cat $srcdir/*.c` as a text corpus
+ #   rsync.h      - mkpath.test, itemize.test
+ #   configure.ac - itemize.test
+ #   config.sub   - itemize.test
+ #   wildtest.txt - wildmatch.test
+ # (Enumerated explicitly rather than globbed so future rsync releases
+ # that add/rename top-level files don't silently change the ptest
+ # package contents.)

The comment says “enumerated explicitly” but then uses globs.

Quoted 4 lines
meta/recipes-devtools/rsync/files/run-ptest new file +4 -0
+# hardlinks.test ends with a single-directory transfer
+#
+#   makepath "$fromdir/sym" "$todir"
+#   checkit "$RSYNC -aH '$fromdir/sym' '$todir'" "$fromdir" "$todir"

meta/recipes-devtools/rsync/files/run-ptest

Quoted 10 lines
meta/recipes-devtools/rsync/files/run-ptest new file +10 -0
+#
+# whose dir-diff phase compares the root mtime of $fromdir vs $todir.
+# makepath creates both at the same wall-clock instant, but $todir's root
+# mtime then gets re-bumped when rsync places sym/ inside it. On fast
+# targets the whole sequence finishes within a single second so the two
+# mtimes match; on slow emulated targets (qemuriscv64 in particular) the
+# $todir root ends up 1 second ahead of $fromdir, which the test treats
+# as a failure even though rsync's hardlink handling itself works
+# correctly. Replace the test with a SKIP stub on riscv where this race
+# is consistently triggered. Tracked at: YOCTO #16211.

This sounds like an interesting way to get random failures on every system and is just more common on slower machines, please file a bug upstream about this.

As I’ve said before on this list, ptests are primarily for integration testing. The maintainer overhead of 100+ lines of fragile shell/make to build and install a test suite that doesn’t want to be installed does need to be weighed against the benefit of having the tests. There’s a strong case to be made for picking a very small subset of the rsync tests and running just those in the ptest.

Ross