[PATCH 2/2] test: pytest: support formats besides raw for --blk

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Aug 22 23:16:12 PDT 2023


So far, we hardcoded format=raw to avoid Qemu warnings about having to
guess file type. Instead move format=raw to the start, so other formats
can be appended as necessary. Example:

  pytest --lg-env test/arm/multi_v8_defconfig.yaml --interactive --blk=img.qcow2,format=qcow2

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 test/conftest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/conftest.py b/test/conftest.py
index 03bf41a93874..12daf3a058ff 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -89,7 +89,7 @@ def strategy(request, target, pytestconfig):
     for i, blk in enumerate(pytestconfig.option.qemu_block):
         if virtio:
             strategy.append_qemu_args(
-                "-drive", f"if=none,file={blk},format=raw,id=hd{i}",
+                "-drive", f"if=none,format=raw,id=hd{i},file={blk}",
                 "-device", f"virtio-blk-{virtio},drive=hd{i}"
             )
         else:
-- 
2.39.2




More information about the barebox mailing list