tar: add ptest support
PATCH v3 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.
- It needs more fs space for test than normal.
- Below is parts of the run log:
START: ptest-runner
2023-09-14T08:02
BEGIN: /usr/lib/tar/ptest
## ------------------------ ##
## GNU tar 1.35 test suite. ##
## ------------------------ ##
1: tar version ok
2: decompressing from stdin ok
...
## ------------- ##
## Test results. ##
## ------------- ##
200 tests were successful.
44 tests were skipped.
DURATION: 188
END: /usr/lib/tar/ptest
2023-09-14T08:05
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/run-ptest | 10 +++++++ meta/recipes-extended/tar/tar_1.35.bb | 27 +++++++++++++++++++ 4 files changed, 41 insertions(+) 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/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
meta/recipes-extended/tar/tar_1.35.bb +27 -0
@@ -42,6 +42,33 @@ do_install:append:class-target() { fi } +# add for ptest support +SRC_URI += " \ + file://run-ptest \ +" + +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
I think there's expectation that the test prints at least one PASS:
marker, otherwise 'bitbake -c testimage core-image-ptest-tar' is going to fail, even if running ptest-runner on the command line does not. Can you please check how this command behaves?
If it does fail, you can modify run-ptest to print FAIL: tar if something failed and PASS: tar if nothing did. './testsuite && echo "PASS: tar" || echo "FAIL" tar" is the simplest.
Alex
Quoted 131 lines · On Fri, 15 Sept 2023 at 04:26, [email protected] <[email protected]> wrote:
From: Qiu Tingting <[email protected]>
Add a ptest for tar.
- It is taking around 3m to execute with kvm, so added it toPTEST_SLOW.
- It contains 244 cases.
- It needs more fs space for test than normal.
- Below is parts of the run log:START: ptest-runner 2023-09-14T08:02 BEGIN: /usr/lib/tar/ptest ## ------------------------ ## ## GNU tar 1.35 test suite. ## ## ------------------------ ## 1: tar version ok 2: decompressing from stdin ok ... ## ------------- ## ## Test results. ## ## ------------- ## 200 tests were successful. 44 tests were skipped. DURATION: 188 END: /usr/lib/tar/ptest 2023-09-14T08:05 STOP: ptest-runner TOTAL: 1 FAIL: 0Signed-off-by Yan Xinkuan <[email protected]>Signed-off-by Qiu Tingting <[email protected]>--- .../distro/include/ptest-packagelists.inc | 1 + meta/recipes-core/images/core-image-ptest.bb | 3 +++ meta/recipes-extended/tar/tar/run-ptest | 10 +++++++ meta/recipes-extended/tar/tar_1.35.bb | 27 +++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 meta/recipes-extended/tar/tar/run-ptestmeta/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/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 + +./testsuitemeta/recipes-extended/tar/tar_1.35.bb +27
-1@@ -42,6 +42,33 @@ do_install:append:class-target() { fi } +# add for ptest support +SRC_URI += " \ + file://run-ptest \ +" + +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*" --2.25.1
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#187651): https://lists.openembedded.org/g/openembedded-core/message/187651
Mute This Topic: https://lists.openembedded.org/mt/101372466/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Hi, Alex
Thanks for your reply.
There are two ways to add markers. Which one is better?
1. add one marker for the hole test of tar (as your suggestion)
2. add markers(PASS, FAIL, SKIP) for every case sample:
PASS: 1: tar version
FAIL: 5: TAR_OPTIONS with string arguments
SKIP: 11: --pax-option compatibility
When try to run 'bitbake -c testimage core-image-ptest-tar' command , my compiling env can not find the testimage task. ( ERROR: Task do_testimage does not exist for target core-image-ptest-tar) Maybe my compiling env has problems, so c ould you show me the correct steps for running the command ?
my steps :
1. download bitbake and install
cd ${WORK_DIR}
git clone https://git.openembedded.org/bitbake bitbake export BITBAKEDIR=${WORK_DIR}/bitbake/
2. download openembedded-core and apply this patch
git clone https://git.openembedded.org/openembedded-core oe-core
cd oe-core
patch -p1 < ${THIS_PATCH}
3. compile image
source ./oe-init-build-env
echo 'DISTRO_FEATURES:append = " ptest"' >> conf/local.conf
bitbake core-image-ptest-tar
4. run command
bitbake -c testimage core-image-ptest-tar
Quoted 8 lines · On Mon, 18 Sept 2023 at 10:28, [email protected] <[email protected]> wrote:
Thanks for your reply.
There are two ways to add markers. Which one is better?
1. add one marker for the hole test of tar (as your suggestion)
2. addmarkers(PASS, FAIL, SKIP)for every case sample:
PASS: 1: tar version
FAIL: 5:TAR_OPTIONSwith string argumentsSKIP: 11: --pax-option compatibility
I looked into why the test suite doesn't print those markers to begin with (GNU items usually do when they use libcheck). It seems that tests/testsuite is pre-generated with a different thing called 'autotest' that doesn't print them. You need to regenerate the file with autotest from from the native sysroot (provided by yocto), which is patched to print the markers:
and then use --am-fmt option with testsuite so they get printed.
Quoted 2 lines
When try to run 'bitbake -c testimage core-image-ptest-tar' command , my compiling env can not find the testimage task. (ERROR: Task
do_testimagedoes not exist for target core-image-ptest-tar) Maybe my compiling env has problems, so could you show me the correct steps for running the command?
local.conf should contain
IMAGE_CLASSES += "testimage"
You might already have it there, just commented out.
Alex
Hi,Alex
Thank you very much!
I will try it.
Best Regards.
Qiu Tingting