public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] repro-build-test.py: Use bitbake env to get image filename
@ 2023-01-09 15:52 venkata.pyla
  2023-01-10 13:00 ` Henning Schild
  2023-03-30  7:14 ` Uladzimir Bely
  0 siblings, 2 replies; 3+ messages in thread
From: venkata.pyla @ 2023-01-09 15:52 UTC (permalink / raw)
  To: isar-users
  Cc: venkata pyla, amikan, jan.kiszka, henning.schild,
	kazuhiro3.hayashi, dinesh.kumar

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-30  7:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 15:52 [PATCH] repro-build-test.py: Use bitbake env to get image filename venkata.pyla
2023-01-10 13:00 ` Henning Schild
2023-03-30  7:14 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox