diff mbox series

[scarthgap] libmd: add ptest for 'libmd'

Message ID 20250919114332.1505081-1-namanj1@kpit.com
State Accepted
Delegated to: Steve Sakoman
Headers show
Series [scarthgap] libmd: add ptest for 'libmd' | expand

Commit Message

Naman Jain Sept. 19, 2025, 11:43 a.m. UTC
Adapt the compile 'test' phony target from Makefile and deploy as
ptest for libmd.
It takes less than 30seconds for ptest completion

Signed-off-by: Naman Jain <namanj1@kpit.com>
---
 .../distro/include/ptest-packagelists.inc     |  1 +
 meta/recipes-support/libmd/files/run-ptest    | 18 ++++++++++++++++
 meta/recipes-support/libmd/libmd_1.1.0.bb     | 21 +++++++++++++++++--
 3 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/libmd/files/run-ptest

Comments

Steve Sakoman Sept. 22, 2025, 9:40 p.m. UTC | #1
I'm seeing errors in autobuilder testing:

stdio: ERROR: libmd-1.1.0-r0 do_package_qa: QA Issue:
/usr/lib/libmd/ptest/test/sha2 contained in package libmd-ptest
requires /bin/bash, but no providers found in RDEPENDS:libmd-ptest?
[file-rdeps]
stdio: ERROR: libmd-1.1.0-r0 do_package_qa: Fatal QA errors were
found, failing task.
stdio: ERROR: Logfile of failure stored in:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleA/tmp/work/core2-64-poky-linux/libmd/1.1.0/temp/log.do_package_qa.2268695
stdio: ERROR: Task
(/srv/pokybuild/yocto-worker/reproducible/build/meta/recipes-support/libmd/libmd_1.1.0.bb:do_package_qa)
failed with exit code '1'
stdio: ERROR: libmd-1.1.0-r0 do_package_qa: QA Issue:
/usr/lib/libmd/ptest/test/sha2 contained in package libmd-ptest
requires /bin/bash, but no providers found in RDEPENDS:libmd-ptest?
[file-rdeps]
stdio: ERROR: libmd-1.1.0-r0 do_package_qa: Fatal QA errors were
found, failing task.
stdio: ERROR: Logfile of failure stored in:
/srv/pokybuild/yocto-worker/reproducible/build/build-st/reproducibleA/tmp/work/core2-64-poky-linux/libmd/1.1.0/temp/log.do_package_qa.2268695
stdio: ERROR: Task
(/srv/pokybuild/yocto-worker/reproducible/build/meta/recipes-support/libmd/libmd_1.1.0.bb:do_package_qa)
failed with exit code '1'
stdio: ERROR: Command . ./oe-init-build-env; ${SCRIPTSDIR}/checkvnc;
OEQA_DEBUGGING_SAVED_OUTPUT=/srv/autobuilder/valkyrie.yocto.io/pub/repro-fail/
DISPLAY=:1 oe-selftest -r reproducible failed with exit code 1, see
errors above. (1758576888.2: 938.7)

Steve

On Fri, Sep 19, 2025 at 11:58 AM Naman Jain via lists.openembedded.org
<nmjain23=gmail.com@lists.openembedded.org> wrote:
>
> Adapt the compile 'test' phony target from Makefile and deploy as
> ptest for libmd.
> It takes less than 30seconds for ptest completion
>
> Signed-off-by: Naman Jain <namanj1@kpit.com>
> ---
>  .../distro/include/ptest-packagelists.inc     |  1 +
>  meta/recipes-support/libmd/files/run-ptest    | 18 ++++++++++++++++
>  meta/recipes-support/libmd/libmd_1.1.0.bb     | 21 +++++++++++++++++--
>  3 files changed, 38 insertions(+), 2 deletions(-)
>  create mode 100644 meta/recipes-support/libmd/files/run-ptest
>
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> index 9950e46776..784176f579 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -29,6 +29,7 @@ PTESTS_FAST = "\
>      json-glib \
>      libconvert-asn1-perl \
>      libgpg-error\
> +    libmd\
>      libnl \
>      libpcre \
>      libssh2 \
> diff --git a/meta/recipes-support/libmd/files/run-ptest b/meta/recipes-support/libmd/files/run-ptest
> new file mode 100644
> index 0000000000..0c4a5f64ec
> --- /dev/null
> +++ b/meta/recipes-support/libmd/files/run-ptest
> @@ -0,0 +1,18 @@
> +#!/bin/sh
> +
> +cd test
> +status = 0
> +
> +for testbin in *; do
> +    if [ -x "$testbin" ] && [ ! -d "$testbin" ]; then
> +        if "./$testbin"; then
> +            echo "PASS: $testbin"
> +        else
> +            echo "FAIL: $testbin"
> +            status=1
> +        fi
> +    fi
> +done
> +
> +return $status
> +
> diff --git a/meta/recipes-support/libmd/libmd_1.1.0.bb b/meta/recipes-support/libmd/libmd_1.1.0.bb
> index dc588a0f95..68a2ec7a16 100644
> --- a/meta/recipes-support/libmd/libmd_1.1.0.bb
> +++ b/meta/recipes-support/libmd/libmd_1.1.0.bb
> @@ -8,9 +8,26 @@ HOMEPAGE = "https://www.hadrons.org/software/libmd/"
>  LICENSE = "BSD-3-Clause & BSD-2-Clause"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=0436d4fb62a71f661d6e8b7812f9e1df"
>
> -SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz"
> +SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz \
> +          file://run-ptest \
> +"
>  SRC_URI[sha256sum] = "1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332"
>
> -inherit autotools
> +inherit autotools ptest
> +
> +do_compile_ptest() {
> +    sed -i "/\$(MAKE) \$(AM_MAKEFLAGS) check-TESTS/d" test/Makefile
> +    oe_runmake check
> +}
> +
> +
> +do_install_ptest() {
> +    install -d ${D}${PTEST_PATH}/test
> +    for bin in ${B}/test/*; do
> +        if [ -x "$bin" ]; then
> +            libtool --mode=install install "$bin" ${D}${PTEST_PATH}/test/$(basename "$bin")
> +        fi
> +    done
> +}
>
>  BBCLASSEXTEND = "native nativesdk"
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#223770): https://lists.openembedded.org/g/openembedded-core/message/223770
> Mute This Topic: https://lists.openembedded.org/mt/115333712/3620601
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 9950e46776..784176f579 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -29,6 +29,7 @@  PTESTS_FAST = "\
     json-glib \
     libconvert-asn1-perl \
     libgpg-error\
+    libmd\
     libnl \
     libpcre \
     libssh2 \
diff --git a/meta/recipes-support/libmd/files/run-ptest b/meta/recipes-support/libmd/files/run-ptest
new file mode 100644
index 0000000000..0c4a5f64ec
--- /dev/null
+++ b/meta/recipes-support/libmd/files/run-ptest
@@ -0,0 +1,18 @@ 
+#!/bin/sh
+
+cd test
+status = 0
+
+for testbin in *; do
+    if [ -x "$testbin" ] && [ ! -d "$testbin" ]; then
+        if "./$testbin"; then
+            echo "PASS: $testbin"
+        else
+            echo "FAIL: $testbin"
+            status=1
+        fi
+    fi
+done
+
+return $status
+
diff --git a/meta/recipes-support/libmd/libmd_1.1.0.bb b/meta/recipes-support/libmd/libmd_1.1.0.bb
index dc588a0f95..68a2ec7a16 100644
--- a/meta/recipes-support/libmd/libmd_1.1.0.bb
+++ b/meta/recipes-support/libmd/libmd_1.1.0.bb
@@ -8,9 +8,26 @@  HOMEPAGE = "https://www.hadrons.org/software/libmd/"
 LICENSE = "BSD-3-Clause & BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0436d4fb62a71f661d6e8b7812f9e1df"
 
-SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz"
+SRC_URI = "https://archive.hadrons.org/software/libmd/libmd-${PV}.tar.xz \
+	   file://run-ptest \
+"
 SRC_URI[sha256sum] = "1bd6aa42275313af3141c7cf2e5b964e8b1fd488025caf2f971f43b00776b332"
 
-inherit autotools
+inherit autotools ptest
+
+do_compile_ptest() {
+    sed -i "/\$(MAKE) \$(AM_MAKEFLAGS) check-TESTS/d" test/Makefile
+    oe_runmake check
+}
+
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/test
+    for bin in ${B}/test/*; do
+        if [ -x "$bin" ]; then
+            libtool --mode=install install "$bin" ${D}${PTEST_PATH}/test/$(basename "$bin")
+        fi
+    done
+}
 
 BBCLASSEXTEND = "native nativesdk"