diff mbox series

Revert "testimage: retrieve ptests directory when ptests fail"

Message ID 20240717110050.2515243-1-jose.quaresma@foundries.io
State New
Headers show
Series Revert "testimage: retrieve ptests directory when ptests fail" | expand

Commit Message

Jose Quaresma July 17, 2024, 11 a.m. UTC
This reverts commit d1ac9bb1bd2132cd121f0e80829302298d8a8a64.

The variable TESTIMAGE_FAILED_QA_ARTIFACTS is not parsed as expected [1]
and is making some noise on the testimage output log as can be seen bellow [2]:

[1]:

bitbake-getvar -r core-image-minimal TESTIMAGE_FAILED_QA_ARTIFACTS
TESTIMAGE_FAILED_QA_ARTIFACTS="    /var/log     /etc/version     /etc/os-release \${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '/usr/lib/\${MCNAME}/ptest', '', d)}"

[2]:

DEBUG: [Running]$ ssh -l root -o ServerAliveCountMax=2 -o ServerAliveInterval=30 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 192.168.7.2 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; for p in /etc/os-release; do if [ -e $p ]; then echo $p; fi; done
DEBUG: Waiting for process output: time: 1721210770.14278, endtime: 1721211070.142032
DEBUG: Data from SSH call:

DEBUG: [Command returned '0' after 0.36 seconds]
DEBUG: Command: for p in /etc/os-release; do if [ -e $p ]; then echo $p; fi; done
Status: 0 Output:

NOTE: No file/directory matching path /etc/os-release
DEBUG: [Running]$ ssh -l root -o ServerAliveCountMax=2 -o ServerAliveInterval=30 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 192.168.7.2 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; for p in ${@bb.utils.contains('DISTRO_FEATURES',; do if [ -e $p ]; then echo $p; fi; done
DEBUG: Waiting for process output: time: 1721212869.3242505, endtime: 1721213169.323435
DEBUG: Partial data from SSH call:
sh: syntax error: missing '}'

DEBUG: Waiting for process output: time: 1721212869.6859117, endtime: 1721213169.6859093
DEBUG: Data from SSH call:
sh: syntax error: missing '}'
DEBUG: [Command returned '2' after 0.56 seconds]
DEBUG: Command: for p in ${@bb.utils.contains('DISTRO_FEATURES',; do if [ -e $p ]; then echo $p; fi; done
Status: 2 Output:  sh: syntax error: missing '}'

NOTE: No file/directory matching path ${@bb.utils.contains('DISTRO_FEATURES',
DEBUG: [Running]$ ssh -l root -o ServerAliveCountMax=2 -o ServerAliveInterval=30 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 192.168.7.2 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; for p in 'ptest',; do if [ -e $p ]; then echo $p; fi; done
DEBUG: Waiting for process output: time: 1721212869.8884451, endtime: 1721213169.8876731
DEBUG: Data from SSH call:

DEBUG: [Command returned '0' after 0.37 seconds]
DEBUG: Command: for p in 'ptest',; do if [ -e $p ]; then echo $p; fi; done
Status: 0 Output:

NOTE: No file/directory matching path 'ptest',
DEBUG: [Running]$ ssh -l root -o ServerAliveCountMax=2 -o ServerAliveInterval=30 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 192.168.7.2 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; for p in '/usr/lib/${MCNAME}/ptest',; do if [ -e $p ]; then echo $p; fi; done
DEBUG: Waiting for process output: time: 1721212870.2542233, endtime: 1721213170.253479
DEBUG: Data from SSH call:

DEBUG: [Command returned '0' after 0.37 seconds]
DEBUG: Command: for p in '/usr/lib/${MCNAME}/ptest',; do if [ -e $p ]; then echo $p; fi; done
Status: 0 Output:

NOTE: No file/directory matching path '/usr/lib/${MCNAME}/ptest',
DEBUG: [Running]$ ssh -l root -o ServerAliveCountMax=2 -o ServerAliveInterval=30 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 192.168.7.2 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; for p in '',; do if [ -e $p ]; then echo $p; fi; done
DEBUG: Waiting for process output: time: 1721212870.6207979, endtime: 1721213170.62004
DEBUG: Data from SSH call:

DEBUG: [Command returned '0' after 0.37 seconds]
DEBUG: Command: for p in '',; do if [ -e $p ]; then echo $p; fi; done
Status: 0 Output:

NOTE: No file/directory matching path '',

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
---
 meta/classes-recipe/testimage.bbclass        | 5 +----
 meta/recipes-core/images/core-image-ptest.bb | 1 +
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Richard Purdie July 17, 2024, 11:24 a.m. UTC | #1
On Wed, 2024-07-17 at 12:00 +0100, Jose Quaresma via lists.openembedded.org wrote:
> This reverts commit d1ac9bb1bd2132cd121f0e80829302298d8a8a64.
> 
> The variable TESTIMAGE_FAILED_QA_ARTIFACTS is not parsed as expected [1]
> and is making some noise on the testimage output log as can be seen bellow [2]:
> 
> [1]:
> 
> bitbake-getvar -r core-image-minimal TESTIMAGE_FAILED_QA_ARTIFACTS
> TESTIMAGE_FAILED_QA_ARTIFACTS="    /var/log     /etc/version     /etc/os-release \${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '/usr/lib/\${MCNAME}/ptest', '', d)}"

It is because MCNAME isn't defined outside the ptest images. We should
move that line into the ptest images that use mcextend, or swap MCNAME
for a wildcard if that would work.

Cheers,

Richard
Jose Quaresma July 17, 2024, 12:07 p.m. UTC | #2
Richard Purdie <richard.purdie@linuxfoundation.org> escreveu (quarta,
17/07/2024 à(s) 12:25):

> On Wed, 2024-07-17 at 12:00 +0100, Jose Quaresma via
> lists.openembedded.org wrote:
> > This reverts commit d1ac9bb1bd2132cd121f0e80829302298d8a8a64.
> >
> > The variable TESTIMAGE_FAILED_QA_ARTIFACTS is not parsed as expected [1]
> > and is making some noise on the testimage output log as can be seen
> bellow [2]:
> >
> > [1]:
> >
> > bitbake-getvar -r core-image-minimal TESTIMAGE_FAILED_QA_ARTIFACTS
> > TESTIMAGE_FAILED_QA_ARTIFACTS="    /var/log     /etc/version
> /etc/os-release \${@bb.utils.contains('DISTRO_FEATURES', 'ptest',
> '/usr/lib/\${MCNAME}/ptest', '', d)}"
>
> It is because MCNAME isn't defined outside the ptest images. We should
> move that line into the ptest images that use mcextend, or swap MCNAME
> for a wildcard if that would work.
>

Yup, I tested with your patch on main-next and it works.
Thanks

Jose


>
> Cheers,
>
> Richard
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index 72282ac362..47060c00bc 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -22,14 +22,11 @@  TESTIMAGE_AUTO ??= "0"
 # each entry in it, if artifact pointed by path description exists on target,
 # it will be retrieved onto host
 
-TESTIMAGE_FAILED_QA_ARTIFACTS = "\
+TESTIMAGE_FAILED_QA_ARTIFACTS ??= "\
     ${localstatedir}/log \
     ${sysconfdir}/version \
     ${sysconfdir}/os-release"
 
-# If some ptests are run and fail, retrieve corresponding directories
-TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/${MCNAME}/ptest', '', d)}"
-
 # You can set (or append to) TEST_SUITES in local.conf to select the tests
 # which you want to run for your target.
 # The test names are the module names in meta/lib/oeqa/runtime/cases.
diff --git a/meta/recipes-core/images/core-image-ptest.bb b/meta/recipes-core/images/core-image-ptest.bb
index 72081f938d..2b965c927b 100644
--- a/meta/recipes-core/images/core-image-ptest.bb
+++ b/meta/recipes-core/images/core-image-ptest.bb
@@ -42,3 +42,4 @@  python () {
     if not d.getVar("MCNAME"):
         raise bb.parse.SkipRecipe("No class extension set")
 }
+