All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH V1] tar: add ptest
@ 2022-11-02  1:18 yanxk.fnst
  2023-02-03 11:10 ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 3+ messages in thread
From: yanxk.fnst @ 2022-11-02  1:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: fnstml-fujitsuten, Yan

From: Yan <yanxk.fnst@fujitsu.com>

enable ptest for oss "tar".

Signed-off-by: Yanxinkuan <yanxk.fnst@fujitsu.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 meta/recipes-extended/tar/files/run-ptest     | 10 +++++++
 meta/recipes-extended/tar/tar_1.34.bb         | 27 +++++++++++++++++--
 3 files changed, 36 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-extended/tar/files/run-ptest

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 72162f10ee..d3e18ea4a4 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -100,6 +100,7 @@ PTESTS_SLOW = "\
     python3-cryptography-ptest \
     python3-ptest \
     strace-ptest \
+    tar-ptest \
     tcl-ptest \
     util-linux-ptest \
     valgrind-ptest \
diff --git a/meta/recipes-extended/tar/files/run-ptest b/meta/recipes-extended/tar/files/run-ptest
new file mode 100644
index 0000000000..9ca27153d9
--- /dev/null
+++ b/meta/recipes-extended/tar/files/run-ptest
@@ -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'
diff --git a/meta/recipes-extended/tar/tar_1.34.bb b/meta/recipes-extended/tar/tar_1.34.bb
index 7307cd57a2..7a178c345f 100644
--- a/meta/recipes-extended/tar/tar_1.34.bb
+++ b/meta/recipes-extended/tar/tar_1.34.bb
@@ -6,11 +6,12 @@ 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 +43,28 @@ 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/
+    install --mode=755 ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
+    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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [meta-oe][PATCH V1] tar: add ptest
  2022-11-02  1:18 [meta-oe][PATCH V1] tar: add ptest yanxk.fnst
@ 2023-02-03 11:10 ` Alexander Kanavin
  2023-02-06  2:57   ` 回复: " yanxk.fnst
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kanavin @ 2023-02-03 11:10 UTC (permalink / raw)
  To: Yan Xin Kuan; +Cc: openembedded-core, fnstml-fujitsuten

On Fri, 3 Feb 2023 at 04:08, Yan Xin Kuan <yanxk.fnst@fujitsu.com> wrote:
> @@ -100,6 +100,7 @@ PTESTS_SLOW = "\
>      python3-cryptography-ptest \
>      python3-ptest \
>      strace-ptest \
> +    tar-ptest \
>      tcl-ptest \
>      util-linux-ptest \
>      valgrind-ptest \

PTESTS_SLOW is for tests longer than 30 seconds. How long does the tar
test take in your local testing? Is kvm in use?

Alex


^ permalink raw reply	[flat|nested] 3+ messages in thread

* 回复: [OE-core] [meta-oe][PATCH V1] tar: add ptest
  2023-02-03 11:10 ` [OE-core] " Alexander Kanavin
@ 2023-02-06  2:57   ` yanxk.fnst
  0 siblings, 0 replies; 3+ messages in thread
From: yanxk.fnst @ 2023-02-06  2:57 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core, fnstml-fujitsuten

Hi,
We place it in slow list for tar test takes at least 5 minutes.
KVM is enabled, our PC uses Core i5 4th.
Best,
Yan

-----邮件原件-----
发件人: Alexander Kanavin <alex.kanavin@gmail.com> 
发送时间: 2023年2月3日 19:11
收件人: Yan, Xinkuan/晏 新宽 <yanxk.fnst@fujitsu.com>
抄送: openembedded-core@lists.openembedded.org; FNST fnstml-fujitsuten <fnstml-fujitsuten@fujitsu.com>
主题: Re: [OE-core] [meta-oe][PATCH V1] tar: add ptest

On Fri, 3 Feb 2023 at 04:08, Yan Xin Kuan <yanxk.fnst@fujitsu.com> wrote:
> @@ -100,6 +100,7 @@ PTESTS_SLOW = "\
>      python3-cryptography-ptest \
>      python3-ptest \
>      strace-ptest \
> +    tar-ptest \
>      tcl-ptest \
>      util-linux-ptest \
>      valgrind-ptest \

PTESTS_SLOW is for tests longer than 30 seconds. How long does the tar test take in your local testing? Is kvm in use?

Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-06  2:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02  1:18 [meta-oe][PATCH V1] tar: add ptest yanxk.fnst
2023-02-03 11:10 ` [OE-core] " Alexander Kanavin
2023-02-06  2:57   ` 回复: " yanxk.fnst

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.