Skip to content

Commit 527dede

Browse files
committed
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 "[email protected]" # gpg: Good signature from "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [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 <[email protected]>
2 parents 17e9c90 + f700abb commit 527dede

File tree

10 files changed

+37
-53
lines changed

10 files changed

+37
-53
lines changed

docs/devel/testing/functional.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,26 @@ files around on disk by setting ```QEMU_TEST_KEEP_SCRATCH=1``` as an env
7272
variable. Any preserved files will be deleted the next time the test is run
7373
without this variable set.
7474

75-
Overview
76-
--------
75+
Logging
76+
-------
77+
78+
The framework collects log files for each test in the build directory
79+
in the following subfolder::
80+
81+
<builddir>/tests/functional/<arch>/<fileid>.<classid>.<testname>/
82+
83+
There are usually three log files:
84+
85+
* ``base.log`` contains the generic logging information that is written
86+
by the calls to the logging functions in the test code (e.g. by calling
87+
the ``self.log.info()`` or ``self.log.debug()`` functions).
88+
* ``console.log`` contains the output of the serial console of the guest.
89+
* ``default.log`` contains the output of QEMU. This file could be named
90+
differently if the test chooses to use a different identifier for
91+
the guest VM (e.g. when the test spins up multiple VMs).
92+
93+
Introduction to writing tests
94+
-----------------------------
7795

7896
The ``tests/functional/qemu_test`` directory provides the ``qemu_test``
7997
Python module, containing the ``qemu_test.QemuSystemTest`` class.

docs/system/arm/bananapi_m2u.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ And then boot it.
125125
126126
$ qemu-system-arm -M bpim2u -nographic -sd sd.img
127127
128-
Banana Pi M2U integration tests
129-
"""""""""""""""""""""""""""""""
128+
Banana Pi M2U functional tests
129+
""""""""""""""""""""""""""""""
130130

131-
The Banana Pi M2U machine has several integration tests included.
131+
The Banana Pi M2U machine has several functional tests included.
132132
To run the whole set of tests, build QEMU from source and simply
133133
provide the following command:
134134

135135
.. code-block:: bash
136136
137137
$ cd qemu-build-dir
138138
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
139-
meson test --suite thorough func-arm-arm_bpim2u
139+
pyvenv/bin/meson test --suite thorough func-arm-arm_bpim2u

docs/system/arm/orangepi.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ and set the following environment variables before booting:
252252
Optionally you may save the environment variables to SD card with 'saveenv'.
253253
To continue booting simply give the 'boot' command and NetBSD boots.
254254

255-
Orange Pi PC integration tests
256-
""""""""""""""""""""""""""""""
255+
Orange Pi PC functional tests
256+
"""""""""""""""""""""""""""""
257257

258-
The Orange Pi PC machine has several integration tests included.
258+
The Orange Pi PC machine has several functional tests included.
259259
To run the whole set of tests, build QEMU from source and simply
260260
provide the following command from the build directory:
261261

262262
.. code-block:: bash
263263
264264
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
265-
meson test --suite thorough func-arm-arm_orangepi
265+
pyvenv/bin/meson test --suite thorough func-arm-arm_orangepi

docs/system/devices/igb.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ directory:
5757
meson test qtest-x86_64/qos-test
5858
5959
ethtool can test register accesses, interrupts, etc. It is automated as an
60-
functional test and can be ran with the following command:
60+
functional test and can be run from the build directory with the following
61+
command:
6162

6263
.. code:: shell
6364
64-
meson test --suite thorough func-x86_64-netdev_ethtool
65+
pyvenv/bin/meson test --suite thorough func-x86_64-netdev_ethtool
6566
6667
References
6768
==========

hw/virtio/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
9090
system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
9191
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
9292
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c'))
93-
system_ss.add(when: 'CONFIG_VIRTIO_MD', if_false: files('virtio-md-stubs.c'))
93+
system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_PCI'],
94+
if_false: files('virtio-md-stubs.c'))
9495

9596
system_ss.add(files('virtio-hmp-cmds.c'))
9697

tests/functional/qemu_test/testcase.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@
3333

3434
class QemuBaseTest(unittest.TestCase):
3535

36-
arch = None
37-
38-
workdir = None
39-
log = None
40-
logdir = None
41-
4236
'''
4337
@params compressed: filename, Asset, or file-like object to uncompress
4438
@params format: optional compression format (gzip, lzma)

tests/functional/test_acpi_bits.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ def __init__(self, *args, **kwargs):
119119

120120
self._debugcon_addr = '0x403'
121121
self._debugcon_log = 'debugcon-log.txt'
122-
self.logger = self.log
123122

124123
def _print_log(self, log):
125124
self.logger.info('\nlogs from biosbits follows:')

tests/functional/test_arm_orangepi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from qemu_test.utils import image_pow2ceil_expand
1515

1616

17-
class BananaPiMachine(LinuxKernelTest):
17+
class OrangePiMachine(LinuxKernelTest):
1818

1919
ASSET_DEB = Asset(
2020
('https://apt.armbian.com/pool/main/l/linux-6.6.16/'

tests/functional/test_migration.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ def test_migration_with_unix(self):
8787
dest_uri = 'unix:%s/qemu-test.sock' % socket_path
8888
self.do_migrate(dest_uri)
8989

90-
@skipIfMissingCommands('nc')
90+
@skipIfMissingCommands('ncat')
9191
def test_migration_with_exec(self):
92-
"""The test works for both netcat-traditional and netcat-openbsd packages."""
9392
with Ports() as ports:
9493
free_port = self._get_free_port(ports)
95-
dest_uri = 'exec:nc -l localhost %u' % free_port
96-
src_uri = 'exec:nc localhost %u' % free_port
94+
dest_uri = 'exec:ncat -l localhost %u' % free_port
95+
src_uri = 'exec:ncat localhost %u' % free_port
9796
self.do_migrate(dest_uri, src_uri)
9897

9998
if __name__ == '__main__':

tests/functional/test_x86_64_kvm_xen.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ def run_and_check(self):
8080
wait_for_console_pattern(self, '#', 'Oops')
8181

8282
def test_kvm_xen_guest(self):
83-
"""
84-
:avocado: tags=kvm_xen_guest
85-
"""
86-
8783
self.common_vm_setup()
8884

8985
self.kernel_params = (self.KERNEL_DEFAULT +
@@ -94,10 +90,6 @@ def test_kvm_xen_guest(self):
9490
'virtio0-output')
9591

9692
def test_kvm_xen_guest_nomsi(self):
97-
"""
98-
:avocado: tags=kvm_xen_guest_nomsi
99-
"""
100-
10193
self.common_vm_setup()
10294

10395
self.kernel_params = (self.KERNEL_DEFAULT +
@@ -108,10 +100,6 @@ def test_kvm_xen_guest_nomsi(self):
108100
'virtio0')
109101

110102
def test_kvm_xen_guest_noapic_nomsi(self):
111-
"""
112-
:avocado: tags=kvm_xen_guest_noapic_nomsi
113-
"""
114-
115103
self.common_vm_setup()
116104

117105
self.kernel_params = (self.KERNEL_DEFAULT +
@@ -122,10 +110,6 @@ def test_kvm_xen_guest_noapic_nomsi(self):
122110
'virtio0')
123111

124112
def test_kvm_xen_guest_vapic(self):
125-
"""
126-
:avocado: tags=kvm_xen_guest_vapic
127-
"""
128-
129113
self.common_vm_setup()
130114
self.vm.add_args('-cpu', 'host,+xen-vapic')
131115
self.kernel_params = (self.KERNEL_DEFAULT +
@@ -140,10 +124,6 @@ def test_kvm_xen_guest_vapic(self):
140124
'virtio0-output')
141125

142126
def test_kvm_xen_guest_novector(self):
143-
"""
144-
:avocado: tags=kvm_xen_guest_novector
145-
"""
146-
147127
self.common_vm_setup()
148128
self.kernel_params = (self.KERNEL_DEFAULT +
149129
' xen_emul_unplug=ide-disks' +
@@ -154,10 +134,6 @@ def test_kvm_xen_guest_novector(self):
154134
'fasteoi')
155135

156136
def test_kvm_xen_guest_novector_nomsi(self):
157-
"""
158-
:avocado: tags=kvm_xen_guest_novector_nomsi
159-
"""
160-
161137
self.common_vm_setup()
162138

163139
self.kernel_params = (self.KERNEL_DEFAULT +
@@ -169,10 +145,6 @@ def test_kvm_xen_guest_novector_nomsi(self):
169145
'IO-APIC')
170146

171147
def test_kvm_xen_guest_novector_noapic(self):
172-
"""
173-
:avocado: tags=kvm_xen_guest_novector_noapic
174-
"""
175-
176148
self.common_vm_setup()
177149
self.kernel_params = (self.KERNEL_DEFAULT +
178150
' xen_emul_unplug=ide-disks' +

0 commit comments

Comments
 (0)