* Fix linking problem when CONFIG_VIRTIO_PCI is not set for s390x
* Update functional tests parts of the documenation * Some minor fixes for functional tests -----BEGIN PGP SIGNATURE----- iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmfawycRHHRodXRoQHJl ZGhhdC5jb20ACgkQLtnXdP5wLbU2vA//UV2RdKVIQDS7MbMYRjmUr0NK9/9dLmrn /lZVWXCBDEB7seu/VOGZmr1H0zoQ8XYJTSbrmp2cW0NRPhCVeAz9Zpg7+jt3Qy6/ ahbiNQyhYztMbSa4XOOUEoLZBsfZILjWgqBilrRn7ng6wJoNabEIs/KqMP3O9qsx TYCCnu5JkMF85Bf0l3kUJlLX0b5+BnpUNDke1cipvTa7u/Coz0mDBBZZtgW1bBj8 TETuMC1JtCg3aj1ey7k0pK4nCd740mr5w659C4LE8NCE0/juc3AtRM5RCqU9tAGh tXpfrZziyvSrAhyWieRQlgzLvrt2gTF/5FrqhPUssts+vkH1EgB56FiPXdqMtLRo zU+SVRuOMHQZn7E6L9KQ7Gz5w98PSVGYxUUpWIvOx/0d9wgoIfYPjgtJz5UV11mV Nnt304UV4FKw94V8S8JYUClamP4SMTMLZNRIsd46Ef+DOL1CI+jcDZBntijwSgs1 5fs0IZyl6ZXtmUibVWJ+PqyYW6YiAfi/wY/mJlfnvKVZjoudbhNkNOtC9hi4YTQd yJ7gVy9A4OeQqXgiQcymFvlseggds7uPQ9/szuGC1RwrW2NYH1YLisKpNzPtqq16 TEOnsozlDa9OUDshKxrA5rwHiDcSuqJjkP26N91AmdEQDgoQcbIKWghriTxkOV9Q d2aJt+3KF04= =cNi4 -----END PGP SIGNATURE----- Merge tag 'pull-request-2025-03-19' of https://gitlab.com/thuth/qemu into staging * Fix linking problem when CONFIG_VIRTIO_PCI is not set for s390x * Update functional tests parts of the documenation * Some minor fixes for functional tests # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmfawycRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbU2vA//UV2RdKVIQDS7MbMYRjmUr0NK9/9dLmrn # /lZVWXCBDEB7seu/VOGZmr1H0zoQ8XYJTSbrmp2cW0NRPhCVeAz9Zpg7+jt3Qy6/ # ahbiNQyhYztMbSa4XOOUEoLZBsfZILjWgqBilrRn7ng6wJoNabEIs/KqMP3O9qsx # TYCCnu5JkMF85Bf0l3kUJlLX0b5+BnpUNDke1cipvTa7u/Coz0mDBBZZtgW1bBj8 # TETuMC1JtCg3aj1ey7k0pK4nCd740mr5w659C4LE8NCE0/juc3AtRM5RCqU9tAGh # tXpfrZziyvSrAhyWieRQlgzLvrt2gTF/5FrqhPUssts+vkH1EgB56FiPXdqMtLRo # zU+SVRuOMHQZn7E6L9KQ7Gz5w98PSVGYxUUpWIvOx/0d9wgoIfYPjgtJz5UV11mV # Nnt304UV4FKw94V8S8JYUClamP4SMTMLZNRIsd46Ef+DOL1CI+jcDZBntijwSgs1 # 5fs0IZyl6ZXtmUibVWJ+PqyYW6YiAfi/wY/mJlfnvKVZjoudbhNkNOtC9hi4YTQd # yJ7gVy9A4OeQqXgiQcymFvlseggds7uPQ9/szuGC1RwrW2NYH1YLisKpNzPtqq16 # TEOnsozlDa9OUDshKxrA5rwHiDcSuqJjkP26N91AmdEQDgoQcbIKWghriTxkOV9Q # d2aJt+3KF04= # =cNi4 # -----END PGP SIGNATURE----- # gpg: Signature made Wed 19 Mar 2025 09:14:15 EDT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2025-03-19' of https://gitlab.com/thuth/qemu: tests/functional/test_migration: Use "ncat" instead of "nc" in the exec test tests/functional/test_x86_64_kvm_xen: Remove avocado tags docs/devel/testing/functional: Add a section about logging docs/system/arm: Use "functional tests" instead of "integration tests" docs/system: Use the meson binary from the pyvenv tests/functional: remove all class level fields tests/functional/test_arm_orangepi: rename test class to 'OrangePiMachine' hw/virtio: Also include md stubs in case CONFIG_VIRTIO_PCI is not set Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
commit
527dede083
@ -72,8 +72,26 @@ files around on disk by setting ```QEMU_TEST_KEEP_SCRATCH=1``` as an env
|
|||||||
variable. Any preserved files will be deleted the next time the test is run
|
variable. Any preserved files will be deleted the next time the test is run
|
||||||
without this variable set.
|
without this variable set.
|
||||||
|
|
||||||
Overview
|
Logging
|
||||||
--------
|
-------
|
||||||
|
|
||||||
|
The framework collects log files for each test in the build directory
|
||||||
|
in the following subfolder::
|
||||||
|
|
||||||
|
<builddir>/tests/functional/<arch>/<fileid>.<classid>.<testname>/
|
||||||
|
|
||||||
|
There are usually three log files:
|
||||||
|
|
||||||
|
* ``base.log`` contains the generic logging information that is written
|
||||||
|
by the calls to the logging functions in the test code (e.g. by calling
|
||||||
|
the ``self.log.info()`` or ``self.log.debug()`` functions).
|
||||||
|
* ``console.log`` contains the output of the serial console of the guest.
|
||||||
|
* ``default.log`` contains the output of QEMU. This file could be named
|
||||||
|
differently if the test chooses to use a different identifier for
|
||||||
|
the guest VM (e.g. when the test spins up multiple VMs).
|
||||||
|
|
||||||
|
Introduction to writing tests
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
The ``tests/functional/qemu_test`` directory provides the ``qemu_test``
|
The ``tests/functional/qemu_test`` directory provides the ``qemu_test``
|
||||||
Python module, containing the ``qemu_test.QemuSystemTest`` class.
|
Python module, containing the ``qemu_test.QemuSystemTest`` class.
|
||||||
|
@ -125,10 +125,10 @@ And then boot it.
|
|||||||
|
|
||||||
$ qemu-system-arm -M bpim2u -nographic -sd sd.img
|
$ qemu-system-arm -M bpim2u -nographic -sd sd.img
|
||||||
|
|
||||||
Banana Pi M2U integration tests
|
Banana Pi M2U functional tests
|
||||||
"""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
The Banana Pi M2U machine has several integration tests included.
|
The Banana Pi M2U machine has several functional tests included.
|
||||||
To run the whole set of tests, build QEMU from source and simply
|
To run the whole set of tests, build QEMU from source and simply
|
||||||
provide the following command:
|
provide the following command:
|
||||||
|
|
||||||
@ -136,4 +136,4 @@ provide the following command:
|
|||||||
|
|
||||||
$ cd qemu-build-dir
|
$ cd qemu-build-dir
|
||||||
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
|
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
|
||||||
meson test --suite thorough func-arm-arm_bpim2u
|
pyvenv/bin/meson test --suite thorough func-arm-arm_bpim2u
|
||||||
|
@ -252,14 +252,14 @@ and set the following environment variables before booting:
|
|||||||
Optionally you may save the environment variables to SD card with 'saveenv'.
|
Optionally you may save the environment variables to SD card with 'saveenv'.
|
||||||
To continue booting simply give the 'boot' command and NetBSD boots.
|
To continue booting simply give the 'boot' command and NetBSD boots.
|
||||||
|
|
||||||
Orange Pi PC integration tests
|
Orange Pi PC functional tests
|
||||||
""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""
|
||||||
|
|
||||||
The Orange Pi PC machine has several integration tests included.
|
The Orange Pi PC machine has several functional tests included.
|
||||||
To run the whole set of tests, build QEMU from source and simply
|
To run the whole set of tests, build QEMU from source and simply
|
||||||
provide the following command from the build directory:
|
provide the following command from the build directory:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
|
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
|
||||||
meson test --suite thorough func-arm-arm_orangepi
|
pyvenv/bin/meson test --suite thorough func-arm-arm_orangepi
|
||||||
|
@ -57,11 +57,12 @@ directory:
|
|||||||
meson test qtest-x86_64/qos-test
|
meson test qtest-x86_64/qos-test
|
||||||
|
|
||||||
ethtool can test register accesses, interrupts, etc. It is automated as an
|
ethtool can test register accesses, interrupts, etc. It is automated as an
|
||||||
functional test and can be ran with the following command:
|
functional test and can be run from the build directory with the following
|
||||||
|
command:
|
||||||
|
|
||||||
.. code:: shell
|
.. code:: shell
|
||||||
|
|
||||||
meson test --suite thorough func-x86_64-netdev_ethtool
|
pyvenv/bin/meson test --suite thorough func-x86_64-netdev_ethtool
|
||||||
|
|
||||||
References
|
References
|
||||||
==========
|
==========
|
||||||
|
@ -90,7 +90,8 @@ specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
|
|||||||
system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
|
system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
|
||||||
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
|
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
|
||||||
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c'))
|
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c'))
|
||||||
system_ss.add(when: 'CONFIG_VIRTIO_MD', if_false: files('virtio-md-stubs.c'))
|
system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_PCI'],
|
||||||
|
if_false: files('virtio-md-stubs.c'))
|
||||||
|
|
||||||
system_ss.add(files('virtio-hmp-cmds.c'))
|
system_ss.add(files('virtio-hmp-cmds.c'))
|
||||||
|
|
||||||
|
@ -33,12 +33,6 @@ from .uncompress import uncompress
|
|||||||
|
|
||||||
class QemuBaseTest(unittest.TestCase):
|
class QemuBaseTest(unittest.TestCase):
|
||||||
|
|
||||||
arch = None
|
|
||||||
|
|
||||||
workdir = None
|
|
||||||
log = None
|
|
||||||
logdir = None
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
@params compressed: filename, Asset, or file-like object to uncompress
|
@params compressed: filename, Asset, or file-like object to uncompress
|
||||||
@params format: optional compression format (gzip, lzma)
|
@params format: optional compression format (gzip, lzma)
|
||||||
|
@ -119,7 +119,6 @@ class AcpiBitsTest(QemuSystemTest): #pylint: disable=too-many-instance-attribute
|
|||||||
|
|
||||||
self._debugcon_addr = '0x403'
|
self._debugcon_addr = '0x403'
|
||||||
self._debugcon_log = 'debugcon-log.txt'
|
self._debugcon_log = 'debugcon-log.txt'
|
||||||
self.logger = self.log
|
|
||||||
|
|
||||||
def _print_log(self, log):
|
def _print_log(self, log):
|
||||||
self.logger.info('\nlogs from biosbits follows:')
|
self.logger.info('\nlogs from biosbits follows:')
|
||||||
|
@ -14,7 +14,7 @@ from qemu_test import wait_for_console_pattern, skipBigDataTest
|
|||||||
from qemu_test.utils import image_pow2ceil_expand
|
from qemu_test.utils import image_pow2ceil_expand
|
||||||
|
|
||||||
|
|
||||||
class BananaPiMachine(LinuxKernelTest):
|
class OrangePiMachine(LinuxKernelTest):
|
||||||
|
|
||||||
ASSET_DEB = Asset(
|
ASSET_DEB = Asset(
|
||||||
('https://apt.armbian.com/pool/main/l/linux-6.6.16/'
|
('https://apt.armbian.com/pool/main/l/linux-6.6.16/'
|
||||||
|
@ -87,13 +87,12 @@ class MigrationTest(QemuSystemTest):
|
|||||||
dest_uri = 'unix:%s/qemu-test.sock' % socket_path
|
dest_uri = 'unix:%s/qemu-test.sock' % socket_path
|
||||||
self.do_migrate(dest_uri)
|
self.do_migrate(dest_uri)
|
||||||
|
|
||||||
@skipIfMissingCommands('nc')
|
@skipIfMissingCommands('ncat')
|
||||||
def test_migration_with_exec(self):
|
def test_migration_with_exec(self):
|
||||||
"""The test works for both netcat-traditional and netcat-openbsd packages."""
|
|
||||||
with Ports() as ports:
|
with Ports() as ports:
|
||||||
free_port = self._get_free_port(ports)
|
free_port = self._get_free_port(ports)
|
||||||
dest_uri = 'exec:nc -l localhost %u' % free_port
|
dest_uri = 'exec:ncat -l localhost %u' % free_port
|
||||||
src_uri = 'exec:nc localhost %u' % free_port
|
src_uri = 'exec:ncat localhost %u' % free_port
|
||||||
self.do_migrate(dest_uri, src_uri)
|
self.do_migrate(dest_uri, src_uri)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -80,10 +80,6 @@ class KVMXenGuest(QemuSystemTest):
|
|||||||
wait_for_console_pattern(self, '#', 'Oops')
|
wait_for_console_pattern(self, '#', 'Oops')
|
||||||
|
|
||||||
def test_kvm_xen_guest(self):
|
def test_kvm_xen_guest(self):
|
||||||
"""
|
|
||||||
:avocado: tags=kvm_xen_guest
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.common_vm_setup()
|
self.common_vm_setup()
|
||||||
|
|
||||||
self.kernel_params = (self.KERNEL_DEFAULT +
|
self.kernel_params = (self.KERNEL_DEFAULT +
|
||||||
@ -94,10 +90,6 @@ class KVMXenGuest(QemuSystemTest):
|
|||||||
'virtio0-output')
|
'virtio0-output')
|
||||||
|
|
||||||
def test_kvm_xen_guest_nomsi(self):
|
def test_kvm_xen_guest_nomsi(self):
|
||||||
"""
|
|
||||||
:avocado: tags=kvm_xen_guest_nomsi
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.common_vm_setup()
|
self.common_vm_setup()
|
||||||
|
|
||||||
self.kernel_params = (self.KERNEL_DEFAULT +
|
self.kernel_params = (self.KERNEL_DEFAULT +
|
||||||
@ -108,10 +100,6 @@ class KVMXenGuest(QemuSystemTest):
|
|||||||
'virtio0')
|
'virtio0')
|
||||||
|
|
||||||
def test_kvm_xen_guest_noapic_nomsi(self):
|
def test_kvm_xen_guest_noapic_nomsi(self):
|
||||||
"""
|
|
||||||
:avocado: tags=kvm_xen_guest_noapic_nomsi
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.common_vm_setup()
|
self.common_vm_setup()
|
||||||
|
|
||||||
self.kernel_params = (self.KERNEL_DEFAULT +
|
self.kernel_params = (self.KERNEL_DEFAULT +
|
||||||
@ -122,10 +110,6 @@ class KVMXenGuest(QemuSystemTest):
|
|||||||
'virtio0')
|
'virtio0')
|
||||||
|
|
||||||
def test_kvm_xen_guest_vapic(self):
|
def test_kvm_xen_guest_vapic(self):
|
||||||
"""
|
|
||||||
:avocado: tags=kvm_xen_guest_vapic
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.common_vm_setup()
|
self.common_vm_setup()
|
||||||
self.vm.add_args('-cpu', 'host,+xen-vapic')
|
self.vm.add_args('-cpu', 'host,+xen-vapic')
|
||||||
self.kernel_params = (self.KERNEL_DEFAULT +
|
self.kernel_params = (self.KERNEL_DEFAULT +
|
||||||
@ -140,10 +124,6 @@ class KVMXenGuest(QemuSystemTest):
|
|||||||
'virtio0-output')
|
'virtio0-output')
|
||||||
|
|
||||||
def test_kvm_xen_guest_novector(self):
|
def test_kvm_xen_guest_novector(self):
|
||||||
"""
|
|
||||||
:avocado: tags=kvm_xen_guest_novector
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.common_vm_setup()
|
self.common_vm_setup()
|
||||||
self.kernel_params = (self.KERNEL_DEFAULT +
|
self.kernel_params = (self.KERNEL_DEFAULT +
|
||||||
' xen_emul_unplug=ide-disks' +
|
' xen_emul_unplug=ide-disks' +
|
||||||
@ -154,10 +134,6 @@ class KVMXenGuest(QemuSystemTest):
|
|||||||
'fasteoi')
|
'fasteoi')
|
||||||
|
|
||||||
def test_kvm_xen_guest_novector_nomsi(self):
|
def test_kvm_xen_guest_novector_nomsi(self):
|
||||||
"""
|
|
||||||
:avocado: tags=kvm_xen_guest_novector_nomsi
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.common_vm_setup()
|
self.common_vm_setup()
|
||||||
|
|
||||||
self.kernel_params = (self.KERNEL_DEFAULT +
|
self.kernel_params = (self.KERNEL_DEFAULT +
|
||||||
@ -169,10 +145,6 @@ class KVMXenGuest(QemuSystemTest):
|
|||||||
'IO-APIC')
|
'IO-APIC')
|
||||||
|
|
||||||
def test_kvm_xen_guest_novector_noapic(self):
|
def test_kvm_xen_guest_novector_noapic(self):
|
||||||
"""
|
|
||||||
:avocado: tags=kvm_xen_guest_novector_noapic
|
|
||||||
"""
|
|
||||||
|
|
||||||
self.common_vm_setup()
|
self.common_vm_setup()
|
||||||
self.kernel_params = (self.KERNEL_DEFAULT +
|
self.kernel_params = (self.KERNEL_DEFAULT +
|
||||||
' xen_emul_unplug=ide-disks' +
|
' xen_emul_unplug=ide-disks' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user