All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 v3] Add ptest support for coreutils
@ 2020-02-26 18:07 Trevor Gamblin
  2020-02-26 18:07 ` [PATCH 1/2 v3] coreutils: add ptest Trevor Gamblin
  2020-02-26 18:07 ` [PATCH 2/2 v3] ptest-packagelists.inc: add coreutils to SLOW list Trevor Gamblin
  0 siblings, 2 replies; 9+ messages in thread
From: Trevor Gamblin @ 2020-02-26 18:07 UTC (permalink / raw)
  To: openembedded-core

Sample test results:

core-image-minimal:
MACHINE    | PASS | FAIL | SKIP | TOTAL | TIME (m) |
qemux86-64 |  472 |    0 |  143 |   615 |      2.5 |
qemuarm64  |  472 |    0 |  143 |   615 |       51 |

core-image-sato:
MACHINE    | PASS | FAIL | SKIP | TOTAL | Time (m) |
qemux86-64 |  472 |    0 |  143 |   615 |      2.4 |
qemuarm64  |  472 |    0 |  143 |   615 |       52 |


Trevor Gamblin (2):
  coreutils: add ptest
  ptest-packagelists.inc: add coreutils to SLOW list

 .../distro/include/ptest-packagelists.inc     |  1 +
 .../coreutils/coreutils/run-ptest             | 17 +++++++++
 meta/recipes-core/coreutils/coreutils_8.31.bb | 37 +++++++++++++++++++
 3 files changed, 55 insertions(+)
 create mode 100755 meta/recipes-core/coreutils/coreutils/run-ptest

-- 
2.24.1



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

* [PATCH 1/2 v3] coreutils: add ptest
  2020-02-26 18:07 [PATCH 0/2 v3] Add ptest support for coreutils Trevor Gamblin
@ 2020-02-26 18:07 ` Trevor Gamblin
  2020-02-26 18:13   ` Alexander Kanavin
  2020-02-28  3:59   ` Anuj Mittal
  2020-02-26 18:07 ` [PATCH 2/2 v3] ptest-packagelists.inc: add coreutils to SLOW list Trevor Gamblin
  1 sibling, 2 replies; 9+ messages in thread
From: Trevor Gamblin @ 2020-02-26 18:07 UTC (permalink / raw)
  To: openembedded-core

coreutils has a large number of tests, including some added by the
Makefile flags RUN_EXPENSIVE_TESTS and RUN_VERY_EXPENSIVE_TESTS that
significantly increase runtime (and which have been disabled). Note
that the coreutils ptest directory is given blanket permissions at
runtime with chmod -R 777, to ensure that the user created for the
tests will be able to run the test scripts and create the necessary
files in the process without being impeded by permissions issues.

There is still room to improve the results of this ptest without
the aforementioned additions. Of the tests marked SKIP, there are
30 tests that are currently counted as SKIP because they require
sudo permissions, and another 21 that require membership in
multiple user groups. It is important to know that coreutils has
tests for both root and non-root users. Testing showed that 42
tests are skipped when running as root versus 30 when running as a
non-root user, so the decision was made to run the suite as the
latter. Additionally, gdb, valgrind, and strace could be included
in the RDEPENDS list to increase pass rate, but their total
contribution is 13 tests, so they were omitted to reduce image size.

Finally, note that at least one ptest (misc/head-write-error.sh) is
prone to ERROR on builds of core-image-minimal if extra space is
not provided with IMAGE_ROOTFS_EXTRA_SPACE.

Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
---
 .../coreutils/coreutils/run-ptest             | 17 +++++++++
 meta/recipes-core/coreutils/coreutils_8.31.bb | 37 +++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100755 meta/recipes-core/coreutils/coreutils/run-ptest

diff --git a/meta/recipes-core/coreutils/coreutils/run-ptest b/meta/recipes-core/coreutils/coreutils/run-ptest
new file mode 100755
index 0000000000..6d4a7b365d
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils/run-ptest
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# remove any stale lock files so that the calls to groupadd/useradd don't stop
+# the ptest if re-using the same image
+rm -rf /etc/passwd.lock /etc/group.lock /etc/gshadow.lock
+
+COREUTILSLIB=@libdir@/coreutils
+LOG="${COREUTILSLIB}/ptest/coreutils_ptest_$(date +%Y%m%d-%H%M%S).log"
+USERNAME="tester"
+groupadd ugroup1
+groupadd ugroup2
+useradd -G ugroup1,ugroup2 $USERNAME || echo "user $USERNAME already exists"
+
+su tester -c "cd ${COREUTILSLIB}/ptest && make check-TESTS top_srcdir=. srcdir=." 2>&1 | tee -a ${LOG}
+userdel $USERNAME 
+groupdel ugroup1
+groupdel ugroup2
diff --git a/meta/recipes-core/coreutils/coreutils_8.31.bb b/meta/recipes-core/coreutils/coreutils_8.31.bb
index 57b2c1bdba..8bec4e0f3c 100644
--- a/meta/recipes-core/coreutils/coreutils_8.31.bb
+++ b/meta/recipes-core/coreutils/coreutils_8.31.bb
@@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
            file://0001-uname-report-processor-and-hardware-correctly.patch \
            file://disable-ls-output-quoting.patch \
            file://0001-local.mk-fix-cross-compiling-problem.patch \
+           file://run-ptest \
           "
 
 SRC_URI_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch"
@@ -143,3 +144,39 @@ python __anonymous() {
 }
 
 BBCLASSEXTEND = "native nativesdk"
+
+inherit ptest
+
+RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl libmodule-build-perl make perl perl-module-file-stat python3-core sed shadow"
+
+do_install_ptest () {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests
+    sed -i 's/ginstall/install/g'  `grep -R ginstall ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq`
+    install -d ${D}${PTEST_PATH}/build-aux
+    install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
+    cp ${B}/Makefile ${D}${PTEST_PATH}/
+    cp ${S}/init.cfg ${D}${PTEST_PATH}/
+    cp -r ${B}/src ${D}${PTEST_PATH}/
+    cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src
+    sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile
+    sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile
+    sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile
+    sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
+    sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
+    sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
+    sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile
+    chmod -R 777 ${D}${PTEST_PATH}
+
+    # Disable subcase stty-pairs.sh, it will cause test framework hang
+    sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile
+
+    # Tweak test d_type-check to use python3 instead of python
+    sed -i "1s@.*@#!/usr/bin/python3@" ${WORKDIR}/image/usr/lib/coreutils/ptest/tests/d_type-check
+    install ${B}/src/getlimits ${D}/${bindir}
+    
+    # handle multilib
+    sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
+}
+
+FILES_${PN}-ptest += "${bindir}/getlimits"
-- 
2.24.1



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

* [PATCH 2/2 v3] ptest-packagelists.inc: add coreutils to SLOW list
  2020-02-26 18:07 [PATCH 0/2 v3] Add ptest support for coreutils Trevor Gamblin
  2020-02-26 18:07 ` [PATCH 1/2 v3] coreutils: add ptest Trevor Gamblin
@ 2020-02-26 18:07 ` Trevor Gamblin
  1 sibling, 0 replies; 9+ messages in thread
From: Trevor Gamblin @ 2020-02-26 18:07 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
---
 meta/conf/distro/include/ptest-packagelists.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index 4afac58e3a..54ace39d53 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -65,6 +65,7 @@ PTESTS_FAST = "\
 PTESTS_SLOW = "\
     babeltrace-ptest \
     busybox-ptest \
+    coreutils-ptest \
     dbus-test-ptest \
     e2fsprogs-ptest \
     glib-2.0-ptest \
-- 
2.24.1



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

* Re: [PATCH 1/2 v3] coreutils: add ptest
  2020-02-26 18:07 ` [PATCH 1/2 v3] coreutils: add ptest Trevor Gamblin
@ 2020-02-26 18:13   ` Alexander Kanavin
  2020-02-27 23:26     ` Richard Purdie
  2020-02-28  3:59   ` Anuj Mittal
  1 sibling, 1 reply; 9+ messages in thread
From: Alexander Kanavin @ 2020-02-26 18:13 UTC (permalink / raw)
  To: Trevor Gamblin; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 5746 bytes --]

valgrind, gdb and strace are already pulled into core-image-sato-sdk-ptest
(the one that runs the slow ptests on the AB), so there is no harm in
adding them here as well.

Alex

On Wed, 26 Feb 2020 at 19:08, Trevor Gamblin <trevor.gamblin@windriver.com>
wrote:

> coreutils has a large number of tests, including some added by the
> Makefile flags RUN_EXPENSIVE_TESTS and RUN_VERY_EXPENSIVE_TESTS that
> significantly increase runtime (and which have been disabled). Note
> that the coreutils ptest directory is given blanket permissions at
> runtime with chmod -R 777, to ensure that the user created for the
> tests will be able to run the test scripts and create the necessary
> files in the process without being impeded by permissions issues.
>
> There is still room to improve the results of this ptest without
> the aforementioned additions. Of the tests marked SKIP, there are
> 30 tests that are currently counted as SKIP because they require
> sudo permissions, and another 21 that require membership in
> multiple user groups. It is important to know that coreutils has
> tests for both root and non-root users. Testing showed that 42
> tests are skipped when running as root versus 30 when running as a
> non-root user, so the decision was made to run the suite as the
> latter. Additionally, gdb, valgrind, and strace could be included
> in the RDEPENDS list to increase pass rate, but their total
> contribution is 13 tests, so they were omitted to reduce image size.
>
> Finally, note that at least one ptest (misc/head-write-error.sh) is
> prone to ERROR on builds of core-image-minimal if extra space is
> not provided with IMAGE_ROOTFS_EXTRA_SPACE.
>
> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
> ---
>  .../coreutils/coreutils/run-ptest             | 17 +++++++++
>  meta/recipes-core/coreutils/coreutils_8.31.bb | 37 +++++++++++++++++++
>  2 files changed, 54 insertions(+)
>  create mode 100755 meta/recipes-core/coreutils/coreutils/run-ptest
>
> diff --git a/meta/recipes-core/coreutils/coreutils/run-ptest
> b/meta/recipes-core/coreutils/coreutils/run-ptest
> new file mode 100755
> index 0000000000..6d4a7b365d
> --- /dev/null
> +++ b/meta/recipes-core/coreutils/coreutils/run-ptest
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +
> +# remove any stale lock files so that the calls to groupadd/useradd don't
> stop
> +# the ptest if re-using the same image
> +rm -rf /etc/passwd.lock /etc/group.lock /etc/gshadow.lock
> +
> +COREUTILSLIB=@libdir@/coreutils
> +LOG="${COREUTILSLIB}/ptest/coreutils_ptest_$(date +%Y%m%d-%H%M%S).log"
> +USERNAME="tester"
> +groupadd ugroup1
> +groupadd ugroup2
> +useradd -G ugroup1,ugroup2 $USERNAME || echo "user $USERNAME already
> exists"
> +
> +su tester -c "cd ${COREUTILSLIB}/ptest && make check-TESTS top_srcdir=.
> srcdir=." 2>&1 | tee -a ${LOG}
> +userdel $USERNAME
> +groupdel ugroup1
> +groupdel ugroup2
> diff --git a/meta/recipes-core/coreutils/coreutils_8.31.bb
> b/meta/recipes-core/coreutils/coreutils_8.31.bb
> index 57b2c1bdba..8bec4e0f3c 100644
> --- a/meta/recipes-core/coreutils/coreutils_8.31.bb
> +++ b/meta/recipes-core/coreutils/coreutils_8.31.bb
> @@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
>
> file://0001-uname-report-processor-and-hardware-correctly.patch \
>             file://disable-ls-output-quoting.patch \
>             file://0001-local.mk-fix-cross-compiling-problem.patch \
> +           file://run-ptest \
>            "
>
>  SRC_URI_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch"
> @@ -143,3 +144,39 @@ python __anonymous() {
>  }
>
>  BBCLASSEXTEND = "native nativesdk"
> +
> +inherit ptest
> +
> +RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl
> libmodule-build-perl make perl perl-module-file-stat python3-core sed
> shadow"
> +
> +do_install_ptest () {
> +    install -d ${D}${PTEST_PATH}/tests
> +    cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests
> +    sed -i 's/ginstall/install/g'  `grep -R ginstall
> ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq`
> +    install -d ${D}${PTEST_PATH}/build-aux
> +    install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
> +    cp ${B}/Makefile ${D}${PTEST_PATH}/
> +    cp ${S}/init.cfg ${D}${PTEST_PATH}/
> +    cp -r ${B}/src ${D}${PTEST_PATH}/
> +    cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src
> +    sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g'
> ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g'
> ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^built_programs/s/ginstall/install/g'
> ${D}${PTEST_PATH}/Makefile
> +    chmod -R 777 ${D}${PTEST_PATH}
> +
> +    # Disable subcase stty-pairs.sh, it will cause test framework hang
> +    sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile
> +
> +    # Tweak test d_type-check to use python3 instead of python
> +    sed -i "1s@.*@#!/usr/bin/python3@"
> ${WORKDIR}/image/usr/lib/coreutils/ptest/tests/d_type-check
> +    install ${B}/src/getlimits ${D}/${bindir}
> +
> +    # handle multilib
> +    sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
> +}
> +
> +FILES_${PN}-ptest += "${bindir}/getlimits"
> --
> 2.24.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 7255 bytes --]

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

* Re: [PATCH 1/2 v3] coreutils: add ptest
  2020-02-26 18:13   ` Alexander Kanavin
@ 2020-02-27 23:26     ` Richard Purdie
  2020-02-27 23:51       ` Trevor Gamblin
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2020-02-27 23:26 UTC (permalink / raw)
  To: Alexander Kanavin, Trevor Gamblin; +Cc: OE-core

On Wed, 2020-02-26 at 19:13 +0100, Alexander Kanavin wrote:
> valgrind, gdb and strace are already pulled into core-image-sato-sdk-
> ptest (the one that runs the slow ptests on the AB), so there is no
> harm in adding them here as well.

Actually, there is.

Adding valgrind to the RDEPENDS of coreutils means all builds end up
needing to include valgrind. We really don't want that.

I know this is bad but it is the way dependencies work today :(

Cheers,

Richard





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

* Re: [PATCH 1/2 v3] coreutils: add ptest
  2020-02-27 23:26     ` Richard Purdie
@ 2020-02-27 23:51       ` Trevor Gamblin
  2020-02-28  7:51         ` Richard Purdie
  0 siblings, 1 reply; 9+ messages in thread
From: Trevor Gamblin @ 2020-02-27 23:51 UTC (permalink / raw)
  To: Richard Purdie, Alexander Kanavin; +Cc: OE-core


On 2/27/20 6:26 PM, Richard Purdie wrote:
> On Wed, 2020-02-26 at 19:13 +0100, Alexander Kanavin wrote:
>> valgrind, gdb and strace are already pulled into core-image-sato-sdk-
>> ptest (the one that runs the slow ptests on the AB), so there is no
>> harm in adding them here as well.
> Actually, there is.
>
> Adding valgrind to the RDEPENDS of coreutils means all builds end up
> needing to include valgrind. We really don't want that.
>
> I know this is bad but it is the way dependencies work today :(
Should I resubmit with gdb and strace?
>
> Cheers,
>
> Richard
>
>
>


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

* Re: [PATCH 1/2 v3] coreutils: add ptest
  2020-02-26 18:07 ` [PATCH 1/2 v3] coreutils: add ptest Trevor Gamblin
  2020-02-26 18:13   ` Alexander Kanavin
@ 2020-02-28  3:59   ` Anuj Mittal
  2020-02-28 13:36     ` Trevor Gamblin
  1 sibling, 1 reply; 9+ messages in thread
From: Anuj Mittal @ 2020-02-28  3:59 UTC (permalink / raw)
  To: Trevor Gamblin, openembedded-core



On 27-Feb-20 02:07 AM, Trevor Gamblin wrote:
> coreutils has a large number of tests, including some added by the
> Makefile flags RUN_EXPENSIVE_TESTS and RUN_VERY_EXPENSIVE_TESTS that
> significantly increase runtime (and which have been disabled). Note
> that the coreutils ptest directory is given blanket permissions at
> runtime with chmod -R 777, to ensure that the user created for the
> tests will be able to run the test scripts and create the necessary
> files in the process without being impeded by permissions issues.
> 
> There is still room to improve the results of this ptest without
> the aforementioned additions. Of the tests marked SKIP, there are
> 30 tests that are currently counted as SKIP because they require
> sudo permissions, and another 21 that require membership in
> multiple user groups. It is important to know that coreutils has
> tests for both root and non-root users. Testing showed that 42
> tests are skipped when running as root versus 30 when running as a
> non-root user, so the decision was made to run the suite as the
> latter. Additionally, gdb, valgrind, and strace could be included
> in the RDEPENDS list to increase pass rate, but their total
> contribution is 13 tests, so they were omitted to reduce image size.
> 
> Finally, note that at least one ptest (misc/head-write-error.sh) is
> prone to ERROR on builds of core-image-minimal if extra space is
> not provided with IMAGE_ROOTFS_EXTRA_SPACE.
> 
> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
> ---
>   .../coreutils/coreutils/run-ptest             | 17 +++++++++
>   meta/recipes-core/coreutils/coreutils_8.31.bb | 37 +++++++++++++++++++
>   2 files changed, 54 insertions(+)
>   create mode 100755 meta/recipes-core/coreutils/coreutils/run-ptest
> 
> diff --git a/meta/recipes-core/coreutils/coreutils/run-ptest b/meta/recipes-core/coreutils/coreutils/run-ptest
> new file mode 100755
> index 0000000000..6d4a7b365d
> --- /dev/null
> +++ b/meta/recipes-core/coreutils/coreutils/run-ptest
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +
> +# remove any stale lock files so that the calls to groupadd/useradd don't stop
> +# the ptest if re-using the same image
> +rm -rf /etc/passwd.lock /etc/group.lock /etc/gshadow.lock
> +
> +COREUTILSLIB=@libdir@/coreutils
> +LOG="${COREUTILSLIB}/ptest/coreutils_ptest_$(date +%Y%m%d-%H%M%S).log"
> +USERNAME="tester"
> +groupadd ugroup1
> +groupadd ugroup2
> +useradd -G ugroup1,ugroup2 $USERNAME || echo "user $USERNAME already exists"
> +
> +su tester -c "cd ${COREUTILSLIB}/ptest && make check-TESTS top_srcdir=. srcdir=." 2>&1 | tee -a ${LOG}
> +userdel $USERNAME
> +groupdel ugroup1
> +groupdel ugroup2
> diff --git a/meta/recipes-core/coreutils/coreutils_8.31.bb b/meta/recipes-core/coreutils/coreutils_8.31.bb
> index 57b2c1bdba..8bec4e0f3c 100644
> --- a/meta/recipes-core/coreutils/coreutils_8.31.bb
> +++ b/meta/recipes-core/coreutils/coreutils_8.31.bb
> @@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
>              file://0001-uname-report-processor-and-hardware-correctly.patch \
>              file://disable-ls-output-quoting.patch \
>              file://0001-local.mk-fix-cross-compiling-problem.patch \
> +           file://run-ptest \
>             "
>   
>   SRC_URI_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch"
> @@ -143,3 +144,39 @@ python __anonymous() {
>   }
>   
>   BBCLASSEXTEND = "native nativesdk"
> +
> +inherit ptest
> +
> +RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl libmodule-build-perl make perl perl-module-file-stat python3-core sed shadow"
> +
> +do_install_ptest () {
> +    install -d ${D}${PTEST_PATH}/tests
> +    cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests
> +    sed -i 's/ginstall/install/g'  `grep -R ginstall ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq`
> +    install -d ${D}${PTEST_PATH}/build-aux
> +    install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
> +    cp ${B}/Makefile ${D}${PTEST_PATH}/
> +    cp ${S}/init.cfg ${D}${PTEST_PATH}/
> +    cp -r ${B}/src ${D}${PTEST_PATH}/
> +    cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src
> +    sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' ${D}${PTEST_PATH}/Makefile
> +    sed -i '/^built_programs/s/ginstall/install/g' ${D}${PTEST_PATH}/Makefile
> +    chmod -R 777 ${D}${PTEST_PATH}
> +
> +    # Disable subcase stty-pairs.sh, it will cause test framework hang
> +    sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile
> +
> +    # Tweak test d_type-check to use python3 instead of python
> +    sed -i "1s@.*@#!/usr/bin/python3@" ${WORKDIR}/image/usr/lib/coreutils/ptest/tests/d_type-check

This is assuming /usr/lib and failing with multilib:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/1642/steps/8/logs/step3b

ERROR: Logfile of failure stored in: 
/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/log.do_install_ptest_base.4366
Log data follows:
| DEBUG: Executing shell function do_install_ptest_base
| sed: can't read 
/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check: 
No such file or directory
| WARNING: 
/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/run.do_install_ptest_base.4366:1 
exit 2 from 'sed -i "1s@.*@#!/usr/bin/python3@" 
/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check'
| ERROR: Execution of 
'/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/run.do_install_ptest_base.4366' 
failed with exit code 2:
| sed: can't read 
/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check: 
No such file or directory
| WARNING: 
/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/run.do_install_ptest_base.4366:1 
exit 2 from 'sed -i "1s@.*@#!/usr/bin/python3@" 
/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check'
|

Thanks,

Anuj


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

* Re: [PATCH 1/2 v3] coreutils: add ptest
  2020-02-27 23:51       ` Trevor Gamblin
@ 2020-02-28  7:51         ` Richard Purdie
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Purdie @ 2020-02-28  7:51 UTC (permalink / raw)
  To: Trevor Gamblin, Alexander Kanavin; +Cc: OE-core

On Thu, 2020-02-27 at 18:51 -0500, Trevor Gamblin wrote:
> On 2/27/20 6:26 PM, Richard Purdie wrote:
> > On Wed, 2020-02-26 at 19:13 +0100, Alexander Kanavin wrote:
> > > valgrind, gdb and strace are already pulled into core-image-sato-
> > > sdk-
> > > ptest (the one that runs the slow ptests on the AB), so there is
> > > no
> > > harm in adding them here as well.
> > Actually, there is.
> > 
> > Adding valgrind to the RDEPENDS of coreutils means all builds end
> > up
> > needing to include valgrind. We really don't want that.
> > 
> > I know this is bad but it is the way dependencies work today :(
> Should I resubmit with gdb and strace?

My personal opinion is no, these all end up enlarging the dependency
chains too much :(

Cheers,

Richard



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

* Re: [PATCH 1/2 v3] coreutils: add ptest
  2020-02-28  3:59   ` Anuj Mittal
@ 2020-02-28 13:36     ` Trevor Gamblin
  0 siblings, 0 replies; 9+ messages in thread
From: Trevor Gamblin @ 2020-02-28 13:36 UTC (permalink / raw)
  To: Anuj Mittal, openembedded-core


On 2/27/20 10:59 PM, Anuj Mittal wrote:
>
>
> On 27-Feb-20 02:07 AM, Trevor Gamblin wrote:
>> coreutils has a large number of tests, including some added by the
>> Makefile flags RUN_EXPENSIVE_TESTS and RUN_VERY_EXPENSIVE_TESTS that
>> significantly increase runtime (and which have been disabled). Note
>> that the coreutils ptest directory is given blanket permissions at
>> runtime with chmod -R 777, to ensure that the user created for the
>> tests will be able to run the test scripts and create the necessary
>> files in the process without being impeded by permissions issues.
>>
>> There is still room to improve the results of this ptest without
>> the aforementioned additions. Of the tests marked SKIP, there are
>> 30 tests that are currently counted as SKIP because they require
>> sudo permissions, and another 21 that require membership in
>> multiple user groups. It is important to know that coreutils has
>> tests for both root and non-root users. Testing showed that 42
>> tests are skipped when running as root versus 30 when running as a
>> non-root user, so the decision was made to run the suite as the
>> latter. Additionally, gdb, valgrind, and strace could be included
>> in the RDEPENDS list to increase pass rate, but their total
>> contribution is 13 tests, so they were omitted to reduce image size.
>>
>> Finally, note that at least one ptest (misc/head-write-error.sh) is
>> prone to ERROR on builds of core-image-minimal if extra space is
>> not provided with IMAGE_ROOTFS_EXTRA_SPACE.
>>
>> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
>> ---
>>   .../coreutils/coreutils/run-ptest             | 17 +++++++++
>>   meta/recipes-core/coreutils/coreutils_8.31.bb | 37 +++++++++++++++++++
>>   2 files changed, 54 insertions(+)
>>   create mode 100755 meta/recipes-core/coreutils/coreutils/run-ptest
>>
>> diff --git a/meta/recipes-core/coreutils/coreutils/run-ptest 
>> b/meta/recipes-core/coreutils/coreutils/run-ptest
>> new file mode 100755
>> index 0000000000..6d4a7b365d
>> --- /dev/null
>> +++ b/meta/recipes-core/coreutils/coreutils/run-ptest
>> @@ -0,0 +1,17 @@
>> +#!/bin/sh
>> +
>> +# remove any stale lock files so that the calls to groupadd/useradd 
>> don't stop
>> +# the ptest if re-using the same image
>> +rm -rf /etc/passwd.lock /etc/group.lock /etc/gshadow.lock
>> +
>> +COREUTILSLIB=@libdir@/coreutils
>> +LOG="${COREUTILSLIB}/ptest/coreutils_ptest_$(date +%Y%m%d-%H%M%S).log"
>> +USERNAME="tester"
>> +groupadd ugroup1
>> +groupadd ugroup2
>> +useradd -G ugroup1,ugroup2 $USERNAME || echo "user $USERNAME already 
>> exists"
>> +
>> +su tester -c "cd ${COREUTILSLIB}/ptest && make check-TESTS 
>> top_srcdir=. srcdir=." 2>&1 | tee -a ${LOG}
>> +userdel $USERNAME
>> +groupdel ugroup1
>> +groupdel ugroup2
>> diff --git a/meta/recipes-core/coreutils/coreutils_8.31.bb 
>> b/meta/recipes-core/coreutils/coreutils_8.31.bb
>> index 57b2c1bdba..8bec4e0f3c 100644
>> --- a/meta/recipes-core/coreutils/coreutils_8.31.bb
>> +++ b/meta/recipes-core/coreutils/coreutils_8.31.bb
>> @@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
>> file://0001-uname-report-processor-and-hardware-correctly.patch \
>>              file://disable-ls-output-quoting.patch \
>> file://0001-local.mk-fix-cross-compiling-problem.patch \
>> +           file://run-ptest \
>>             "
>>     SRC_URI_append_libc-musl = 
>> "file://strtod_fix_clash_with_strtold.patch"
>> @@ -143,3 +144,39 @@ python __anonymous() {
>>   }
>>     BBCLASSEXTEND = "native nativesdk"
>> +
>> +inherit ptest
>> +
>> +RDEPENDS_${PN}-ptest += "bash findutils gawk liberror-perl 
>> libmodule-build-perl make perl perl-module-file-stat python3-core sed 
>> shadow"
>> +
>> +do_install_ptest () {
>> +    install -d ${D}${PTEST_PATH}/tests
>> +    cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests
>> +    sed -i 's/ginstall/install/g'  `grep -R ginstall 
>> ${D}${PTEST_PATH}/tests | awk -F: '{print $1}' | uniq`
>> +    install -d ${D}${PTEST_PATH}/build-aux
>> +    install ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
>> +    cp ${B}/Makefile ${D}${PTEST_PATH}/
>> +    cp ${S}/init.cfg ${D}${PTEST_PATH}/
>> +    cp -r ${B}/src ${D}${PTEST_PATH}/
>> +    cp -r ${S}/src/*.c ${D}${PTEST_PATH}/src
>> +    sed -i '/^VPATH/s/= .*$/= ./g' ${D}${PTEST_PATH}/Makefile
>> +    sed -i '/^PROGRAMS/s/^/#/g' ${D}${PTEST_PATH}/Makefile
>> +    sed -i '/^Makefile: /s/^.*$/Makefile:/g' ${D}${PTEST_PATH}/Makefile
>> +    sed -i '/^abs_srcdir/s/= .*$/= \$\{PWD\}/g' 
>> ${D}${PTEST_PATH}/Makefile
>> +    sed -i '/^abs_top_builddir/s/= .*$/= \$\{PWD\}/g' 
>> ${D}${PTEST_PATH}/Makefile
>> +    sed -i '/^abs_top_srcdir/s/= .*$/= \$\{PWD\}/g' 
>> ${D}${PTEST_PATH}/Makefile
>> +    sed -i '/^built_programs/s/ginstall/install/g' 
>> ${D}${PTEST_PATH}/Makefile
>> +    chmod -R 777 ${D}${PTEST_PATH}
>> +
>> +    # Disable subcase stty-pairs.sh, it will cause test framework hang
>> +    sed -i '/stty-pairs.sh/d' ${D}${PTEST_PATH}/Makefile
>> +
>> +    # Tweak test d_type-check to use python3 instead of python
>> +    sed -i "1s@.*@#!/usr/bin/python3@" 
>> ${WORKDIR}/image/usr/lib/coreutils/ptest/tests/d_type-check
>
> This is assuming /usr/lib and failing with multilib:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/1642/steps/8/logs/step3b 
>
Ah! Good catch. Will resend with the fix.
>
> ERROR: Logfile of failure stored in: 
> /home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/log.do_install_ptest_base.4366
> Log data follows:
> | DEBUG: Executing shell function do_install_ptest_base
> | sed: can't read 
> /home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check: 
> No such file or directory
> | WARNING: 
> /home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/run.do_install_ptest_base.4366:1 
> exit 2 from 'sed -i "1s@.*@#!/usr/bin/python3@" 
> /home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check'
> | ERROR: Execution of 
> '/home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/run.do_install_ptest_base.4366' 
> failed with exit code 2:
> | sed: can't read 
> /home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check: 
> No such file or directory
> | WARNING: 
> /home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/temp/run.do_install_ptest_base.4366:1 
> exit 2 from 'sed -i "1s@.*@#!/usr/bin/python3@" 
> /home/pokybuild/yocto-worker/multilib/build/build/tmp/work/core2-64-poky-linux/coreutils/8.31-r0/image/usr/lib/coreutils/ptest/tests/d_type-check'
> |
>
> Thanks,
>
> Anuj


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

end of thread, other threads:[~2020-02-28 13:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 18:07 [PATCH 0/2 v3] Add ptest support for coreutils Trevor Gamblin
2020-02-26 18:07 ` [PATCH 1/2 v3] coreutils: add ptest Trevor Gamblin
2020-02-26 18:13   ` Alexander Kanavin
2020-02-27 23:26     ` Richard Purdie
2020-02-27 23:51       ` Trevor Gamblin
2020-02-28  7:51         ` Richard Purdie
2020-02-28  3:59   ` Anuj Mittal
2020-02-28 13:36     ` Trevor Gamblin
2020-02-26 18:07 ` [PATCH 2/2 v3] ptest-packagelists.inc: add coreutils to SLOW list Trevor Gamblin

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.