tar: add ptest support
PATCH v4 1/1 tar: add ptest support
From: Qiu Tingting <[email protected]>
Add a ptest for tar.
- It is taking around 3m to execute with kvm, so added it to PTEST_SLOW.
- It contains 244 cases.
- Below is parts of the run log:
START: ptest-runner
2023-09-22T05:58
BEGIN: /usr/lib/tar/ptest
## ------------------------ ##
## GNU tar 1.35 test suite. ##
## ------------------------ ##
PASS: tar version
PASS: decompressing from stdin
...
## ------------- ##
## Test results. ##
## ------------- ##
200 tests were successful.
44 tests were skipped.
DURATION: 190
END: /usr/lib/tar/ptest
2023-09-22T01:11
STOP: ptest-runner
TOTAL: 1 FAIL: 0
--- .../distro/include/ptest-packagelists.inc | 1 + meta/recipes-core/images/core-image-ptest.bb | 3 + meta/recipes-extended/tar/tar/ptest.patch | 107 ++++++++++++++++++ meta/recipes-extended/tar/tar/run-ptest | 14 +++ meta/recipes-extended/tar/tar_1.35.bb | 28 +++++ 5 files changed, 153 insertions(+) create mode 100644 meta/recipes-extended/tar/tar/ptest.patch create mode 100644 meta/recipes-extended/tar/tar/run-ptest
meta/conf/distro/include/ptest-packagelists.inc +1 -0
@@ -109,6 +109,7 @@ PTESTS_SLOW = "\ python3-cryptography \ python3 \ strace \ + tar \ tcl \ util-linux \ valgrind \
meta/recipes-core/images/core-image-ptest.bb +3 -0
@@ -24,6 +24,9 @@ IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-mdadm = "1524288" IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-strace = "1024288" IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-lttng-tools = "1524288" +# tar-ptest in particular needs more space +IMAGE_ROOTFS_EXTRA_SPACE:virtclass-mcextend-tar = "1524288" + # ptests need more memory than standard to avoid the OOM killer QB_MEM = "-m 1024" QB_MEM:virtclass-mcextend-lttng-tools = "-m 4096"
meta/recipes-extended/tar/tar/ptest.patch new file +107 -0
107 lines not on this page · raw message
meta/recipes-extended/tar/tar/run-ptest new file +14 -0
@@ -0,0 +1,14 @@ +#!/bin/sh + +# Define tar test work dir +WORKDIR=/usr/lib/tar/ptest/tests/ + +# Run test +cd ${WORKDIR} +./atconfig ./atlocal ./testsuite + +# clear log +rm -rf testsuite.dir +rm -rf testsuite.log + +./testsuite --am-fmt AUTOTEST_PATH=${PWD} abs_builddir=${PWD} COMPAT=1
meta/recipes-extended/tar/tar_1.35.bb +28 -0
@@ -42,6 +42,34 @@ do_install:append:class-target() { fi } +# add for ptest support +SRC_URI += " \ + file://run-ptest \ + file://ptest.patch \ +" + +inherit ptest + +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
meta/recipes-extended/tar/tar/ptest.patch line 11
Quoted 11 lines · On Fri, 22 Sept 2023 at 08:41, [email protected] <[email protected]> wrote:
meta/recipes-extended/tar/tar/ptest.patch new file +11
-0+tar: add support of --am-fmt + +Add --am-fmt into testsuites. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Qiu Tingting <[email protected]> + +diff -rNu a/tests/testsuite b/tests/testsuite +--- a/tests/testsuite 2023-09-22 13:42:29.696287678 +0800 ++++ b/tests/testsuite 2023-09-22 13:54:54.592276865 +0800
This file a generated from a template, and so patching it after the fact it isn't correct, even if a generated version is included into the upstream tarball.
You need to find a way to regenerate it from the template in sysroot that comes from autoconf, and is already correctly patched. This requires finding out where the generating code is and how to trigger it.
Alex