summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2024-02-06 16:29:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-08 10:58:31 +0000
commit9357ab6c47f0a0a7000cb18358bc9775fd54e1f7 (patch)
tree26649ccb3a83d46bb4adf3bfaa776c69c903240f
parentadc448b19e80f6343050f4c527acc63a161c88ca (diff)
downloadopenembedded-core-9357ab6c47f0a0a7000cb18358bc9775fd54e1f7.tar.gz
testimage: retrieve ptests directory when ptests fail
TESTIMAGE_FAILED_QA_ARTIFACTS is set with a default, minimal list of files to retrieve whenever a runtime test fails. Add ptests directory to the list so we can get ptests artifacts (eg: logs) whenever a ptest fails. By appending the ptest directory with the multiconfig component in the path, only failing ptests will lead to corresponding ptest artifacts retrieval, instead of all ptests artifacts retrieval. While doing this addition, reinforce default value using "=" operator to make sure to get the default list in any case. Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/testimage.bbclass5
-rw-r--r--meta/recipes-core/images/core-image-ptest.bb1
2 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index f36d941891..281de4784f 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -22,11 +22,14 @@ 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 b6f5c2fd60..862e44f5e6 100644
--- a/meta/recipes-core/images/core-image-ptest.bb
+++ b/meta/recipes-core/images/core-image-ptest.bb
@@ -42,4 +42,3 @@ python () {
if not d.getVar("MCNAME"):
raise bb.parse.SkipRecipe("No class extension set")
}
-