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

* Re: [PATCH] repro-build-test.py: Use bitbake env to get image filename
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Henning Schild @ 2023-01-10 13:00 UTC (permalink / raw)
  To: venkata.pyla
  Cc: isar-users, amikan, jan.kiszka, kazuhiro3.hayashi, dinesh.kumar

Am Mon,  9 Jan 2023 21:22:57 +0530
schrieb venkata.pyla@toshiba-tsip.com:

> 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="'
> +        )

there is start_vm.get_bitbake_var, maybe you can use that. And we could
think about moving that to another place, because it has little to do
with "start_vm".

Henning

> +        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"


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

* Re: [PATCH] repro-build-test.py: Use bitbake env to get image filename
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2023-03-30  7:14 UTC (permalink / raw)
  To: isar-users

In mail from Monday, 9 January 2023 18:52:57 +03 user venkata.pyla@toshiba-
tsip.com wrote:
> 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.

Applied to next, thanks.




^ 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