diff mbox series

[v2] testimage: add TESTIMAGE_AUTO_SKIP_IMAGES

Message ID 20261013183708.66012-2-jose.quaresma@oss.qualcomm.com
State New
Headers show
Series [v2] testimage: add TESTIMAGE_AUTO_SKIP_IMAGES | expand

Commit Message

Jose Quaresma Oct. 13, 2026, 6:37 p.m. UTC
When TESTIMAGE_AUTO is enabled, the testimage task is automatically
executed for all images. However, this is not the desired behavior
for initramfs images.

This TESTIMAGE_AUTO_SKIP_IMAGES variable excludes a list of images
to be automatically executed. The default INITRAMFS_IMAGE are excluded.

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
---

V2: add new variable to skip selected images
V1: https://lore.kernel.org/openembedded-core/20261009200155.1040688-1-jose.quaresma@oss.qualcomm.com/#r

 meta/classes-recipe/testimage.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index 419ad6dcb0..9909c928cd 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -18,6 +18,9 @@  inherit image-artifact-names
 
 TESTIMAGE_AUTO ??= "0"
 
+# Skip the default initramfs image in auto
+TESTIMAGE_AUTO_SKIP_IMAGES ??= "${INITRAMFS_IMAGE}"
+
 # When any test fails, TESTIMAGE_FAILED_QA ARTIFACTS will be parsed and for
 # each entry in it, if artifact pointed by path description exists on target,
 # it will be retrieved onto host
@@ -520,6 +523,7 @@  def package_extraction(d, test_suites):
 testimage_main[vardepsexclude] += "BB_ORIGENV DATETIME"
 
 python () {
-    if oe.types.boolean(d.getVar("TESTIMAGE_AUTO") or "False"):
+    if oe.types.boolean(d.getVar("TESTIMAGE_AUTO") or "False") and \
+      d.getVar("PN") not in d.getVar("TESTIMAGE_AUTO_SKIP_IMAGES").split():
         bb.build.addtask("testimage", "do_build", "do_image_complete", d)
 }