diff mbox series

[meta-oe,2/2] overlayfs-tools: add ptest support

Message ID 20261117103537.814124-2-uvv.mail@gmail.com
State Under Review
Headers show
Series [meta-oe,1/2] overlayfs-tools: upgrade 2026.10 -> 2026.11 | expand

Commit Message

Vyacheslav Yurkov Nov. 17, 2026, 10:35 a.m. UTC
From: Vyacheslav Yurkov <uvv.mail@gmail.com>

Run the upstream test cases on the target: the output of "overlay diff",
"overlay diff -v" and "overlay diff -b" is compared with the expected
results, and the result of "overlay merge" is mounted as an overlay.

The upstream meson test targets wrap these steps in sudo. ptest runs as
root, so run-ptest performs them directly. The tests need root, trusted.*
xattr support in TMPDIR and overlayfs support in the kernel; if any of
these is missing, the tests are reported as SKIP.

"overlay merge" generates a script that uses GNU coreutils options
(chmod --reference, mv -T, cp --attributes-only), hence the coreutils
dependency.

The tests take about a second, so add the recipe to
PTESTS_FAST_META_FILESYSTEMS.

AI-Assisted: Claude
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
 .../ptest-packagelists-meta-filesystems.inc       |  1 +
 .../overlayfs/overlayfs-tools/run-ptest           |  7 +++++++
 .../overlayfs/overlayfs-tools_2026.11.bb          | 15 ++++++++++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100755 meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/run-ptest
diff mbox series

Patch

diff --git a/meta-filesystems/conf/include/ptest-packagelists-meta-filesystems.inc b/meta-filesystems/conf/include/ptest-packagelists-meta-filesystems.inc
index 26917a93c9..bf2701b660 100644
--- a/meta-filesystems/conf/include/ptest-packagelists-meta-filesystems.inc
+++ b/meta-filesystems/conf/include/ptest-packagelists-meta-filesystems.inc
@@ -9,6 +9,7 @@ 
 PTESTS_FAST_META_FILESYSTEMS = "\
     e2tools \
     exfatprogs \
+    overlayfs-tools \
     unionfs-fuse \
 "
 
diff --git a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/run-ptest b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/run-ptest
new file mode 100755
index 0000000000..80e0c2b6b6
--- /dev/null
+++ b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools/run-ptest
@@ -0,0 +1,7 @@ 
+#!/bin/sh
+cd "$(dirname "$0")" || exit 1
+./test_cases/run-tests.sh "$(command -v overlay)" ./test_cases
+rc=$?
+# 77 means "could not run"; the script already printed SKIP lines
+[ $rc -eq 77 ] && exit 0
+exit $rc
diff --git a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_2026.11.bb b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_2026.11.bb
index f0c378e043..4714479024 100644
--- a/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_2026.11.bb
+++ b/meta-filesystems/recipes-utils/overlayfs/overlayfs-tools_2026.11.bb
@@ -5,12 +5,25 @@  LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f312a7c4d02230e8f2b537295d375c69"
 
 SRC_URI = "\
     git://github.com/kmxz/overlayfs-tools.git;protocol=https;branch=master;tag=v${PV} \
+    file://run-ptest \
 "
 
 SRCREV = "42582352e11b162895c06826f18a2246d8005ca9"
 
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
 
-inherit meson pkgconfig
+inherit meson pkgconfig ptest
 
 DEPENDS:append:libc-musl = " fts"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/test_cases
+    install -m 0755 ${S}/test_cases/run-tests.sh ${D}${PTEST_PATH}/test_cases/
+    for f in lower.tar upper.tar diff.saved verbose.saved brief.saved; do
+        install -m 0644 ${S}/test_cases/$f ${D}${PTEST_PATH}/test_cases/
+    done
+}
+
+# "overlay merge" generates a script that needs GNU coreutils options
+RDEPENDS:${PN}-ptest += "attr coreutils diffutils tar"
+RRECOMMENDS:${PN}-ptest += "kernel-module-overlay"