tar: add ptest support
PATCH v2 1/1 tar: add ptest support
From: yanxk <[email protected]>
original test suites takes 5 minutes with KVM enabled.
autotest files would contain reference to TMPDIR, now they are removed.
tar test would provide ptest output like:
PASS: compressor program failure
SKIP: remove-files with compression
PASS: remove-files with compression: grand-child
be aware tar tests contain some large compression and decompression tests that require large device storage.
those cases would not work fine in default qemu image, for the default storage is too small. Some errors:
listing sparse files bigger than 2^33 B ./testsuite: line 1928: echo: write error: No space left on device
they are hard coded in the original test scripts, no modifications have been made to that yet.
--- .../distro/include/ptest-packagelists.inc | 1 + meta/recipes-extended/tar/tar-1.34/run-ptest | 10 ++++++ meta/recipes-extended/tar/tar_1.34.bb | 31 +++++++++++++++++-- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-extended/tar/tar-1.34/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
@@ -102,6 +102,7 @@ PTESTS_SLOW = "\ python3-cryptography-ptest \ python3-ptest \ strace-ptest \ + tar-ptest \ tcl-ptest \ util-linux-ptest \ valgrind-ptest \
meta/recipes-extended/tar/tar-1.34/run-ptest new file +10 -0
@@ -0,0 +1,10 @@ +#!/bin/sh + +# Define tar test work dir +WORKDIR=/usr/lib/tar/ptest/tests/ + +# Run test +cd ${WORKDIR} +./atconfig ./atlocal ./testsuite + +./testsuite 2>&1 | grep -E '[0-9]{1,3}: ' | sed -e 's/^.....//' -e '/[ok]$/s/^/PASS: /;/FAILED (.*)/s/^/FAIL: /;/skipped (.*)/s/^/SKIP: /;/expected failure/ s/^/PASS: /;/UNEXPECTED PASS/s/^/FAIL: /' -e 's/ok$//g' -e 's/FAILED.*//g' -e 's/skipped.*//g' -e 's/expected failure.*//g' -e 's/UNEXPECTED PASS.*//g'
meta/recipes-extended/tar/tar_1.34.bb +29 -2
@@ -6,11 +6,13 @@ SECTION = "base" LICENSE = "GPL-3.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" -SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2" +SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2 \ + file://run-ptest \ +" SRC_URI[sha256sum] = "b44cc67f8a1f6b0250b7c860e952b37e8ed932a90bd9b1862a511079255646ff" -inherit autotools gettext texinfo +inherit autotools gettext texinfo ptest PACKAGECONFIG ??= "" PACKAGECONFIG:append:class-target = " ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)}"
@@ -42,6 +44,31 @@ do_install:append:class-target() { fi } +# Tar testsuite would generate some small tests that are bash +# scripts, so set ptest dependency to bash + +RDEPENDS:${PN}-ptest += "bash" + +do_compile_ptest() { + oe_runmake -C ${B}/gnu/ check + oe_runmake -C ${B}/lib/ check + oe_runmake -C ${B}/rmt/ check + oe_runmake -C ${B}/src/ check + oe_runmake -C ${B}/tests/ genfile checkseekhole ckmtime +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests/ + sed -i "/abs_/d" ${B}/tests/atconfig + install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/ + sed -i "s%${B}/../tar-1.34.build-aux:%%g" ${B}/tests/atlocal + install --mode=755 ${B}/tests/atlocal ${D}${PTEST_PATH}/tests/ + install --mode=755 ${B}/tests/genfile ${D}${PTEST_PATH}/tests/ + install --mode=755 ${B}/tests/checkseekhole ${D}${PTEST_PATH}/tests/ + install --mode=755 ${B}/tests/ckmtime ${D}${PTEST_PATH}/tests/ + install --mode=755 ${S}/tests/testsuite ${D}${PTEST_PATH}/tests/ +} + PACKAGES =+ "${PN}-rmt" FILES:${PN}-rmt = "${sbindir}/rmt*"
Signature · 1 line
2.25.1