public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 08/14] selftest: fitimage.py: respect INITRAMFS_IMAGE_NAME and KERNEL_FIT_LINK_NAME
Date: Mon, 13 Mar 2023 13:15:35 +0100	[thread overview]
Message-ID: <6a87e08d2b541553ef7bb93b2afbd0a28e4177ea.1678709427.git.Martin.Jansa@gmail.com> (raw)
In-Reply-To: <cover.1678709427.git.Martin.Jansa@gmail.com>

* use these variables instead of assuming:
  "fitImage-its-%s-%s-%s" % (image_type, machine, machine)
  notice that these files have no extension and the -machine suffix
  is duplicated (once from core-image-minimal and once from
  kernel-fitimage.bbclass:kernel_do_deploy:append
  through KERNEL_FIT_LINK_NAME which is MACHINE by default:

  KERNEL_FIT_NAME ?= "${KERNEL_ARTIFACT_NAME}"
  KERNEL_FIT_LINK_NAME ?= "${KERNEL_ARTIFACT_LINK_NAME}"

  KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
  KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}"

[YOCTO #12937]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/lib/oeqa/selftest/cases/fitimage.py | 34 +++++++++++-------------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py
index 1570d54dfb..7bc171e02d 100644
--- a/meta/lib/oeqa/selftest/cases/fitimage.py
+++ b/meta/lib/oeqa/selftest/cases/fitimage.py
@@ -5,7 +5,7 @@
 #
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 import os
 import re
 
@@ -42,15 +42,14 @@ FIT_DESC = "A model description"
         self.write_config(config)
 
         # fitImage is created as part of linux recipe
-        bitbake("virtual/kernel")
+        image = "virtual/kernel"
+        bitbake(image)
+        bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'INITRAMFS_IMAGE_NAME', 'KERNEL_FIT_LINK_NAME'], image)
 
-        image_type = "core-image-minimal"
-        deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
-        machine = get_bb_var('MACHINE')
-        fitimage_its_path = os.path.join(deploy_dir_image,
-            "fitImage-its-%s-%s-%s" % (image_type, machine, machine))
-        fitimage_path = os.path.join(deploy_dir_image,
-            "fitImage-%s-%s-%s" % (image_type, machine, machine))
+        fitimage_its_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'],
+            "fitImage-its-%s-%s" % (bb_vars['INITRAMFS_IMAGE_NAME'], bb_vars['KERNEL_FIT_LINK_NAME']))
+        fitimage_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'],
+            "fitImage-%s-%s" % (bb_vars['INITRAMFS_IMAGE_NAME'], bb_vars['KERNEL_FIT_LINK_NAME']))
 
         self.assertTrue(os.path.exists(fitimage_its_path),
             "%s image tree source doesn't exist" % (fitimage_its_path))
@@ -123,15 +122,14 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'"
         self.write_config(config)
 
         # fitImage is created as part of linux recipe
-        bitbake("virtual/kernel")
-
-        image_type = "core-image-minimal"
-        deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
-        machine = get_bb_var('MACHINE')
-        fitimage_its_path = os.path.join(deploy_dir_image,
-            "fitImage-its-%s" % (machine,))
-        fitimage_path = os.path.join(deploy_dir_image,
-            "fitImage-%s.bin" % (machine,))
+        image = "virtual/kernel"
+        bitbake(image)
+        bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'KERNEL_FIT_LINK_NAME'], image)
+
+        fitimage_its_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'],
+            "fitImage-its-%s" % (bb_vars['KERNEL_FIT_LINK_NAME']))
+        fitimage_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'],
+            "fitImage-%s.bin" % (bb_vars['KERNEL_FIT_LINK_NAME']))
 
         self.assertTrue(os.path.exists(fitimage_its_path),
             "%s image tree source doesn't exist" % (fitimage_its_path))
-- 
2.39.2



  parent reply	other threads:[~2023-03-13 12:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1678709427.git.Martin.Jansa@gmail.com>
2023-03-13 12:15 ` [PATCH 01/14] git-submodule-test: disable upstream version check Martin Jansa
2023-03-13 12:15 ` [PATCH 02/14] selftest: devtool: set BB_HASHSERVE_UPSTREAM when setting SSTATE_MIRROR Martin Jansa
2023-03-13 12:15 ` [PATCH 03/14] selftest: wic: respect IMAGE_LINK_NAME Martin Jansa
2023-03-13 12:15 ` [PATCH 04/14] selftest: wic: respect IMAGE_LINK_NAME also in test_rawcopy_plugin_qemu Martin Jansa
2023-03-13 12:15 ` [PATCH 05/14] selftest: runqemu: respect IMAGE_LINK_NAME Martin Jansa
2023-03-13 12:15 ` [PATCH 06/14] selftest: multiconfig-image-packager: try to " Martin Jansa
2023-03-13 12:15 ` [PATCH 07/14] image-artifact-names.bbclass: add INITRAMFS_IMAGE_NAME from kernel.bbclass Martin Jansa
2023-03-13 12:15 ` Martin Jansa [this message]
2023-03-13 12:15 ` [PATCH 09/14] image-artifact-names: add IMAGE_MACHINE_SUFFIX variable Martin Jansa
2023-04-18 22:43   ` [OE-core] " Paul Eggleton
2023-05-11  7:41     ` Martin Jansa
2023-11-28 10:41       ` Martin Jansa
2023-03-13 12:15 ` [PATCH 10/14] selftest: gdbserver.py: respect IMAGE_LINK_NAME Martin Jansa
2023-03-13 12:15 ` [PATCH 11/14] selftest: minidebuginfo.py " Martin Jansa
2023-03-13 12:15 ` [PATCH 12/14] selftest: efibootpartition.py: fix QEMU_USE_KVM usage Martin Jansa
2023-03-13 12:15 ` [PATCH 13/14] runqemu: get_first_file() rename cmd* to glob* Martin Jansa
2023-03-13 12:15 ` [PATCH 14/14] selftest: imagefeatures.py: respect IMAGE_LINK_NAME for debugfs and manifest as well Martin Jansa
     [not found] ` <174BF9A290681E00.25836@lists.openembedded.org>
2023-04-05 15:17   ` [OE-core] [PATCH 12/14] selftest: efibootpartition.py: fix QEMU_USE_KVM usage Martin Jansa

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=6a87e08d2b541553ef7bb93b2afbd0a28e4177ea.1678709427.git.Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.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