public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: venkata.pyla@toshiba-tsip.com
To: isar-users@googlegroups.com
Cc: venkata pyla <venkata.pyla@toshiba-tsip.com>,
	amikan@ilbers.de, jan.kiszka@siemens.com,
	henning.schild@siemens.com, kazuhiro3.hayashi@toshiba.co.jp,
	dinesh.kumar@toshiba-tsip.com
Subject: [PATCH] repro-build-test.py: Use bitbake env to get image filename
Date: Mon,  9 Jan 2023 21:22:57 +0530	[thread overview]
Message-ID: <20230109155257.26183-1-venkata.pyla@toshiba-tsip.com> (raw)

From: venkata pyla <venkata.pyla@toshiba-tsip.com>

The hard-coded distro name 'debian' will break the test when other
distros are used.

So the image_name is prepared using bitbake environment variables.

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 testsuite/repro-build-test.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/testsuite/repro-build-test.py b/testsuite/repro-build-test.py
index 5d92e2c..1c0b05b 100755
--- a/testsuite/repro-build-test.py
+++ b/testsuite/repro-build-test.py
@@ -29,11 +29,14 @@ class ReproBuild(CIBuilder):
 
     def get_image_path(self, target_name):
         image_dir = "tmp/deploy/images"
-        target_params = target_name.split(":")
-        machine = target_params[1].split("-")[0]
-        distro = "debian-" + target_params[1].split("-")[1]
-        image_type = target_params[2]
-        return f"{image_dir}/{machine}/{image_type}-{distro}-{machine}.tar.gz"
+        output = process.getoutput(
+            f'bitbake -e {target_name} '
+            r'| grep "^MACHINE=\|^IMAGE_FULLNAME="'
+        )
+        env = dict(d.split("=", 1) for d in output.splitlines())
+        machine = env["MACHINE"].strip("\"")
+        image_name = env["IMAGE_FULLNAME"].strip("\"")
+        return f"{image_dir}/{machine}/{image_name}.tar.gz"
 
     def build_repro_image(
         self, target, source_date_epoch=None, image_name="image.tar.gz"
-- 
2.20.1



             reply	other threads:[~2023-01-09 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 15:52 venkata.pyla [this message]
2023-01-10 13:00 ` Henning Schild
2023-03-30  7:14 ` Uladzimir Bely

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=20230109155257.26183-1-venkata.pyla@toshiba-tsip.com \
    --to=venkata.pyla@toshiba-tsip.com \
    --cc=amikan@ilbers.de \
    --cc=dinesh.kumar@toshiba-tsip.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kazuhiro3.hayashi@toshiba.co.jp \
    /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