summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-06-04 10:47:00 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-09 12:20:05 +0200
commit848c4c61c5b469910df2471c659b005f9f4538b9 (patch)
tree0aa0cb307a4619af49d8b16f93c3b480d25292e3
parent891d7a3b4a3a55d41156da4a6c2221d97cf857c5 (diff)
downloadbarebox-848c4c61c5b469910df2471c659b005f9f4538b9.tar.gz
barebox-848c4c61c5b469910df2471c659b005f9f4538b9.tar.xz
test: add labgrid-style configs for some emulated targets
There are various ways barebox can run under emulation, some of them are described in the documentation and some more in the git history. Make running the emulators more convenient to use by collecting some known-good emulator invocations in a machine readable format. These files can be processed by a test/emulate.pl script added in a follow-up commit. They contain enough information to configure, build and run barebox inside an emulator. Those YAML files utilizing QEMUDriver can also be directly parsed by labgrid for running tests. Utilizing labgrid for this will allow using the same test suite for physical targets as well in future. Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--test/arm/a15@vexpress_defconfig.yaml20
-rw-r--r--test/arm/a9@vexpress_defconfig.yaml20
-rw-r--r--test/arm/qemu_virt64_defconfig.yaml24
l---------test/arm/vexpress_defconfig.yaml1
-rw-r--r--test/arm/virt@vexpress_defconfig.yaml22
-rw-r--r--test/kconfig/virtio-pci.cfg6
-rw-r--r--test/mips/be@qemu-malta_defconfig.yaml22
-rw-r--r--test/mips/le@qemu-malta_defconfig.yaml25
l---------test/mips/qemu-malta_defconfig.yaml1
-rw-r--r--test/openrisc/generic_defconfig.yaml20
-rw-r--r--test/riscv/qemu@virt32_defconfig.yaml27
-rw-r--r--test/riscv/qemu@virt64_defconfig.yaml27
-rw-r--r--test/riscv/sifive_defconfig.yaml25
-rw-r--r--test/riscv/tinyemu@virt32_defconfig.yaml22
-rw-r--r--test/riscv/tinyemu@virt64_defconfig.yaml22
l---------test/riscv/virt32_defconfig.yaml1
l---------test/riscv/virt64_defconfig.yaml1
-rw-r--r--test/sandbox/sandbox_defconfig.yaml12
l---------test/x86/efi_defconfig.yaml1
-rw-r--r--test/x86/pc@efi_defconfig.yaml31
-rw-r--r--test/x86/q35@efi_defconfig.yaml31
-rw-r--r--test/x86/virtio@efi_defconfig.yaml32
22 files changed, 393 insertions, 0 deletions
diff --git a/test/arm/a15@vexpress_defconfig.yaml b/test/arm/a15@vexpress_defconfig.yaml
new file mode 100644
index 0000000000..941e914ab2
--- /dev/null
+++ b/test/arm/a15@vexpress_defconfig.yaml
@@ -0,0 +1,20 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: vexpress-a15
+ cpu: cortex-a15
+ memory: 1024M
+ bios: barebox-vexpress-ca15.img
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ 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@vexpress_defconfig.yaml b/test/arm/a9@vexpress_defconfig.yaml
new file mode 100644
index 0000000000..fefee153cf
--- /dev/null
+++ b/test/arm/a9@vexpress_defconfig.yaml
@@ -0,0 +1,20 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: vexpress-a9
+ cpu: cortex-a9
+ memory: 1024M
+ bios: barebox-vexpress-ca9.img
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ 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/qemu_virt64_defconfig.yaml b/test/arm/qemu_virt64_defconfig.yaml
new file mode 100644
index 0000000000..ed308591da
--- /dev/null
+++ b/test/arm/qemu_virt64_defconfig.yaml
@@ -0,0 +1,24 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: virt
+ cpu: cortex-a57
+ memory: 1024M
+ kernel: barebox-dt-2nd.img
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - virtio-mmio
+ runner:
+ 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/vexpress_defconfig.yaml b/test/arm/vexpress_defconfig.yaml
new file mode 120000
index 0000000000..732f51b19d
--- /dev/null
+++ b/test/arm/vexpress_defconfig.yaml
@@ -0,0 +1 @@
+a9@vexpress_defconfig.yaml \ No newline at end of file
diff --git a/test/arm/virt@vexpress_defconfig.yaml b/test/arm/virt@vexpress_defconfig.yaml
new file mode 100644
index 0000000000..66ecf20690
--- /dev/null
+++ b/test/arm/virt@vexpress_defconfig.yaml
@@ -0,0 +1,22 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: virt
+ cpu: cortex-a7
+ memory: 1024M
+ kernel: barebox-dt-2nd.img
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - 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/kconfig/virtio-pci.cfg b/test/kconfig/virtio-pci.cfg
new file mode 100644
index 0000000000..78237b8fca
--- /dev/null
+++ b/test/kconfig/virtio-pci.cfg
@@ -0,0 +1,6 @@
+CONFIG_VIRTIO_MENU=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_CONSOLE=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_HWRNG=y
+CONFIG_HW_RANDOM_VIRTIO=y
diff --git a/test/mips/be@qemu-malta_defconfig.yaml b/test/mips/be@qemu-malta_defconfig.yaml
new file mode 100644
index 0000000000..774023cd84
--- /dev/null
+++ b/test/mips/be@qemu-malta_defconfig.yaml
@@ -0,0 +1,22 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: malta
+ cpu: M14Kc
+ memory: 256M
+ bios: barebox-qemu-malta.img
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - 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
new file mode 100644
index 0000000000..8fc8c4dae9
--- /dev/null
+++ b/test/mips/le@qemu-malta_defconfig.yaml
@@ -0,0 +1,25 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: malta
+ cpu: M14Kc
+ memory: 256M
+ bios: barebox-qemu-malta.img.swapped
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - virtio-pci
+ runner:
+ kconfig_add:
+ - 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-malta_defconfig.yaml b/test/mips/qemu-malta_defconfig.yaml
new file mode 120000
index 0000000000..481b6e5477
--- /dev/null
+++ b/test/mips/qemu-malta_defconfig.yaml
@@ -0,0 +1 @@
+be@qemu-malta_defconfig.yaml \ No newline at end of file
diff --git a/test/openrisc/generic_defconfig.yaml b/test/openrisc/generic_defconfig.yaml
new file mode 100644
index 0000000000..0a2d4a7a18
--- /dev/null
+++ b/test/openrisc/generic_defconfig.yaml
@@ -0,0 +1,20 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: or1k-sim
+ cpu: or1200
+ memory: 256M
+ kernel: barebox
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+images:
+ barebox: !template "$LG_BUILDDIR/barebox"
+tools:
+ qemu: /usr/bin/qemu-system-or1k
+imports:
+ - ../strategy.py
diff --git a/test/riscv/qemu@virt32_defconfig.yaml b/test/riscv/qemu@virt32_defconfig.yaml
new file mode 100644
index 0000000000..5c602635d4
--- /dev/null
+++ b/test/riscv/qemu@virt32_defconfig.yaml
@@ -0,0 +1,27 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: virt
+ cpu: rv32
+ memory: 256M
+ kernel: barebox-dt-2nd.img
+ bios: opensbi-riscv32-generic-fw_dynamic.bin
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - virtio-mmio
+ runner:
+ download:
+ opensbi-riscv32-generic-fw_dynamic.bin: https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin?raw=true
+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/qemu@virt64_defconfig.yaml b/test/riscv/qemu@virt64_defconfig.yaml
new file mode 100644
index 0000000000..fefbd20e5c
--- /dev/null
+++ b/test/riscv/qemu@virt64_defconfig.yaml
@@ -0,0 +1,27 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: virt
+ cpu: rv64
+ memory: 256M
+ kernel: barebox-dt-2nd.img
+ bios: opensbi-riscv64-generic-fw_dynamic.bin
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - virtio-mmio
+ runner:
+ download:
+ opensbi-riscv64-generic-fw_dynamic.bin: https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin?raw=true
+images:
+ barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
+ opensbi-riscv64-generic-fw_dynamic.bin: !template "$LG_BUILDDIR/opensbi-riscv64-generic-fw_dynamic.bin"
+tools:
+ qemu: /usr/bin/qemu-system-riscv64
+imports:
+ - ../strategy.py
diff --git a/test/riscv/sifive_defconfig.yaml b/test/riscv/sifive_defconfig.yaml
new file mode 100644
index 0000000000..f7299453a4
--- /dev/null
+++ b/test/riscv/sifive_defconfig.yaml
@@ -0,0 +1,25 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: sifive_u
+ cpu: sifive-u54
+ memory: 256M
+ kernel: barebox-hifive-unleashed.img
+ bios: opensbi-riscv64-generic-fw_dynamic.bin
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ runner:
+ download:
+ opensbi-riscv64-generic-fw_dynamic.bin: https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin?raw=true
+images:
+ barebox-hifive-unleashed.img: !template "$LG_BUILDDIR/images/barebox-hifive-unleashed.img"
+ opensbi-riscv64-generic-fw_dynamic.bin: !template "$LG_BUILDDIR/opensbi-riscv64-generic-fw_dynamic.bin"
+tools:
+ qemu: /usr/bin/qemu-system-riscv64
+imports:
+ - ../strategy.py
diff --git a/test/riscv/tinyemu@virt32_defconfig.yaml b/test/riscv/tinyemu@virt32_defconfig.yaml
new file mode 100644
index 0000000000..1102f36aca
--- /dev/null
+++ b/test/riscv/tinyemu@virt32_defconfig.yaml
@@ -0,0 +1,22 @@
+targets:
+ main:
+ drivers:
+ TinyEMUDriver: # not yet supported by labgrid, only for interactive use
+ temu_bin: temu
+ config: ./Documentation/boards/riscv/barebox-virt32.cfg
+ image: barebox-dt-2nd.img
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - virtio-mmio
+ runner:
+ download:
+ bbl32.bin: https://barebox.org/jsbarebox/bbl32.bin
+images:
+ barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
+tools:
+ temu: /usr/local/bin/temu
+imports:
+ - ../strategy.py
diff --git a/test/riscv/tinyemu@virt64_defconfig.yaml b/test/riscv/tinyemu@virt64_defconfig.yaml
new file mode 100644
index 0000000000..e9624160ef
--- /dev/null
+++ b/test/riscv/tinyemu@virt64_defconfig.yaml
@@ -0,0 +1,22 @@
+targets:
+ main:
+ drivers:
+ TinyEMUDriver: # not yet supported by labgrid, only for interactive use
+ temu_bin: temu
+ config: ./Documentation/boards/riscv/barebox-virt64.cfg
+ image: barebox-dt-2nd.img
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - virtio-mmio
+ runner:
+ download:
+ bbl64.bin: https://barebox.org/jsbarebox/bbl64.bin
+images:
+ barebox-dt-2nd.img: !template "$LG_BUILDDIR/images/barebox-dt-2nd.img"
+tools:
+ temu: /usr/local/bin/temu
+imports:
+ - ../strategy.py
diff --git a/test/riscv/virt32_defconfig.yaml b/test/riscv/virt32_defconfig.yaml
new file mode 120000
index 0000000000..e9d7237f53
--- /dev/null
+++ b/test/riscv/virt32_defconfig.yaml
@@ -0,0 +1 @@
+qemu@virt32_defconfig.yaml \ No newline at end of file
diff --git a/test/riscv/virt64_defconfig.yaml b/test/riscv/virt64_defconfig.yaml
new file mode 120000
index 0000000000..ab419d5e7f
--- /dev/null
+++ b/test/riscv/virt64_defconfig.yaml
@@ -0,0 +1 @@
+qemu@virt64_defconfig.yaml \ No newline at end of file
diff --git a/test/sandbox/sandbox_defconfig.yaml b/test/sandbox/sandbox_defconfig.yaml
new file mode 100644
index 0000000000..784f491466
--- /dev/null
+++ b/test/sandbox/sandbox_defconfig.yaml
@@ -0,0 +1,12 @@
+targets:
+ main:
+ drivers:
+ NativeExecutableDriver: # not yet supported by labgrid, only for interactive use
+ command: ./barebox
+ image: barebox
+ runner:
+ tuxmake_arch: um
+images:
+ barebox: !template "$LG_BUILDDIR/barebox"
+tools:
+ qemu: /usr/local/bin/temu
diff --git a/test/x86/efi_defconfig.yaml b/test/x86/efi_defconfig.yaml
new file mode 120000
index 0000000000..942dc259d5
--- /dev/null
+++ b/test/x86/efi_defconfig.yaml
@@ -0,0 +1 @@
+pc@efi_defconfig.yaml \ No newline at end of file
diff --git a/test/x86/pc@efi_defconfig.yaml b/test/x86/pc@efi_defconfig.yaml
new file mode 100644
index 0000000000..280f5dcee9
--- /dev/null
+++ b/test/x86/pc@efi_defconfig.yaml
@@ -0,0 +1,31 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: pc
+ cpu: Nehalem
+ memory: 1024M
+ kernel: barebox.efi
+ bios: OVMF.fd
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - pci
+ runner:
+ tuxmake_arch: x86_64
+ kconfig_add:
+ - CONFIG_DRIVER_SERIAL_NS16550=y
+ - CONFIG_CONSOLE_ACTIVATE_FIRST=y # avoid duplicate output
+ download:
+ OVMF.fd: /usr/share/qemu/OVMF.fd
+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
new file mode 100644
index 0000000000..dcb3f604c0
--- /dev/null
+++ b/test/x86/q35@efi_defconfig.yaml
@@ -0,0 +1,31 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: q35
+ cpu: Nehalem
+ memory: 1024M
+ kernel: barebox.efi
+ bios: OVMF.fd
+ extra_args: -global ICH9-LPC.noreboot=false
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - pci
+ runner:
+ tuxmake_arch: x86_64
+ kconfig_add:
+ - CONFIG_DRIVER_SERIAL_NS16550=y
+ - CONFIG_CONSOLE_ACTIVATE_FIRST=y # avoid duplicate output
+ download:
+ OVMF.fd: /usr/share/qemu/OVMF.fd
+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
new file mode 100644
index 0000000000..326fcbc689
--- /dev/null
+++ b/test/x86/virtio@efi_defconfig.yaml
@@ -0,0 +1,32 @@
+targets:
+ main:
+ drivers:
+ QEMUDriver:
+ qemu_bin: qemu
+ machine: pc
+ cpu: Nehalem
+ memory: 1024M
+ kernel: barebox.efi
+ bios: OVMF.fd
+ extra_args: ''
+ BareboxDriver:
+ prompt: 'barebox@[^:]+:[^ ]+ '
+ bootstring: 'commandline:'
+ BareboxTestStrategy: {}
+ features:
+ - virtio-pci
+ runner:
+ tuxmake_arch: x86_64
+ kconfig_add:
+ - test/kconfig/virtio-pci.cfg
+ - CONFIG_DRIVER_SERIAL_NS16550=y
+ - CONFIG_CONSOLE_ACTIVATE_FIRST=y # avoid duplicate output
+ download:
+ OVMF.fd: /usr/share/qemu/OVMF.fd
+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