summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-06-19 11:52:38 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-06-26 11:55:32 +0200
commite4e427fcadf082e5382de82e62f2fa3938732bdb (patch)
tree508d6633dadbfa2bc126b70f025954de6be2e8ba
parent1ee7f7d25bac093ca0e3f2f77eb276dc56f74c92 (diff)
downloadbarebox-e4e427fcadf082e5382de82e62f2fa3938732bdb.tar.gz
barebox-e4e427fcadf082e5382de82e62f2fa3938732bdb.tar.xz
test: lookup qemu binary in path if no tools key exists
This is already the behavior on labgrid master, but until there's a release using that, we amend the BareboxTestStrategy to achieve the same result with existing labgrid releases. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230619095240.4168216-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--test/arm/a15@multi_v7_defconfig.yaml4
-rw-r--r--test/arm/a9@multi_v7_defconfig.yaml4
-rw-r--r--test/arm/multi_v8_defconfig.yaml4
-rw-r--r--test/arm/qemu-raspi0@multi_v7_defconfig.yaml4
-rw-r--r--test/arm/qemu-raspi1ap@multi_v7_defconfig.yaml4
-rw-r--r--test/arm/qemu-raspi2b@multi_v7_defconfig.yaml4
-rw-r--r--test/arm/qemu-sabrelite@multi_v7_defconfig.yaml4
-rw-r--r--test/arm/virt@multi_v7_defconfig.yaml4
-rw-r--r--test/mips/be@qemu-malta_defconfig.yaml4
-rw-r--r--test/mips/le@qemu-malta_defconfig.yaml4
-rw-r--r--test/mips/qemu-malta64el_defconfig.yaml4
-rw-r--r--test/openrisc/generic_defconfig.yaml4
-rw-r--r--test/riscv/qemu-virt64@rv64i_defconfig.yaml4
-rw-r--r--test/riscv/qemu@virt32_defconfig.yaml4
-rw-r--r--test/riscv/sifive@rv64i_defconfig.yaml4
-rw-r--r--test/strategy.py12
-rw-r--r--test/x86/pc@efi_defconfig.yaml4
-rw-r--r--test/x86/q35@efi_defconfig.yaml4
-rw-r--r--test/x86/virtio@efi_defconfig.yaml4
19 files changed, 30 insertions, 54 deletions
diff --git a/test/arm/a15@multi_v7_defconfig.yaml b/test/arm/a15@multi_v7_defconfig.yaml
index 941e914ab2..dfa73fb3f5 100644
--- a/test/arm/a15@multi_v7_defconfig.yaml
+++ b/test/arm/a15@multi_v7_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-arm
machine: vexpress-a15
cpu: cortex-a15
memory: 1024M
@@ -14,7 +14,5 @@ targets:
BareboxTestStrategy: {}
images:
barebox-vexpress-ca15.img: !template "$LG_BUILDDIR/images/barebox-vexpress-ca15.img"
-tools:
- qemu: /usr/bin/qemu-system-arm
imports:
- ../strategy.py
diff --git a/test/arm/a9@multi_v7_defconfig.yaml b/test/arm/a9@multi_v7_defconfig.yaml
index fefee153cf..8e8220102c 100644
--- a/test/arm/a9@multi_v7_defconfig.yaml
+++ b/test/arm/a9@multi_v7_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-arm
machine: vexpress-a9
cpu: cortex-a9
memory: 1024M
@@ -14,7 +14,5 @@ targets:
BareboxTestStrategy: {}
images:
barebox-vexpress-ca9.img: !template "$LG_BUILDDIR/images/barebox-vexpress-ca9.img"
-tools:
- qemu: /usr/bin/qemu-system-arm
imports:
- ../strategy.py
diff --git a/test/arm/multi_v8_defconfig.yaml b/test/arm/multi_v8_defconfig.yaml
index 5da5dfeb7e..d8f8ab5cbf 100644
--- a/test/arm/multi_v8_defconfig.yaml
+++ b/test/arm/multi_v8_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-aarch64
machine: virt,highmem=off
cpu: cortex-a57
memory: 1024M
@@ -18,7 +18,5 @@ targets:
tuxmake_arch: arm64
images:
barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
-tools:
- qemu: /usr/bin/qemu-system-aarch64
imports:
- ../strategy.py
diff --git a/test/arm/qemu-raspi0@multi_v7_defconfig.yaml b/test/arm/qemu-raspi0@multi_v7_defconfig.yaml
index e6ba641087..0a9a727c64 100644
--- a/test/arm/qemu-raspi0@multi_v7_defconfig.yaml
+++ b/test/arm/qemu-raspi0@multi_v7_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-arm
machine: raspi0
cpu: arm1176
memory: 512M
@@ -14,7 +14,5 @@ targets:
BareboxTestStrategy: {}
images:
barebox-raspberry-pi.img: !template "$LG_BUILDDIR/images/barebox-raspberry-pi.img"
-tools:
- qemu: /usr/bin/qemu-system-arm
imports:
- ../strategy.py
diff --git a/test/arm/qemu-raspi1ap@multi_v7_defconfig.yaml b/test/arm/qemu-raspi1ap@multi_v7_defconfig.yaml
index 1abd6721cb..0950481a63 100644
--- a/test/arm/qemu-raspi1ap@multi_v7_defconfig.yaml
+++ b/test/arm/qemu-raspi1ap@multi_v7_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-arm
machine: raspi1ap
cpu: arm1176
memory: 512M
@@ -14,7 +14,5 @@ targets:
BareboxTestStrategy: {}
images:
barebox-raspberry-pi.img: !template "$LG_BUILDDIR/images/barebox-raspberry-pi.img"
-tools:
- qemu: /usr/bin/qemu-system-arm
imports:
- ../strategy.py
diff --git a/test/arm/qemu-raspi2b@multi_v7_defconfig.yaml b/test/arm/qemu-raspi2b@multi_v7_defconfig.yaml
index bd92343c80..72471c0a7f 100644
--- a/test/arm/qemu-raspi2b@multi_v7_defconfig.yaml
+++ b/test/arm/qemu-raspi2b@multi_v7_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-arm
machine: raspi2b
cpu: cortex-a7
memory: 1G
@@ -14,7 +14,5 @@ targets:
BareboxTestStrategy: {}
images:
barebox-raspberry-pi.img: !template "$LG_BUILDDIR/images/barebox-raspberry-pi.img"
-tools:
- qemu: /usr/bin/qemu-system-arm
imports:
- ../strategy.py
diff --git a/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml b/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml
index 948618a90f..77b7f9e589 100644
--- a/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml
+++ b/test/arm/qemu-sabrelite@multi_v7_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-arm
machine: sabrelite
cpu: cortex-a9
memory: 1024M
@@ -16,7 +16,5 @@ targets:
images:
barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
imx6q-sabreliste.dtb: !template "$LG_BUILDDIR/arch/arm/dts/imx6q-sabrelite.dtb"
-tools:
- qemu: /usr/bin/qemu-system-arm
imports:
- ../strategy.py
diff --git a/test/arm/virt@multi_v7_defconfig.yaml b/test/arm/virt@multi_v7_defconfig.yaml
index 66ecf20690..203f17bfc7 100644
--- a/test/arm/virt@multi_v7_defconfig.yaml
+++ b/test/arm/virt@multi_v7_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-arm
machine: virt
cpu: cortex-a7
memory: 1024M
@@ -16,7 +16,5 @@ targets:
- virtio-mmio
images:
barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
-tools:
- qemu: /usr/bin/qemu-system-arm
imports:
- ../strategy.py
diff --git a/test/mips/be@qemu-malta_defconfig.yaml b/test/mips/be@qemu-malta_defconfig.yaml
index 774023cd84..5f438e4b90 100644
--- a/test/mips/be@qemu-malta_defconfig.yaml
+++ b/test/mips/be@qemu-malta_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-mips
machine: malta
cpu: M14Kc
memory: 256M
@@ -16,7 +16,5 @@ targets:
- virtio-pci
images:
barebox-qemu-malta.img: !template "$LG_BUILDDIR/images/barebox-qemu-malta.img"
-tools:
- qemu: /usr/bin/qemu-system-mips
imports:
- ../strategy.py
diff --git a/test/mips/le@qemu-malta_defconfig.yaml b/test/mips/le@qemu-malta_defconfig.yaml
index 8fc8c4dae9..ecf9484dcc 100644
--- a/test/mips/le@qemu-malta_defconfig.yaml
+++ b/test/mips/le@qemu-malta_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-mipsel
machine: malta
cpu: M14Kc
memory: 256M
@@ -19,7 +19,5 @@ targets:
- CONFIG_CPU_LITTLE_ENDIAN=y
images:
barebox-qemu-malta.img.swapped: !template "$LG_BUILDDIR/images/barebox-qemu-malta.img.swapped"
-tools:
- qemu: /usr/bin/qemu-system-mipsel
imports:
- ../strategy.py
diff --git a/test/mips/qemu-malta64el_defconfig.yaml b/test/mips/qemu-malta64el_defconfig.yaml
index 22562d5b7a..bf8563e662 100644
--- a/test/mips/qemu-malta64el_defconfig.yaml
+++ b/test/mips/qemu-malta64el_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-mips64el
machine: malta
cpu: 5KEf
memory: 256M
@@ -16,7 +16,5 @@ targets:
- virtio-pci
images:
barebox-qemu-malta.img.swapped: !template "$LG_BUILDDIR/images/barebox-qemu-malta.img.swapped"
-tools:
- qemu: /usr/bin/qemu-system-mips64el
imports:
- ../strategy.py
diff --git a/test/openrisc/generic_defconfig.yaml b/test/openrisc/generic_defconfig.yaml
index 0a2d4a7a18..93ba9586c4 100644
--- a/test/openrisc/generic_defconfig.yaml
+++ b/test/openrisc/generic_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-or1k
machine: or1k-sim
cpu: or1200
memory: 256M
@@ -14,7 +14,5 @@ targets:
BareboxTestStrategy: {}
images:
barebox: !template "$LG_BUILDDIR/barebox"
-tools:
- qemu: /usr/bin/qemu-system-or1k
imports:
- ../strategy.py
diff --git a/test/riscv/qemu-virt64@rv64i_defconfig.yaml b/test/riscv/qemu-virt64@rv64i_defconfig.yaml
index ee121f1536..c920413a17 100644
--- a/test/riscv/qemu-virt64@rv64i_defconfig.yaml
+++ b/test/riscv/qemu-virt64@rv64i_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-riscv64
machine: virt
cpu: rv64
memory: 256M
@@ -16,7 +16,5 @@ targets:
- virtio-mmio
images:
barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
-tools:
- qemu: /usr/bin/qemu-system-riscv64
imports:
- ../strategy.py
diff --git a/test/riscv/qemu@virt32_defconfig.yaml b/test/riscv/qemu@virt32_defconfig.yaml
index 5c602635d4..da1bb5bddd 100644
--- a/test/riscv/qemu@virt32_defconfig.yaml
+++ b/test/riscv/qemu@virt32_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-riscv32
machine: virt
cpu: rv32
memory: 256M
@@ -21,7 +21,5 @@ targets:
images:
barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
opensbi-riscv32-generic-fw_dynamic.bin: !template "$LG_BUILDDIR/opensbi-riscv32-generic-fw_dynamic.bin"
-tools:
- qemu: /usr/bin/qemu-system-riscv32
imports:
- ../strategy.py
diff --git a/test/riscv/sifive@rv64i_defconfig.yaml b/test/riscv/sifive@rv64i_defconfig.yaml
index 303f962997..ce4ea0e1e2 100644
--- a/test/riscv/sifive@rv64i_defconfig.yaml
+++ b/test/riscv/sifive@rv64i_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-riscv64
machine: sifive_u
cpu: sifive-u54
memory: 256M
@@ -14,7 +14,5 @@ targets:
BareboxTestStrategy: {}
images:
barebox-hifive-unleashed.img: !template "$LG_BUILDDIR/images/barebox-hifive-unleashed.img"
-tools:
- qemu: /usr/bin/qemu-system-riscv64
imports:
- ../strategy.py
diff --git a/test/strategy.py b/test/strategy.py
index 81650a7600..65cdae4fbf 100644
--- a/test/strategy.py
+++ b/test/strategy.py
@@ -4,6 +4,7 @@ import attr
import pytest
import subprocess
import os
+import shutil
import sys
from labgrid import target_factory, step, driver
@@ -33,6 +34,7 @@ class BareboxTestStrategy(Strategy):
super().__attrs_post_init__()
if isinstance(self.console, driver.QEMUDriver):
self.qemu = self.console
+ self.patchtools()
@step(args=['status'])
def transition(self, status, *, step):
@@ -110,6 +112,16 @@ class BareboxTestStrategy(Strategy):
return cmd
+ def patchtools(self):
+ # https://github.com/labgrid-project/labgrid/commit/69fd553c6969526b609d0be6bb81f0c35f08d1d0
+ if self.qemu is None:
+ return
+
+ if 'tools' not in self.target.env.config.data:
+ self.target.env.config.data['tools'] = {}
+ self.target.env.config.data["tools"][self.qemu.qemu_bin] = \
+ shutil.which(self.qemu.qemu_bin)
+
def quote_cmd(cmd):
quoted = map(lambda s : s if s.find(" ") == -1 else "'" + s + "'", cmd)
return " ".join(quoted)
diff --git a/test/x86/pc@efi_defconfig.yaml b/test/x86/pc@efi_defconfig.yaml
index 280f5dcee9..e818409703 100644
--- a/test/x86/pc@efi_defconfig.yaml
+++ b/test/x86/pc@efi_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-x86_64
machine: pc
cpu: Nehalem
memory: 1024M
@@ -25,7 +25,5 @@ targets:
images:
barebox.efi: !template "$LG_BUILDDIR/barebox.efi"
OVMF.fd: !template "$LG_BUILDDIR/OVMF.fd"
-tools:
- qemu: /usr/bin/qemu-system-x86_64
imports:
- ../strategy.py
diff --git a/test/x86/q35@efi_defconfig.yaml b/test/x86/q35@efi_defconfig.yaml
index dcb3f604c0..71c44e8cd4 100644
--- a/test/x86/q35@efi_defconfig.yaml
+++ b/test/x86/q35@efi_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-x86_64
machine: q35
cpu: Nehalem
memory: 1024M
@@ -25,7 +25,5 @@ targets:
images:
barebox.efi: !template "$LG_BUILDDIR/barebox.efi"
OVMF.fd: !template "$LG_BUILDDIR/OVMF.fd"
-tools:
- qemu: /usr/bin/qemu-system-x86_64
imports:
- ../strategy.py
diff --git a/test/x86/virtio@efi_defconfig.yaml b/test/x86/virtio@efi_defconfig.yaml
index 326fcbc689..3890893638 100644
--- a/test/x86/virtio@efi_defconfig.yaml
+++ b/test/x86/virtio@efi_defconfig.yaml
@@ -2,7 +2,7 @@ targets:
main:
drivers:
QEMUDriver:
- qemu_bin: qemu
+ qemu_bin: qemu-system-x86_64
machine: pc
cpu: Nehalem
memory: 1024M
@@ -26,7 +26,5 @@ targets:
images:
barebox.efi: !template "$LG_BUILDDIR/barebox.efi"
OVMF.fd: !template "$LG_BUILDDIR/OVMF.fd"
-tools:
- qemu: /usr/bin/qemu-system-x86_64
imports:
- ../strategy.py