* [PATCH 0/7] tests/functional: Convert the advent calendar tests
@ 2024-09-19 18:57 Thomas Huth
2024-09-19 18:57 ` [PATCH 1/7] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
Convert the advent calendar avocado tests to the new functional
framework. Since most tests are doing pretty much the same
(add a "-kernel" parameter and maybe "-initrd" and "-dtb", then
launch QEMU and wait for a string on the serial console), we
first introduce a helper function to shorten this repetive task.
Thomas Huth (7):
tests/functional/qemu_test: Add a function for launching kernels more
easily
tests/functional: Convert the vexpressa9 Avocado test
tests/functional: Convert the xtensa lx60 Avocado test
tests/functional: Convert the SPARCStation Avocado test
tests/functional: Convert the e500 ppc64 Avocado test
tests/functional: Convert the mac ppc Avocado tests
tests/functional: Convert the r2d sh4 Avocado test
MAINTAINERS | 7 ++
tests/avocado/boot_linux_console.py | 92 -----------------------
tests/functional/meson.build | 15 ++++
tests/functional/qemu_test/linuxkernel.py | 12 +++
tests/functional/test_arm_vexpress.py | 26 +++++++
tests/functional/test_ppc64_e500.py | 25 ++++++
tests/functional/test_ppc_mac.py | 38 ++++++++++
tests/functional/test_sh4_r2d.py | 31 ++++++++
tests/functional/test_sparc_sun4m.py | 25 ++++++
tests/functional/test_xtensa_lx60.py | 26 +++++++
10 files changed, 205 insertions(+), 92 deletions(-)
create mode 100755 tests/functional/test_arm_vexpress.py
create mode 100755 tests/functional/test_ppc64_e500.py
create mode 100755 tests/functional/test_ppc_mac.py
create mode 100755 tests/functional/test_sh4_r2d.py
create mode 100755 tests/functional/test_sparc_sun4m.py
create mode 100755 tests/functional/test_xtensa_lx60.py
--
2.46.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/7] tests/functional/qemu_test: Add a function for launching kernels more easily
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
@ 2024-09-19 18:57 ` Thomas Huth
2024-09-19 18:57 ` [PATCH 2/7] tests/functional: Convert the vexpressa9 Avocado test Thomas Huth
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
The task for launching a kernel is quite repetitive: Set the serial
console, set the -kernel and maybe -initrd and -dtb parameters,
launch the VM and then wait for the expected console output. So
it's easier in some tests to provide these steps via a separate
function.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/qemu_test/linuxkernel.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/functional/qemu_test/linuxkernel.py b/tests/functional/qemu_test/linuxkernel.py
index fdd5307629..2b5b9a5fda 100644
--- a/tests/functional/qemu_test/linuxkernel.py
+++ b/tests/functional/qemu_test/linuxkernel.py
@@ -17,6 +17,18 @@ def wait_for_console_pattern(self, success_message, vm=None):
failure_message='Kernel panic - not syncing',
vm=vm)
+ def launch_kernel(self, kernel, initrd=None, dtb=None, console_index=0,
+ wait_for=None):
+ self.vm.set_console(console_index=console_index)
+ self.vm.add_args('-kernel', kernel)
+ if initrd:
+ self.vm.add_args('-initrd', initrd)
+ if dtb:
+ self.vm.add_args('-dtb', dtb)
+ self.vm.launch()
+ if wait_for:
+ self.wait_for_console_pattern(wait_for)
+
def extract_from_deb(self, deb_path, path):
"""
Extracts a file from a deb package into the test workdir
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/7] tests/functional: Convert the vexpressa9 Avocado test
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
2024-09-19 18:57 ` [PATCH 1/7] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
@ 2024-09-19 18:57 ` Thomas Huth
2024-09-19 18:57 ` [PATCH 3/7] tests/functional: Convert the xtensa lx60 " Thomas Huth
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
Use the new launch_kernel function to convert this test in a simple way.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 1 +
tests/avocado/boot_linux_console.py | 9 ---------
tests/functional/meson.build | 1 +
tests/functional/test_arm_vexpress.py | 26 ++++++++++++++++++++++++++
4 files changed, 28 insertions(+), 9 deletions(-)
create mode 100755 tests/functional/test_arm_vexpress.py
diff --git a/MAINTAINERS b/MAINTAINERS
index ffacd60f40..7f7f4c2be6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1005,6 +1005,7 @@ S: Maintained
F: hw/arm/vexpress.c
F: hw/display/sii9022.c
F: docs/system/arm/vexpress.rst
+F: tests/functional/test_arm_vexpress.py
Versatile PB
M: Peter Maydell <peter.maydell@linaro.org>
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 6c50284986..7a776c2818 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -893,15 +893,6 @@ def do_test_advcal_2018(self, day, tar_hash, kernel_name, console=0):
self.vm.launch()
self.wait_for_console_pattern('QEMU advent calendar')
- def test_arm_vexpressa9(self):
- """
- :avocado: tags=arch:arm
- :avocado: tags=machine:vexpress-a9
- """
- tar_hash = '32b7677ce8b6f1471fb0059865f451169934245b'
- self.vm.add_args('-dtb', self.workdir + '/day16/vexpress-v2p-ca9.dtb')
- self.do_test_advcal_2018('16', tar_hash, 'winter.zImage')
-
def test_arm_ast2600_debian(self):
"""
:avocado: tags=arch:arm
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 8d5520349d..3fc1bb192d 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -50,6 +50,7 @@ tests_arm_system_thorough = [
'arm_canona1100',
'arm_integratorcp',
'arm_raspi2',
+ 'arm_vexpress',
]
tests_arm_linuxuser_thorough = [
diff --git a/tests/functional/test_arm_vexpress.py b/tests/functional/test_arm_vexpress.py
new file mode 100755
index 0000000000..cc6015112b
--- /dev/null
+++ b/tests/functional/test_arm_vexpress.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on an versatile express machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class VExpressTest(LinuxKernelTest):
+
+ ASSET_DAY16 = Asset(
+ 'https://www.qemu-advent-calendar.org/2018/download/day16.tar.xz',
+ '63311adb2d4c4e7a73214a86d29988add87266a909719c56acfadd026b4110a7')
+
+ def test_arm_vexpressa9(self):
+ self.set_machine('vexpress-a9')
+ file_path = self.ASSET_DAY16.fetch()
+ archive_extract(file_path, self.workdir)
+ self.launch_kernel(self.workdir + '/day16/winter.zImage',
+ dtb=self.workdir + '/day16/vexpress-v2p-ca9.dtb',
+ wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+ LinuxKernelTest.main()
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/7] tests/functional: Convert the xtensa lx60 Avocado test
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
2024-09-19 18:57 ` [PATCH 1/7] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
2024-09-19 18:57 ` [PATCH 2/7] tests/functional: Convert the vexpressa9 Avocado test Thomas Huth
@ 2024-09-19 18:57 ` Thomas Huth
2024-09-19 18:57 ` [PATCH 4/7] tests/functional: Convert the SPARCStation " Thomas Huth
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
Use the new launch_kernel function to convert this test in a simple way.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 1 +
tests/avocado/boot_linux_console.py | 9 ---------
tests/functional/meson.build | 4 ++++
tests/functional/test_xtensa_lx60.py | 26 ++++++++++++++++++++++++++
4 files changed, 31 insertions(+), 9 deletions(-)
create mode 100755 tests/functional/test_xtensa_lx60.py
diff --git a/MAINTAINERS b/MAINTAINERS
index 7f7f4c2be6..a75d6ba7d2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1915,6 +1915,7 @@ S: Maintained
F: hw/xtensa/xtfpga.c
F: hw/net/opencores_eth.c
F: include/hw/xtensa/mx_pic.h
+F: tests/functional/test_xtensa_lx60.py
Devices
-------
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 7a776c2818..cf58499c84 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -1027,12 +1027,3 @@ def test_sparc_ss20(self):
"""
tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
self.do_test_advcal_2018('11', tar_hash, 'zImage.elf')
-
- def test_xtensa_lx60(self):
- """
- :avocado: tags=arch:xtensa
- :avocado: tags=machine:lx60
- :avocado: tags=cpu:dc233c
- """
- tar_hash = '49e88d9933742f0164b60839886c9739cb7a0d34'
- self.do_test_advcal_2018('02', tar_hash, 'santas-sleigh-ride.elf')
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 3fc1bb192d..8fd852f4ab 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -145,6 +145,10 @@ tests_x86_64_system_thorough = [
'virtio_gpu',
]
+tests_xtensa_system_thorough = [
+ 'xtensa_lx60',
+]
+
precache_all = []
foreach speed : ['quick', 'thorough']
foreach dir : target_dirs
diff --git a/tests/functional/test_xtensa_lx60.py b/tests/functional/test_xtensa_lx60.py
new file mode 100755
index 0000000000..8ce5206a4f
--- /dev/null
+++ b/tests/functional/test_xtensa_lx60.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on an xtensa lx650 machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class XTensaLX60Test(LinuxKernelTest):
+
+ ASSET_DAY02 = Asset(
+ 'https://www.qemu-advent-calendar.org/2018/download/day02.tar.xz',
+ '68ff07f9b3fd3df36d015eb46299ba44748e94bfbb2d5295fddc1a8d4a9fd324')
+
+ def test_xtensa_lx60(self):
+ self.set_machine('lx60')
+ self.cpu = 'dc233c'
+ file_path = self.ASSET_DAY02.fetch()
+ archive_extract(file_path, self.workdir)
+ self.launch_kernel(self.workdir + '/day02/santas-sleigh-ride.elf',
+ wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+ LinuxKernelTest.main()
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/7] tests/functional: Convert the SPARCStation Avocado test
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
` (2 preceding siblings ...)
2024-09-19 18:57 ` [PATCH 3/7] tests/functional: Convert the xtensa lx60 " Thomas Huth
@ 2024-09-19 18:57 ` Thomas Huth
2024-09-22 12:44 ` Mark Cave-Ayland
2024-09-19 18:57 ` [PATCH 5/7] tests/functional: Convert the e500 ppc64 " Thomas Huth
` (3 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
Use the new launch_kernel function to convert this test in a simple way.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 1 +
tests/avocado/boot_linux_console.py | 8 --------
tests/functional/meson.build | 4 ++++
tests/functional/test_sparc_sun4m.py | 25 +++++++++++++++++++++++++
4 files changed, 30 insertions(+), 8 deletions(-)
create mode 100755 tests/functional/test_sparc_sun4m.py
diff --git a/MAINTAINERS b/MAINTAINERS
index a75d6ba7d2..b85a3fc529 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1693,6 +1693,7 @@ F: include/hw/nvram/sun_nvram.h
F: include/hw/sparc/sparc32_dma.h
F: include/hw/sparc/sun4m_iommu.h
F: pc-bios/openbios-sparc32
+F: tests/functional/test_sparc_sun4m.py
Sun4u
M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index cf58499c84..900af67412 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -1019,11 +1019,3 @@ def test_sh4_r2d(self):
tar_hash = 'fe06a4fd8ccbf2e27928d64472939d47829d4c7e'
self.vm.add_args('-append', 'console=ttySC1')
self.do_test_advcal_2018('09', tar_hash, 'zImage', console=1)
-
- def test_sparc_ss20(self):
- """
- :avocado: tags=arch:sparc
- :avocado: tags=machine:SS-20
- """
- tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
- self.do_test_advcal_2018('11', tar_hash, 'zImage.elf')
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 8fd852f4ab..8aacd15cf3 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -125,6 +125,10 @@ tests_s390x_system_thorough = [
's390x_topology',
]
+tests_sparc_system_thorough = [
+ 'sparc_sun4m',
+]
+
tests_sparc64_system_thorough = [
'sparc64_sun4u',
]
diff --git a/tests/functional/test_sparc_sun4m.py b/tests/functional/test_sparc_sun4m.py
new file mode 100755
index 0000000000..b334375820
--- /dev/null
+++ b/tests/functional/test_sparc_sun4m.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on a sparc sun4m machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class Sun4mTest(LinuxKernelTest):
+
+ ASSET_DAY11 = Asset(
+ 'https://www.qemu-advent-calendar.org/2018/download/day11.tar.xz',
+ 'c776533ba756bf4dd3f1fc4c024fb50ef0d853e05c5f5ddf0900a32d1eaa49e0')
+
+ def test_sparc_ss20(self):
+ self.set_machine('SS-20')
+ file_path = self.ASSET_DAY11.fetch()
+ archive_extract(file_path, self.workdir)
+ self.launch_kernel(self.workdir + '/day11/zImage.elf',
+ wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+ LinuxKernelTest.main()
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/7] tests/functional: Convert the e500 ppc64 Avocado test
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
` (3 preceding siblings ...)
2024-09-19 18:57 ` [PATCH 4/7] tests/functional: Convert the SPARCStation " Thomas Huth
@ 2024-09-19 18:57 ` Thomas Huth
2024-09-19 18:57 ` [PATCH 6/7] tests/functional: Convert the mac ppc Avocado tests Thomas Huth
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
Use the new launch_kernel function to convert this test in a simple way.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 1 +
tests/avocado/boot_linux_console.py | 11 -----------
tests/functional/meson.build | 1 +
tests/functional/test_ppc64_e500.py | 25 +++++++++++++++++++++++++
4 files changed, 27 insertions(+), 11 deletions(-)
create mode 100755 tests/functional/test_ppc64_e500.py
diff --git a/MAINTAINERS b/MAINTAINERS
index b85a3fc529..3dd80a0138 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1445,6 +1445,7 @@ F: pc-bios/u-boot.e500
F: hw/intc/openpic_kvm.c
F: include/hw/ppc/openpic_kvm.h
F: docs/system/ppc/ppce500.rst
+F: tests/functional/test_ppc64_e500.py
mpc8544ds
L: qemu-ppc@nongnu.org
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 900af67412..344c7835a2 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -918,17 +918,6 @@ def test_arm_ast2600_debian(self):
self.wait_for_console_pattern("SMP: Total of 2 processors activated")
self.wait_for_console_pattern("No filesystem could mount root")
- def test_ppc64_e500(self):
- """
- :avocado: tags=arch:ppc64
- :avocado: tags=machine:ppce500
- :avocado: tags=cpu:e5500
- :avocado: tags=accel:tcg
- """
- self.require_accelerator("tcg")
- tar_hash = '6951d86d644b302898da2fd701739c9406527fe1'
- self.do_test_advcal_2018('19', tar_hash, 'uImage')
-
def do_test_ppc64_powernv(self, proc):
self.require_accelerator("tcg")
images_url = ('https://github.com/open-power/op-build/releases/download/v2.7/')
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 8aacd15cf3..bc33332313 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -111,6 +111,7 @@ tests_ppc_system_thorough = [
]
tests_ppc64_system_thorough = [
+ 'ppc64_e500',
'ppc64_hv',
'ppc64_powernv',
'ppc64_pseries',
diff --git a/tests/functional/test_ppc64_e500.py b/tests/functional/test_ppc64_e500.py
new file mode 100755
index 0000000000..3558ae0c8c
--- /dev/null
+++ b/tests/functional/test_ppc64_e500.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+#
+# Boot a Linux kernel on a e500 ppc64 machine and check the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class E500Test(LinuxKernelTest):
+
+ ASSET_DAY19 = Asset(
+ 'https://www.qemu-advent-calendar.org/2018/download/day19.tar.xz',
+ '20b1bb5a8488c664defbb5d283addc91a05335a936c63b3f5ff7eee74b725755')
+
+ def test_ppc64_e500(self):
+ self.set_machine('ppce500')
+ self.cpu = 'e5500'
+ file_path = self.ASSET_DAY19.fetch()
+ archive_extract(file_path, self.workdir)
+ self.launch_kernel(self.workdir + '/day19/uImage',
+ wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+ LinuxKernelTest.main()
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/7] tests/functional: Convert the mac ppc Avocado tests
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
` (4 preceding siblings ...)
2024-09-19 18:57 ` [PATCH 5/7] tests/functional: Convert the e500 ppc64 " Thomas Huth
@ 2024-09-19 18:57 ` Thomas Huth
2024-09-22 12:45 ` Mark Cave-Ayland
2024-09-19 18:57 ` [PATCH 7/7] tests/functional: Convert the r2d sh4 Avocado test Thomas Huth
2024-09-22 4:51 ` [PATCH 0/7] tests/functional: Convert the advent calendar tests Richard Henderson
7 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
The g3beige and mac99 tests use the same asset, so put them together
in a new test_ppc_mac.py file.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 2 ++
tests/avocado/boot_linux_console.py | 30 -----------------------
tests/functional/meson.build | 1 +
tests/functional/test_ppc_mac.py | 38 +++++++++++++++++++++++++++++
4 files changed, 41 insertions(+), 30 deletions(-)
create mode 100755 tests/functional/test_ppc_mac.py
diff --git a/MAINTAINERS b/MAINTAINERS
index 3dd80a0138..63eb306d6e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1474,6 +1474,7 @@ F: include/hw/ppc/mac_dbdma.h
F: include/hw/pci-host/uninorth.h
F: include/hw/input/adb*
F: pc-bios/qemu_vga.ndrv
+F: tests/functional/test_ppc_mac.py
Old World (g3beige)
M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
@@ -1489,6 +1490,7 @@ F: include/hw/intc/heathrow_pic.h
F: include/hw/input/adb*
F: include/hw/pci-host/grackle.h
F: pc-bios/qemu_vga.ndrv
+F: tests/functional/test_ppc_mac.py
PReP
M: Hervé Poussineau <hpoussin@reactos.org>
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 344c7835a2..f5dc9e9cfa 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -965,36 +965,6 @@ def test_ppc_powernv10(self):
"""
self.do_test_ppc64_powernv('P10')
- def test_ppc_g3beige(self):
- """
- :avocado: tags=arch:ppc
- :avocado: tags=machine:g3beige
- :avocado: tags=accel:tcg
- """
- # TODO: g3beige works with kvm_pr but we don't have a
- # reliable way ATM (e.g. looking at /proc/modules) to detect
- # whether we're running kvm_hv or kvm_pr. For now let's
- # disable this test if we don't have TCG support.
- self.require_accelerator("tcg")
- tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
- self.vm.add_args('-M', 'graphics=off')
- self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
-
- def test_ppc_mac99(self):
- """
- :avocado: tags=arch:ppc
- :avocado: tags=machine:mac99
- :avocado: tags=accel:tcg
- """
- # TODO: mac99 works with kvm_pr but we don't have a
- # reliable way ATM (e.g. looking at /proc/modules) to detect
- # whether we're running kvm_hv or kvm_pr. For now let's
- # disable this test if we don't have TCG support.
- self.require_accelerator("tcg")
- tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
- self.vm.add_args('-M', 'graphics=off')
- self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
-
# This test has a 6-10% failure rate on various hosts that look
# like issues with a buggy kernel. As a result we don't want it
# gating releases on Gitlab.
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index bc33332313..449c6a95ea 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -106,6 +106,7 @@ tests_ppc_system_thorough = [
'ppc_40p',
'ppc_amiga',
'ppc_bamboo',
+ 'ppc_mac',
'ppc_mpc8544ds',
'ppc_virtex_ml507',
]
diff --git a/tests/functional/test_ppc_mac.py b/tests/functional/test_ppc_mac.py
new file mode 100755
index 0000000000..a6b1ca2d4c
--- /dev/null
+++ b/tests/functional/test_ppc_mac.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+#
+# Boot Linux kernel on a mac99 and g3beige ppc machine and check the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class MacTest(LinuxKernelTest):
+
+ ASSET_DAY15 = Asset(
+ 'https://www.qemu-advent-calendar.org/2018/download/day15.tar.xz',
+ '03e0757c131d2959decf293a3572d3b96c5a53587165bf05ce41b2818a2bccd5')
+
+ def do_day15_test(self):
+ # mac99 also works with kvm_pr but we don't have a reliable way at
+ # the moment (e.g. by looking at /proc/modules) to detect whether
+ # we're running kvm_hv or kvm_pr. For now let's disable this test
+ # if we don't have TCG support.
+ self.require_accelerator("tcg")
+
+ file_path = self.ASSET_DAY15.fetch()
+ archive_extract(file_path, self.workdir)
+ self.vm.add_args('-M', 'graphics=off')
+ self.launch_kernel(self.workdir + '/day15/invaders.elf',
+ wait_for='QEMU advent calendar')
+
+ def test_ppc_g3beige(self):
+ self.set_machine('g3beige')
+ self.do_day15_test()
+
+ def test_ppc_mac99(self):
+ self.set_machine('mac99')
+ self.do_day15_test()
+
+if __name__ == '__main__':
+ LinuxKernelTest.main()
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/7] tests/functional: Convert the r2d sh4 Avocado test
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
` (5 preceding siblings ...)
2024-09-19 18:57 ` [PATCH 6/7] tests/functional: Convert the mac ppc Avocado tests Thomas Huth
@ 2024-09-19 18:57 ` Thomas Huth
2024-09-22 4:51 ` [PATCH 0/7] tests/functional: Convert the advent calendar tests Richard Henderson
7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-09-19 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
This is the last test that is using the do_test_advcal_2018()
function, so we can now remove that function from boot_linux_console.py,
too.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 1 +
tests/avocado/boot_linux_console.py | 25 -----------------------
tests/functional/meson.build | 4 ++++
tests/functional/test_sh4_r2d.py | 31 +++++++++++++++++++++++++++++
4 files changed, 36 insertions(+), 25 deletions(-)
create mode 100755 tests/functional/test_sh4_r2d.py
diff --git a/MAINTAINERS b/MAINTAINERS
index 63eb306d6e..62f5255f40 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1679,6 +1679,7 @@ F: hw/pci-host/sh_pci.c
F: hw/timer/sh_timer.c
F: include/hw/sh4/sh_intc.h
F: include/hw/timer/tmu012.h
+F: tests/functional/test_sh4_r2d.py
SPARC Machines
--------------
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index f5dc9e9cfa..759fda9cc8 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -882,17 +882,6 @@ def test_arm_orangepi_uboot_netbsd9(self):
# Wait for user-space
wait_for_console_pattern(self, 'Starting root file system check')
- def do_test_advcal_2018(self, day, tar_hash, kernel_name, console=0):
- tar_url = ('https://qemu-advcal.gitlab.io'
- '/qac-best-of-multiarch/download/day' + day + '.tar.xz')
- file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
- archive.extract(file_path, self.workdir)
- self.vm.set_console(console_index=console)
- self.vm.add_args('-kernel',
- self.workdir + '/day' + day + '/' + kernel_name)
- self.vm.launch()
- self.wait_for_console_pattern('QEMU advent calendar')
-
def test_arm_ast2600_debian(self):
"""
:avocado: tags=arch:arm
@@ -964,17 +953,3 @@ def test_ppc_powernv10(self):
:avocado: tags=accel:tcg
"""
self.do_test_ppc64_powernv('P10')
-
- # This test has a 6-10% failure rate on various hosts that look
- # like issues with a buggy kernel. As a result we don't want it
- # gating releases on Gitlab.
- @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
- def test_sh4_r2d(self):
- """
- :avocado: tags=arch:sh4
- :avocado: tags=machine:r2d
- :avocado: tags=flaky
- """
- tar_hash = 'fe06a4fd8ccbf2e27928d64472939d47829d4c7e'
- self.vm.add_args('-append', 'console=ttySC1')
- self.do_test_advcal_2018('09', tar_hash, 'zImage', console=1)
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 449c6a95ea..56a541530f 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -127,6 +127,10 @@ tests_s390x_system_thorough = [
's390x_topology',
]
+tests_sh4_system_thorough = [
+ 'sh4_r2d',
+]
+
tests_sparc_system_thorough = [
'sparc_sun4m',
]
diff --git a/tests/functional/test_sh4_r2d.py b/tests/functional/test_sh4_r2d.py
new file mode 100755
index 0000000000..5fe8cf9f8d
--- /dev/null
+++ b/tests/functional/test_sh4_r2d.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+#
+# Boot a Linux kernel on a r2d sh4 machine and check the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+from unittest import skipUnless
+
+class R2dTest(LinuxKernelTest):
+
+ ASSET_DAY09 = Asset(
+ 'https://www.qemu-advent-calendar.org/2018/download/day09.tar.xz',
+ 'a61b44d2630a739d1380cc4ff4b80981d47ccfd5992f1484ccf48322c35f09ac')
+
+ # This test has a 6-10% failure rate on various hosts that look
+ # like issues with a buggy kernel.
+ @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable')
+ def test_r2d(self):
+ self.set_machine('r2d')
+ file_path = self.ASSET_DAY09.fetch()
+ archive_extract(file_path, self.workdir)
+ self.vm.add_args('-append', 'console=ttySC1')
+ self.launch_kernel(self.workdir + '/day09/zImage', console_index=1,
+ wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+ LinuxKernelTest.main()
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/7] tests/functional: Convert the advent calendar tests
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
` (6 preceding siblings ...)
2024-09-19 18:57 ` [PATCH 7/7] tests/functional: Convert the r2d sh4 Avocado test Thomas Huth
@ 2024-09-22 4:51 ` Richard Henderson
7 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2024-09-22 4:51 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Mark Cave-Ayland,
Yoshinori Sato, Magnus Damm, Max Filippov
On 9/19/24 20:57, Thomas Huth wrote:
> Thomas Huth (7):
> tests/functional/qemu_test: Add a function for launching kernels more
> easily
> tests/functional: Convert the vexpressa9 Avocado test
> tests/functional: Convert the xtensa lx60 Avocado test
> tests/functional: Convert the SPARCStation Avocado test
> tests/functional: Convert the e500 ppc64 Avocado test
> tests/functional: Convert the mac ppc Avocado tests
> tests/functional: Convert the r2d sh4 Avocado test
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/7] tests/functional: Convert the SPARCStation Avocado test
2024-09-19 18:57 ` [PATCH 4/7] tests/functional: Convert the SPARCStation " Thomas Huth
@ 2024-09-22 12:44 ` Mark Cave-Ayland
0 siblings, 0 replies; 11+ messages in thread
From: Mark Cave-Ayland @ 2024-09-22 12:44 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Yoshinori Sato,
Magnus Damm, Max Filippov
On 19/09/2024 19:57, Thomas Huth wrote:
> Use the new launch_kernel function to convert this test in a simple way.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> MAINTAINERS | 1 +
> tests/avocado/boot_linux_console.py | 8 --------
> tests/functional/meson.build | 4 ++++
> tests/functional/test_sparc_sun4m.py | 25 +++++++++++++++++++++++++
> 4 files changed, 30 insertions(+), 8 deletions(-)
> create mode 100755 tests/functional/test_sparc_sun4m.py
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a75d6ba7d2..b85a3fc529 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1693,6 +1693,7 @@ F: include/hw/nvram/sun_nvram.h
> F: include/hw/sparc/sparc32_dma.h
> F: include/hw/sparc/sun4m_iommu.h
> F: pc-bios/openbios-sparc32
> +F: tests/functional/test_sparc_sun4m.py
>
> Sun4u
> M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
> index cf58499c84..900af67412 100644
> --- a/tests/avocado/boot_linux_console.py
> +++ b/tests/avocado/boot_linux_console.py
> @@ -1019,11 +1019,3 @@ def test_sh4_r2d(self):
> tar_hash = 'fe06a4fd8ccbf2e27928d64472939d47829d4c7e'
> self.vm.add_args('-append', 'console=ttySC1')
> self.do_test_advcal_2018('09', tar_hash, 'zImage', console=1)
> -
> - def test_sparc_ss20(self):
> - """
> - :avocado: tags=arch:sparc
> - :avocado: tags=machine:SS-20
> - """
> - tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
> - self.do_test_advcal_2018('11', tar_hash, 'zImage.elf')
> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
> index 8fd852f4ab..8aacd15cf3 100644
> --- a/tests/functional/meson.build
> +++ b/tests/functional/meson.build
> @@ -125,6 +125,10 @@ tests_s390x_system_thorough = [
> 's390x_topology',
> ]
>
> +tests_sparc_system_thorough = [
> + 'sparc_sun4m',
> +]
> +
> tests_sparc64_system_thorough = [
> 'sparc64_sun4u',
> ]
> diff --git a/tests/functional/test_sparc_sun4m.py b/tests/functional/test_sparc_sun4m.py
> new file mode 100755
> index 0000000000..b334375820
> --- /dev/null
> +++ b/tests/functional/test_sparc_sun4m.py
> @@ -0,0 +1,25 @@
> +#!/usr/bin/env python3
> +#
> +# Functional test that boots a Linux kernel on a sparc sun4m machine
> +# and checks the console
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +from qemu_test import LinuxKernelTest, Asset
> +from qemu_test.utils import archive_extract
> +
> +class Sun4mTest(LinuxKernelTest):
> +
> + ASSET_DAY11 = Asset(
> + 'https://www.qemu-advent-calendar.org/2018/download/day11.tar.xz',
> + 'c776533ba756bf4dd3f1fc4c024fb50ef0d853e05c5f5ddf0900a32d1eaa49e0')
> +
> + def test_sparc_ss20(self):
> + self.set_machine('SS-20')
> + file_path = self.ASSET_DAY11.fetch()
> + archive_extract(file_path, self.workdir)
> + self.launch_kernel(self.workdir + '/day11/zImage.elf',
> + wait_for='QEMU advent calendar')
> +
> +if __name__ == '__main__':
> + LinuxKernelTest.main()
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
ATB,
Mark.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 6/7] tests/functional: Convert the mac ppc Avocado tests
2024-09-19 18:57 ` [PATCH 6/7] tests/functional: Convert the mac ppc Avocado tests Thomas Huth
@ 2024-09-22 12:45 ` Mark Cave-Ayland
0 siblings, 0 replies; 11+ messages in thread
From: Mark Cave-Ayland @ 2024-09-22 12:45 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Peter Maydell, Philippe Mathieu-Daudé, Yoshinori Sato,
Magnus Damm, Max Filippov
On 19/09/2024 19:57, Thomas Huth wrote:
> The g3beige and mac99 tests use the same asset, so put them together
> in a new test_ppc_mac.py file.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> MAINTAINERS | 2 ++
> tests/avocado/boot_linux_console.py | 30 -----------------------
> tests/functional/meson.build | 1 +
> tests/functional/test_ppc_mac.py | 38 +++++++++++++++++++++++++++++
> 4 files changed, 41 insertions(+), 30 deletions(-)
> create mode 100755 tests/functional/test_ppc_mac.py
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3dd80a0138..63eb306d6e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1474,6 +1474,7 @@ F: include/hw/ppc/mac_dbdma.h
> F: include/hw/pci-host/uninorth.h
> F: include/hw/input/adb*
> F: pc-bios/qemu_vga.ndrv
> +F: tests/functional/test_ppc_mac.py
>
> Old World (g3beige)
> M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> @@ -1489,6 +1490,7 @@ F: include/hw/intc/heathrow_pic.h
> F: include/hw/input/adb*
> F: include/hw/pci-host/grackle.h
> F: pc-bios/qemu_vga.ndrv
> +F: tests/functional/test_ppc_mac.py
>
> PReP
> M: Hervé Poussineau <hpoussin@reactos.org>
> diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
> index 344c7835a2..f5dc9e9cfa 100644
> --- a/tests/avocado/boot_linux_console.py
> +++ b/tests/avocado/boot_linux_console.py
> @@ -965,36 +965,6 @@ def test_ppc_powernv10(self):
> """
> self.do_test_ppc64_powernv('P10')
>
> - def test_ppc_g3beige(self):
> - """
> - :avocado: tags=arch:ppc
> - :avocado: tags=machine:g3beige
> - :avocado: tags=accel:tcg
> - """
> - # TODO: g3beige works with kvm_pr but we don't have a
> - # reliable way ATM (e.g. looking at /proc/modules) to detect
> - # whether we're running kvm_hv or kvm_pr. For now let's
> - # disable this test if we don't have TCG support.
> - self.require_accelerator("tcg")
> - tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
> - self.vm.add_args('-M', 'graphics=off')
> - self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
> -
> - def test_ppc_mac99(self):
> - """
> - :avocado: tags=arch:ppc
> - :avocado: tags=machine:mac99
> - :avocado: tags=accel:tcg
> - """
> - # TODO: mac99 works with kvm_pr but we don't have a
> - # reliable way ATM (e.g. looking at /proc/modules) to detect
> - # whether we're running kvm_hv or kvm_pr. For now let's
> - # disable this test if we don't have TCG support.
> - self.require_accelerator("tcg")
> - tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
> - self.vm.add_args('-M', 'graphics=off')
> - self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
> -
> # This test has a 6-10% failure rate on various hosts that look
> # like issues with a buggy kernel. As a result we don't want it
> # gating releases on Gitlab.
> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
> index bc33332313..449c6a95ea 100644
> --- a/tests/functional/meson.build
> +++ b/tests/functional/meson.build
> @@ -106,6 +106,7 @@ tests_ppc_system_thorough = [
> 'ppc_40p',
> 'ppc_amiga',
> 'ppc_bamboo',
> + 'ppc_mac',
> 'ppc_mpc8544ds',
> 'ppc_virtex_ml507',
> ]
> diff --git a/tests/functional/test_ppc_mac.py b/tests/functional/test_ppc_mac.py
> new file mode 100755
> index 0000000000..a6b1ca2d4c
> --- /dev/null
> +++ b/tests/functional/test_ppc_mac.py
> @@ -0,0 +1,38 @@
> +#!/usr/bin/env python3
> +#
> +# Boot Linux kernel on a mac99 and g3beige ppc machine and check the console
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +from qemu_test import LinuxKernelTest, Asset
> +from qemu_test.utils import archive_extract
> +
> +class MacTest(LinuxKernelTest):
> +
> + ASSET_DAY15 = Asset(
> + 'https://www.qemu-advent-calendar.org/2018/download/day15.tar.xz',
> + '03e0757c131d2959decf293a3572d3b96c5a53587165bf05ce41b2818a2bccd5')
> +
> + def do_day15_test(self):
> + # mac99 also works with kvm_pr but we don't have a reliable way at
> + # the moment (e.g. by looking at /proc/modules) to detect whether
> + # we're running kvm_hv or kvm_pr. For now let's disable this test
> + # if we don't have TCG support.
> + self.require_accelerator("tcg")
> +
> + file_path = self.ASSET_DAY15.fetch()
> + archive_extract(file_path, self.workdir)
> + self.vm.add_args('-M', 'graphics=off')
> + self.launch_kernel(self.workdir + '/day15/invaders.elf',
> + wait_for='QEMU advent calendar')
> +
> + def test_ppc_g3beige(self):
> + self.set_machine('g3beige')
> + self.do_day15_test()
> +
> + def test_ppc_mac99(self):
> + self.set_machine('mac99')
> + self.do_day15_test()
> +
> +if __name__ == '__main__':
> + LinuxKernelTest.main()
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
ATB,
Mark.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-09-22 12:45 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-19 18:57 [PATCH 0/7] tests/functional: Convert the advent calendar tests Thomas Huth
2024-09-19 18:57 ` [PATCH 1/7] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
2024-09-19 18:57 ` [PATCH 2/7] tests/functional: Convert the vexpressa9 Avocado test Thomas Huth
2024-09-19 18:57 ` [PATCH 3/7] tests/functional: Convert the xtensa lx60 " Thomas Huth
2024-09-19 18:57 ` [PATCH 4/7] tests/functional: Convert the SPARCStation " Thomas Huth
2024-09-22 12:44 ` Mark Cave-Ayland
2024-09-19 18:57 ` [PATCH 5/7] tests/functional: Convert the e500 ppc64 " Thomas Huth
2024-09-19 18:57 ` [PATCH 6/7] tests/functional: Convert the mac ppc Avocado tests Thomas Huth
2024-09-22 12:45 ` Mark Cave-Ayland
2024-09-19 18:57 ` [PATCH 7/7] tests/functional: Convert the r2d sh4 Avocado test Thomas Huth
2024-09-22 4:51 ` [PATCH 0/7] tests/functional: Convert the advent calendar tests Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).