aboutsummaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2025-08-19 13:23:39 +0200
committerThomas Huth <thuth@redhat.com>2025-08-27 09:46:55 +0200
commitb19c560e4ac730799f45730020fae63e4727a8e0 (patch)
tree37109112b9d711323a2c212ae20abd206c904442 /tests/functional
parent9845740a162f2d9a4c852068155e94f1a3c487f9 (diff)
downloadqemu-b19c560e4ac730799f45730020fae63e4727a8e0.zip
qemu-b19c560e4ac730799f45730020fae63e4727a8e0.tar.gz
qemu-b19c560e4ac730799f45730020fae63e4727a8e0.tar.bz2
tests/functional: Rework the multiprocess test to have target-specific files
We are going to move the tests for each target into separate subdirectories. The multiprocess test currently contains code for both, x86 and aarch64, so it does not quite fit into this scheme. Rework the test to have a common test class, and target specific files with a target specific class, so that this will fit better into the new scheme. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250819112403.432587-3-thuth@redhat.com>
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/meson.build4
-rw-r--r--[-rwxr-xr-x]tests/functional/multiprocess.py (renamed from tests/functional/test_multiprocess.py)40
-rwxr-xr-xtests/functional/test_aarch64_multiprocess.py31
-rwxr-xr-xtests/functional/test_x86_64_multiprocess.py31
4 files changed, 66 insertions, 40 deletions
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index c32436d..38ae0d6 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -90,6 +90,7 @@ tests_aarch64_system_thorough = [
'aarch64_hotplug_pci',
'aarch64_imx8mp_evk',
'aarch64_kvm',
+ 'aarch64_multiprocess',
'aarch64_raspi3',
'aarch64_raspi4',
'aarch64_replay',
@@ -106,7 +107,6 @@ tests_aarch64_system_thorough = [
'aarch64_virt_gpu',
'aarch64_xen',
'aarch64_xlnx_versal',
- 'multiprocess',
]
tests_alpha_system_quick = [
@@ -332,7 +332,7 @@ tests_x86_64_system_thorough = [
'acpi_bits',
'intel_iommu',
'linux_initrd',
- 'multiprocess',
+ 'x86_64_multiprocess',
'netdev_ethtool',
'virtio_balloon',
'virtio_gpu',
diff --git a/tests/functional/test_multiprocess.py b/tests/functional/multiprocess.py
index 92d5207..6a06c1e 100755..100644
--- a/tests/functional/test_multiprocess.py
+++ b/tests/functional/multiprocess.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0-or-later
#
# Test for multiprocess qemu
#
@@ -9,33 +9,13 @@
import os
import socket
-from qemu_test import QemuSystemTest, Asset, wait_for_console_pattern
+from qemu_test import QemuSystemTest, wait_for_console_pattern
from qemu_test import exec_command, exec_command_and_wait_for_pattern
class Multiprocess(QemuSystemTest):
KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
- ASSET_KERNEL_X86 = Asset(
- ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
- '/releases/31/Everything/x86_64/os/images/pxeboot/vmlinuz'),
- 'd4738d03dbbe083ca610d0821d0a8f1488bebbdccef54ce33e3adb35fda00129')
-
- ASSET_INITRD_X86 = Asset(
- ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
- '/releases/31/Everything/x86_64/os/images/pxeboot/initrd.img'),
- '3b6cb5c91a14c42e2f61520f1689264d865e772a1f0069e660a800d31dd61fb9')
-
- ASSET_KERNEL_AARCH64 = Asset(
- ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
- '/releases/31/Everything/aarch64/os/images/pxeboot/vmlinuz'),
- '3ae07fcafbfc8e4abeb693035a74fe10698faae15e9ccd48882a9167800c1527')
-
- ASSET_INITRD_AARCH64 = Asset(
- ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
- '/releases/31/Everything/aarch64/os/images/pxeboot/initrd.img'),
- '9fd230cab10b1dafea41cf00150e6669d37051fad133bd618d2130284e16d526')
-
def do_test(self, kernel_asset, initrd_asset,
kernel_command_line, machine_type):
"""Main test method"""
@@ -85,19 +65,3 @@ class Multiprocess(QemuSystemTest):
proxy_sock.close()
remote_sock.close()
-
- def test_multiprocess(self):
- kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
- if self.arch == 'x86_64':
- kernel_command_line += 'console=ttyS0 rdinit=/bin/bash'
- self.do_test(self.ASSET_KERNEL_X86, self.ASSET_INITRD_X86,
- kernel_command_line, 'pc')
- elif self.arch == 'aarch64':
- kernel_command_line += 'rdinit=/bin/bash console=ttyAMA0'
- self.do_test(self.ASSET_KERNEL_AARCH64, self.ASSET_INITRD_AARCH64,
- kernel_command_line, 'virt,gic-version=3')
- else:
- assert False
-
-if __name__ == '__main__':
- QemuSystemTest.main()
diff --git a/tests/functional/test_aarch64_multiprocess.py b/tests/functional/test_aarch64_multiprocess.py
new file mode 100755
index 0000000..1c6e45e
--- /dev/null
+++ b/tests/functional/test_aarch64_multiprocess.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Test for multiprocess qemu on aarch64
+
+from multiprocess import Multiprocess
+from qemu_test import Asset
+
+
+class Aarch64Multiprocess(Multiprocess):
+
+ ASSET_KERNEL_AARCH64 = Asset(
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
+ '/releases/31/Everything/aarch64/os/images/pxeboot/vmlinuz'),
+ '3ae07fcafbfc8e4abeb693035a74fe10698faae15e9ccd48882a9167800c1527')
+
+ ASSET_INITRD_AARCH64 = Asset(
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
+ '/releases/31/Everything/aarch64/os/images/pxeboot/initrd.img'),
+ '9fd230cab10b1dafea41cf00150e6669d37051fad133bd618d2130284e16d526')
+
+ def test_multiprocess(self):
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+ 'rdinit=/bin/bash console=ttyAMA0')
+ self.do_test(self.ASSET_KERNEL_AARCH64, self.ASSET_INITRD_AARCH64,
+ kernel_command_line, 'virt,gic-version=3')
+
+
+if __name__ == '__main__':
+ Multiprocess.main()
diff --git a/tests/functional/test_x86_64_multiprocess.py b/tests/functional/test_x86_64_multiprocess.py
new file mode 100755
index 0000000..756629d
--- /dev/null
+++ b/tests/functional/test_x86_64_multiprocess.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Test for multiprocess qemu on x86
+
+from multiprocess import Multiprocess
+from qemu_test import Asset
+
+
+class X86Multiprocess(Multiprocess):
+
+ ASSET_KERNEL_X86 = Asset(
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
+ '/releases/31/Everything/x86_64/os/images/pxeboot/vmlinuz'),
+ 'd4738d03dbbe083ca610d0821d0a8f1488bebbdccef54ce33e3adb35fda00129')
+
+ ASSET_INITRD_X86 = Asset(
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux'
+ '/releases/31/Everything/x86_64/os/images/pxeboot/initrd.img'),
+ '3b6cb5c91a14c42e2f61520f1689264d865e772a1f0069e660a800d31dd61fb9')
+
+ def test_multiprocess(self):
+ kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
+ 'console=ttyS0 rdinit=/bin/bash')
+ self.do_test(self.ASSET_KERNEL_X86, self.ASSET_INITRD_X86,
+ kernel_command_line, 'pc')
+
+
+if __name__ == '__main__':
+ Multiprocess.main()