public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Changqing Li <changqing.li@windriver.com>
To: openembedded-core@lists.openembedded.org,
	Ross Burton <Ross.Burton@arm.com>
Cc: antonin.godard@bootlin.com,
	Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: Re: [OE-core] [PATCH V3] procps: support ptest when TCLIBC is glibc
Date: Tue, 27 Jan 2026 17:06:09 +0800	[thread overview]
Message-ID: <b708b533-22e1-49c4-abd0-bf91af04eb39@windriver.com> (raw)
In-Reply-To: <188E8AC794A362CA.3302988@lists.openembedded.org>

CC  antonin and Richard to remind there is a V3,  because V2 is on 
master-next.

//Changqing

On 1/27/26 16:58, Changqing Li via lists.openembedded.org wrote:
> From: Changqing Li <changqing.li@windriver.com>
>
> * support ptest for procps TCLIBC is glibc. The configure.ac only match
>    LINUX as "linux-gnu", we can patch it to make test can run on musl lib
> system, but the upstream testsuite should only run on gnu libc host,
> some test cases only suitable for glibc, eg: Some of the error messages
> for free command on musl system is not the same as glibc system, which
> will make test failed. In order to avoid some other unexpected failure,
> just support ptest for glibc.
>
> * procps's testsuite use DejaGnu test framework.  The testsuite is
>    expected to run during build time, this implementation create the same
> folder structure as the testsuite expected to make it can work well.
>
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
>   .../distro/include/ptest-packagelists.inc     |  2 +
>   meta/recipes-extended/procps/procps/run-ptest | 24 ++++++++
>   meta/recipes-extended/procps/procps_4.0.5.bb  | 57 ++++++++++++++++++-
>   3 files changed, 81 insertions(+), 2 deletions(-)
>   create mode 100644 meta/recipes-extended/procps/procps/run-ptest
>
> diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
> index fff2947177..2391224527 100644
> --- a/meta/conf/distro/include/ptest-packagelists.inc
> +++ b/meta/conf/distro/include/ptest-packagelists.inc
> @@ -57,6 +57,7 @@ PTESTS_FAST = "\
>       nettle \
>       opkg \
>       popt \
> +    procps \
>       python3-atomicwrites \
>       python3-attrs \
>       python3-bcrypt \
> @@ -97,6 +98,7 @@ PTESTS_FAST:remove:mips64 = "qemu"
>   PTESTS_PROBLEMS:append:mips64 = " qemu"
>   PTESTS_FAST:remove:riscv32 = "qemu"
>   PTESTS_PROBLEMS:append:riscv32 = " qemu"
> +PTESTS_FAST:remove:libc-musl = "procps"
>   
>   PTESTS_SLOW = "\
>       apr \
> diff --git a/meta/recipes-extended/procps/procps/run-ptest b/meta/recipes-extended/procps/procps/run-ptest
> new file mode 100644
> index 0000000000..7e132653b0
> --- /dev/null
> +++ b/meta/recipes-extended/procps/procps/run-ptest
> @@ -0,0 +1,24 @@
> +#!/bin/sh
> +
> +# Run testsuite which use dejagnu
> +cd ./testsuite
> +for tool in @DEJATOOL@; do
> +    runtest -a --tool $tool --outdir ../log
> +done
> +cd -
> +
> +# Run test programs not used by dejagnu but run directly
> +for p in @TESTS@; do
> +    ./src/tests/"$p" > ./log/"$p".log 2>&1
> +    case "$?" in
> +        0)
> +            echo "PASS: $p"
> +            ;;
> +        77)
> +            echo "SKIP: $p"
> +            ;;
> +        *)
> +            echo "FAIL: $p"
> +            ;;
> +    esac
> +done
> diff --git a/meta/recipes-extended/procps/procps_4.0.5.bb b/meta/recipes-extended/procps/procps_4.0.5.bb
> index 0e0e06f0d2..cddb79cf10 100644
> --- a/meta/recipes-extended/procps/procps_4.0.5.bb
> +++ b/meta/recipes-extended/procps/procps_4.0.5.bb
> @@ -10,11 +10,12 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
>   
>   DEPENDS = "ncurses"
>   
> -inherit autotools gettext pkgconfig update-alternatives
> +inherit autotools gettext pkgconfig update-alternatives ${@bb.utils.contains('TCLIBC', 'glibc', 'ptest', '', d)}
>   
>   SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master;tag=v${PV} \
>              file://sysctl.conf \
>              file://top_large_pid_fix.patch \
> +           file://run-ptest \
>              "
>   SRCREV = "f46b2f7929cdfe2913ed0a7f585b09d6adbf994e"
>   
> @@ -47,8 +48,58 @@ do_install:append () {
>           fi
>   }
>   
> -CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
> +do_compile_ptest() {
> +    for p in $(makefile-getvar ${B}/Makefile check_PROGRAMS); do
> +        oe_runmake $p
> +    done
> +    oe_runmake -C testsuite site.exp
> +}
>   
> +do_install_ptest() {
> +     install -d ${D}${PTEST_PATH}/testsuite
> +     install -d ${D}${PTEST_PATH}/src/tests
> +     install -d ${D}${PTEST_PATH}/log
> +
> +     install -m644 ${B}/testsuite/site.exp ${D}${PTEST_PATH}/testsuite/
> +     for p in $(makefile-getvar ${B}/testsuite/Makefile noinst_PROGRAMS); do
> +         install -m755 ${B}/testsuite/$p ${D}${PTEST_PATH}/testsuite/
> +     done
> +     cp -r ${S}/testsuite/* ${D}${PTEST_PATH}/testsuite/
> +
> +     for p in $(makefile-getvar ${B}/Makefile check_PROGRAMS);do
> +         case "$p" in
> +             src/tests/*)
> +                 install -m 0755 ${B}/$p ${D}${PTEST_PATH}/src/tests/ ;;
> +             library/tests/*)
> +                 install -m 0755 ${B}/library/tests/.libs/$(basename $p)  ${D}${PTEST_PATH}/src/tests/ ;;
> +         esac
> +     done
> +
> +     tests=""
> +     for p in $(makefile-getvar ${B}/Makefile TESTS); do
> +         tests="$tests $(basename $p)"
> +     done
> +     sed -i -e "s#@TESTS@#$tests#" ${D}${PTEST_PATH}/run-ptest
> +
> +     sed -i -e "/set srcdir/c\set srcdir ${PTEST_PATH}/testsuite" \
> +            -e "/set objdir/c\set objdir ${PTEST_PATH}/testsuite" ${D}${PTEST_PATH}/testsuite/site.exp
> +
> +     sed -i -e "s#@DEJATOOL@#$(makefile-getvar ${B}/testsuite/Makefile DEJATOOL)#" ${D}${PTEST_PATH}/run-ptest
> +     for p in $(makefile-getvar ${B}/testsuite/Makefile DEJATOOL); do
> +        if [ "$p" = "ps" ]; then
> +            install -d ${D}${PTEST_PATH}/src/ps
> +            ln -sf ${base_bindir}/ps ${D}${PTEST_PATH}/src/ps/pscommand
> +        elif [ "$p" = "sysctl" ]; then
> +            ln -sf ${base_sbindir}/$p ${D}${PTEST_PATH}/src/$p
> +        elif [ "$p" = "kill" ] || [ "$p" = "pidof" ] || [ "$p" = "watch" ]; then
> +            ln -sf ${base_bindir}/$p ${D}${PTEST_PATH}/src/$p
> +        else
> +            ln -sf ${bindir}/$p ${D}${PTEST_PATH}/src/$p
> +        fi
> +     done
> +}
> +
> +CONFFILES:${PN} = "${sysconfdir}/sysctl.conf"
>   bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w"
>   base_bindir_progs += "kill pidof ps watch"
>   base_sbindir_progs += "sysctl"
> @@ -80,6 +131,8 @@ RDEPENDS:${PN} += "${PROCPS_PACKAGES}"
>   RDEPENDS:${PN}-ps += "${PN}-lib"
>   RDEPENDS:${PN}-sysctl += "${PN}-lib"
>   
> +RDEPENDS:${PN}-ptest += "dejagnu glibc-utils"
> +
>   FILES:${PN}-lib = "${libdir}"
>   FILES:${PN}-ps = "${base_bindir}/ps.${BPN}"
>   FILES:${PN}-sysctl = "${base_sbindir}/sysctl.${BPN} ${sysconfdir}/sysctl.conf ${sysconfdir}/sysctl.d"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#230032): https://lists.openembedded.org/g/openembedded-core/message/230032
> Mute This Topic: https://lists.openembedded.org/mt/117485471/3616873
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [changqing.li@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


      parent reply	other threads:[~2026-01-27  9:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16  9:27 [PATCH V2] procps: support ptest when TCLIBC is glibc changqing.li
2026-01-26 13:01 ` [OE-core] " Ross Burton
2026-01-27  8:57   ` Changqing Li
2026-01-27  8:58   ` [PATCH V3] " changqing.li
2026-01-28 11:32     ` [OE-core] " Richard Purdie
2026-01-29  7:39       ` Changqing Li
2026-01-29  7:48       ` [PATCH V4] " changqing.li
     [not found]       ` <188F2427284C7A56.4057262@lists.openembedded.org>
2026-02-09  1:58         ` [OE-core] " Changqing Li
     [not found]   ` <188E8AC794A362CA.3302988@lists.openembedded.org>
2026-01-27  9:06     ` Changqing Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b708b533-22e1-49c4-abd0-bf91af04eb39@windriver.com \
    --to=changqing.li@windriver.com \
    --cc=Ross.Burton@arm.com \
    --cc=antonin.godard@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox