mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! test: add support for pytest --graphic
@ 2025-08-06 16:32 Ahmad Fatoum
  2025-08-07  5:12 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2025-08-06 16:32 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

test: qemu: pass -nographic in the default case.

Otherwise, we end up with an error message if the default is to use a
graphic backend.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 conftest.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/conftest.py b/conftest.py
index 45e8835924b3..e8de5952efb4 100644
--- a/conftest.py
+++ b/conftest.py
@@ -116,9 +116,10 @@ def strategy(request, target, pytestconfig):
         else:
             pytest.exit("barebox currently supports only a single extra virtio console\n", 1)
 
-    graphics = None
-    if pytestconfig.option.qemu_graphics:
-        if qemu_bin == "qemu-system-x86_64":
+    if qemu_bin is not None:
+        if not pytestconfig.option.qemu_graphics:
+            graphics = '-nographic'
+        elif qemu_bin == "qemu-system-x86_64":
             graphics = '-device isa-vga'
         elif 'pci' in features:
             graphics = '-device VGA'
-- 
2.39.5




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

* Re: [PATCH] fixup! test: add support for pytest --graphic
  2025-08-06 16:32 [PATCH] fixup! test: add support for pytest --graphic Ahmad Fatoum
@ 2025-08-07  5:12 ` Sascha Hauer
  0 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2025-08-07  5:12 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Wed, 06 Aug 2025 18:32:14 +0200, Ahmad Fatoum wrote:
> test: qemu: pass -nographic in the default case.
> 
> Otherwise, we end up with an error message if the default is to use a
> graphic backend.
> 
> 

Applied, thanks!

[1/1] fixup! test: add support for pytest --graphic
      https://git.pengutronix.de/cgit/barebox/commit/?id=3c5498cf9255 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

* Re: [PATCH] fixup! test: add support for pytest --graphic
  2025-08-06  6:19 ` [PATCH] fixup! " Sascha Hauer
  2025-08-06  6:20   ` Sascha Hauer
@ 2025-08-06  7:40   ` Ahmad Fatoum
  1 sibling, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2025-08-06  7:40 UTC (permalink / raw)
  To: Sascha Hauer, Barebox List

On 06.08.25 08:19, Sascha Hauer wrote:
> Supply qemu options only for qemu targets. Otherwise
> 
> labgrid-pytest --lg-env test/sandbox/sandbox_defconfig.yaml
> 
> fails with:
> 
> _pytest.outcomes.Exit: Qemu option supplied for non-Qemu targe
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Thanks for fixing,
Ahmad

> ---
>  conftest.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/conftest.py b/conftest.py
> index e3f09bac31..782ebc0536 100644
> --- a/conftest.py
> +++ b/conftest.py
> @@ -125,7 +125,7 @@ def strategy(request, target, pytestconfig):
>          else:
>              pytest.exit("--graphics unsupported for target\n", 1)
>  
> -    strategy.append_qemu_args(graphics or '-nographic')
> +        strategy.append_qemu_args(graphics)
>  
>      for i, blk in enumerate(pytestconfig.option.qemu_block):
>          if virtio:


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: [PATCH] fixup! test: add support for pytest --graphic
  2025-08-06  6:19 ` [PATCH] fixup! " Sascha Hauer
@ 2025-08-06  6:20   ` Sascha Hauer
  2025-08-06  7:40   ` Ahmad Fatoum
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2025-08-06  6:20 UTC (permalink / raw)
  To: Barebox List; +Cc: Ahmad Fatoum

On Wed, Aug 06, 2025 at 08:19:14AM +0200, Sascha Hauer wrote:
> Supply qemu options only for qemu targets. Otherwise
> 
> labgrid-pytest --lg-env test/sandbox/sandbox_defconfig.yaml
> 
> fails with:
> 
> _pytest.outcomes.Exit: Qemu option supplied for non-Qemu targe
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  conftest.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/conftest.py b/conftest.py
> index e3f09bac31..782ebc0536 100644
> --- a/conftest.py
> +++ b/conftest.py
> @@ -125,7 +125,7 @@ def strategy(request, target, pytestconfig):
>          else:
>              pytest.exit("--graphics unsupported for target\n", 1)
>  
> -    strategy.append_qemu_args(graphics or '-nographic')
> +        strategy.append_qemu_args(graphics)
>  
>      for i, blk in enumerate(pytestconfig.option.qemu_block):
>          if virtio:

Ahmad, is this ok like this?

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* [PATCH] fixup! test: add support for pytest --graphic
  2025-07-08 19:36 [PATCH 4/4] " Ahmad Fatoum
@ 2025-08-06  6:19 ` Sascha Hauer
  2025-08-06  6:20   ` Sascha Hauer
  2025-08-06  7:40   ` Ahmad Fatoum
  0 siblings, 2 replies; 5+ messages in thread
From: Sascha Hauer @ 2025-08-06  6:19 UTC (permalink / raw)
  To: Barebox List

Supply qemu options only for qemu targets. Otherwise

labgrid-pytest --lg-env test/sandbox/sandbox_defconfig.yaml

fails with:

_pytest.outcomes.Exit: Qemu option supplied for non-Qemu targe

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 conftest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conftest.py b/conftest.py
index e3f09bac31..782ebc0536 100644
--- a/conftest.py
+++ b/conftest.py
@@ -125,7 +125,7 @@ def strategy(request, target, pytestconfig):
         else:
             pytest.exit("--graphics unsupported for target\n", 1)
 
-    strategy.append_qemu_args(graphics or '-nographic')
+        strategy.append_qemu_args(graphics)
 
     for i, blk in enumerate(pytestconfig.option.qemu_block):
         if virtio:
-- 
2.39.5




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

end of thread, other threads:[~2025-08-07  5:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-06 16:32 [PATCH] fixup! test: add support for pytest --graphic Ahmad Fatoum
2025-08-07  5:12 ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2025-07-08 19:36 [PATCH 4/4] " Ahmad Fatoum
2025-08-06  6:19 ` [PATCH] fixup! " Sascha Hauer
2025-08-06  6:20   ` Sascha Hauer
2025-08-06  7:40   ` Ahmad Fatoum

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