@@ -95,6 +95,7 @@ PTESTS_FAST = "\
qemu \
quilt \
rpm-sequoia \
+ rsync \
sed \
slang \
utfcpp \
new file mode 100644
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+cd $(dirname $0)
+
+# backup.test intermittently fails on qemux86-64
+# (observed ~5 failures in 20 runs).
+# Upstream: https://github.com/RsyncProject/rsync/issues/941
+TESTS=$(cd testsuite && \
+ ls *.test | \
+ sed 's/\.test$//' | \
+ grep -v '^backup$')
+
+python3 runtests.py \
+ --rsync-bin=/usr/bin/rsync \
+ --tooldir=$(pwd) \
+ --srcdir=$(pwd) \
+ $TESTS
@@ -15,12 +15,17 @@ SRC_URI = "https://download.samba.org/pub/${BPN}/src/${BP}.tar.gz \
file://makefile-no-rebuild.patch \
file://determism.patch \
file://0001-Add-missing-prototypes-to-function-declarations.patch \
+ file://run-ptest \
"
SRC_URI[sha256sum] = "ff10aa2c151cd4b2dbbe6135126dbc854046113d2dfb49572a348233267eb315"
+RDEPENDS:${PN}-ptest += "\
+ python3-core \
+ bash \
+"
# Out-of-tree builds don't install the documentation currently
# https://github.com/RsyncProject/rsync/issues/846
-inherit autotools-brokensep
+inherit autotools-brokensep ptest
PACKAGECONFIG ??= "acl attr \
${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
@@ -62,6 +67,44 @@ do_install:append() {
install -m 0644 ${UNPACKDIR}/rsyncd.conf ${D}${sysconfdir}
}
+# Avoid "make check" since it executes the testsuite during the build.
+# Only build the helper binaries required by the ptest package.
+do_compile_ptest() {
+ oe_runmake \
+ tls \
+ getgroups \
+ getfsdev \
+ testrun \
+ trimslash \
+ t_unsafe \
+ wildtest \
+ simdtest
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}
+ install -d ${D}${PTEST_PATH}/support
+ cp -r ${S}/support/* ${D}${PTEST_PATH}/support/
+
+ # Several upstream tests access files directly from ${srcdir}
+ # (e.g. fuzzy.test, itemize.test, mkpath.test and wildmatch.test).
+ install -m 0644 ${S}/configure.ac ${D}${PTEST_PATH}/
+ install -m 0644 ${S}/rsync.c ${D}${PTEST_PATH}/
+ install -m 0644 ${S}/rsync.h ${D}${PTEST_PATH}/
+ install -m 0644 ${S}/wildtest.txt ${D}${PTEST_PATH}/
+
+ install -m 0755 ${S}/runtests.py ${D}${PTEST_PATH}/
+ install -m 0644 ${B}/config.h ${D}${PTEST_PATH}/
+ install -m 0644 ${S}/config.sub ${D}${PTEST_PATH}/
+
+ cp -r ${S}/testsuite ${D}${PTEST_PATH}/
+
+ for p in tls getgroups getfsdev testrun trimslash t_unsafe wildtest simdtest; do
+ install -m 0755 ${B}/$p ${D}${PTEST_PATH}/
+ done
+
+}
+
BBCLASSEXTEND = "native nativesdk"
CVE_STATUS[CVE-2024-12084] = "fixed-version: fixed since v3.4.0"
Package the upstream rsync testsuite and helper binaries into rsync-ptest package and add a run-ptest wrapper for executing the tests. backup.test is skipped due to intermittent failures observed on qemux86-64. The issue has been reported upstream: https://github.com/RsyncProject/rsync/issues/941 Tested on qemux86-64 using ptest-runner with all executed tests passing. Signed-off-by: Nikhil R <nikhilar2410@gmail.com> --- .../distro/include/ptest-packagelists.inc | 1 + meta/recipes-devtools/rsync/files/run-ptest | 17 +++++++ meta/recipes-devtools/rsync/rsync_3.4.2.bb | 45 ++++++++++++++++++- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/rsync/files/run-ptest