Skip to content

Commit 28ea66f

Browse files
committed
Merge tag 'pull-request-2025-03-13' of https://gitlab.com/thuth/qemu into staging
* Various fixes for functional tests * Fix the name of the "configs" directory in the documentation # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmfSjagRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbWBmA//RhAHuF/fTmQagBsZPETXjU1g8ifw9aqm # WPZcQEXyQFlqYYQZmtV7dk3aTGEw4kBDmm+SKTSQz1yUcBGptMl8xuWaxgdpcOw0 # Bqt+lYNgwGL9/OocCdNolU3+aVbETljr5l+rzbnwsTVIqGk63Qhmtwdupb8h1nfY # 4vCXU+sY3BkvBF8HbV6Wb1aPtqC+iH/Ln8+yoKkC8UePD623dK58SsOVrhUQDfFr # U/HUy4BZlHFCfGGmDVGBjHdEbOzQkLQ9N3ilsNSWcF87RPkWPft+qLs4RjDFW+oT # oksXEFHcr8XQO03fwHBNTyv+NUfnrvDY8V+gl6C9ItQr58SZzse57caZKWrYppZ3 # l5iHoaLMV3juZFDNXNHkWHuveXi05+0V0UbZihzBeC4+zjNRyh3e1GuDoh5VoG8o # XIb55RxU8eBG2/ulHZ71eAYrGpxO+tDdsdnak1coPFsU8HrC9QzRfywiAZe1Wwmx # 5t5AHbZ7RdnxgStU1lWTUT2IDVSini4DKevt/FzhKkv1aD8NbhI/ooGDC0zbS6SU # XK6PP2G5a5OnjQ904oRCQbnhrxFa5qNfryylvvreT2bVgX0BiE4pJ9JXdgQOMYlP # kZERZZQcv3y6VVavAT67yeNKQpyb4HSHdTDQ2irgXP1UwHRpwLpKdqB1UhzNJ8m8 # k0faA8RXir4= # =VtGZ # -----END PGP SIGNATURE----- # gpg: Signature made Thu 13 Mar 2025 15:47:52 HKT # 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-13' of https://gitlab.com/thuth/qemu: tests/functional: skip vulkan test if missing vulkaninfo tests/functional/asset: Add AssetError exception class tests/functional/asset: Verify downloaded size tests/functional/asset: Fail assert fetch when retries are exceeded docs/system: Fix the information on how to run certain functional tests tests/functional: Bump up arm_replay timeout tests/functional: Require 'user' netdev for ppc64 e500 test docs: Rename default-configs to configs Signed-off-by: Stefan Hajnoczi <[email protected]>
2 parents 4c33c09 + b3c0366 commit 28ea66f

File tree

9 files changed

+67
-35
lines changed

9 files changed

+67
-35
lines changed

docs/devel/build-system.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ Target-dependent emulator sourcesets:
260260
Each emulator also includes sources for files in the ``hw/`` and ``target/``
261261
subdirectories. The subdirectory used for each emulator comes
262262
from the target's definition of ``TARGET_BASE_ARCH`` or (if missing)
263-
``TARGET_ARCH``, as found in ``default-configs/targets/*.mak``.
263+
``TARGET_ARCH``, as found in ``configs/targets/*.mak``.
264264

265265
Each subdirectory in ``hw/`` adds one sourceset to the ``hw_arch`` dictionary,
266266
for example::
@@ -317,8 +317,8 @@ Utility sourcesets:
317317
The following files concur in the definition of which files are linked
318318
into each emulator:
319319

320-
``default-configs/devices/*.mak``
321-
The files under ``default-configs/devices/`` control the boards and devices
320+
``configs/devices/*.mak``
321+
The files under ``configs/devices/`` control the boards and devices
322322
that are built into each QEMU system emulation targets. They merely contain
323323
a list of config variable definitions such as::
324324

@@ -327,11 +327,11 @@ into each emulator:
327327
CONFIG_XLNX_VERSAL=y
328328

329329
``*/Kconfig``
330-
These files are processed together with ``default-configs/devices/*.mak`` and
330+
These files are processed together with ``configs/devices/*.mak`` and
331331
describe the dependencies between various features, subsystems and
332332
device models. They are described in :ref:`kconfig`
333333

334-
``default-configs/targets/*.mak``
334+
``configs/targets/*.mak``
335335
These files mostly define symbols that appear in the ``*-config-target.h``
336336
file for each emulator\ [#cfgtarget]_. However, the ``TARGET_ARCH``
337337
and ``TARGET_BASE_ARCH`` will also be used to select the ``hw/`` and

docs/devel/kconfig.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ originated in the Linux kernel, though it was heavily simplified and
3838
the handling of dependencies is stricter in QEMU.
3939

4040
Unlike Linux, there is no user interface to edit the configuration, which
41-
is instead specified in per-target files under the ``default-configs/``
41+
is instead specified in per-target files under the ``configs/``
4242
directory of the QEMU source tree. This is because, unlike Linux,
4343
configuration and dependencies can be treated as a black box when building
4444
QEMU; the default configuration that QEMU ships with should be okay in
@@ -103,7 +103,7 @@ directives can be included:
103103
**default value**: ``default <value> [if <expr>]``
104104

105105
Default values are assigned to the config symbol if no other value was
106-
set by the user via ``default-configs/*.mak`` files, and only if
106+
set by the user via ``configs/*.mak`` files, and only if
107107
``select`` or ``depends on`` directives do not force the value to true
108108
or false respectively. ``<value>`` can be ``y`` or ``n``; it cannot
109109
be an arbitrary Boolean expression. However, a condition for applying
@@ -119,7 +119,7 @@ directives can be included:
119119
This is similar to ``select`` as it applies a lower limit of ``y``
120120
to another symbol. However, the lower limit is only a default
121121
and the "implied" symbol's value may still be set to ``n`` from a
122-
``default-configs/*.mak`` files. The following two examples are
122+
``configs/*.mak`` files. The following two examples are
123123
equivalent::
124124

125125
config FOO
@@ -146,7 +146,7 @@ declares its dependencies in different ways:
146146
bool
147147

148148
Subsystems always default to false (they have no ``default`` directive)
149-
and are never visible in ``default-configs/*.mak`` files. It's
149+
and are never visible in ``configs/*.mak`` files. It's
150150
up to other symbols to ``select`` whatever subsystems they require.
151151

152152
They sometimes have ``select`` directives to bring in other required
@@ -238,7 +238,7 @@ declares its dependencies in different ways:
238238
include libraries (such as ``FDT``) or ``TARGET_BIG_ENDIAN``
239239
(possibly negated).
240240

241-
Boards are listed for convenience in the ``default-configs/*.mak``
241+
Boards are listed for convenience in the ``configs/*.mak``
242242
for the target they apply to.
243243

244244
**internal elements**
@@ -251,18 +251,18 @@ declares its dependencies in different ways:
251251

252252
Internal elements group code that is useful in several boards or
253253
devices. They are usually enabled with ``select`` and in turn select
254-
other elements; they are never visible in ``default-configs/*.mak``
254+
other elements; they are never visible in ``configs/*.mak``
255255
files, and often not even in the Makefile.
256256

257257
Writing and modifying default configurations
258258
--------------------------------------------
259259

260260
In addition to the Kconfig files under hw/, each target also includes
261-
a file called ``default-configs/TARGETNAME-softmmu.mak``. These files
261+
a file called ``configs/TARGETNAME-softmmu.mak``. These files
262262
initialize some Kconfig variables to non-default values and provide the
263263
starting point to turn on devices and subsystems.
264264

265-
A file in ``default-configs/`` looks like the following example::
265+
A file in ``configs/`` looks like the following example::
266266

267267
# Default configuration for alpha-softmmu
268268

docs/system/arm/bananapi_m2u.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,5 @@ provide the following command:
135135
.. code-block:: bash
136136
137137
$ cd qemu-build-dir
138-
$ AVOCADO_ALLOW_LARGE_STORAGE=yes tests/venv/bin/avocado \
139-
--verbose --show=app,console run -t machine:bpim2u \
140-
../tests/avocado/boot_linux_console.py
138+
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
139+
meson test --suite thorough func-arm-arm_bpim2u

docs/system/arm/orangepi.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ Orange Pi PC integration tests
257257

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

262262
.. code-block:: bash
263263
264-
$ AVOCADO_ALLOW_LARGE_STORAGE=yes avocado --show=app,console run \
265-
-t machine:orangepi-pc tests/avocado/boot_linux_console.py
264+
$ QEMU_TEST_ALLOW_LARGE_STORAGE=1 \
265+
meson test --suite thorough func-arm-arm_orangepi

docs/system/devices/igb.rst

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

6262
.. code:: shell
6363
64-
make check-avocado AVOCADO_TESTS=tests/avocado/netdev-ethtool.py
64+
meson test --suite thorough func-x86_64-netdev_ethtool
6565
6666
References
6767
==========

tests/functional/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ test_timeouts = {
3434
'arm_orangepi' : 540,
3535
'arm_quanta_gsj' : 240,
3636
'arm_raspi2' : 120,
37+
'arm_replay' : 240,
3738
'arm_tuxrun' : 240,
3839
'arm_sx1' : 360,
3940
'intel_iommu': 300,

tests/functional/qemu_test/asset.py

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
from shutil import copyfileobj
1818
from urllib.error import HTTPError
1919

20+
class AssetError(Exception):
21+
def __init__(self, asset, msg, transient=False):
22+
self.url = asset.url
23+
self.msg = msg
24+
self.transient = transient
25+
26+
def __str__(self):
27+
return "%s: %s" % (self.url, self.msg)
2028

2129
# Instances of this class must be declared as class level variables
2230
# starting with a name "ASSET_". This enables the pre-caching logic
@@ -51,7 +59,7 @@ def _check(self, cache_file):
5159
elif len(self.hash) == 128:
5260
hl = hashlib.sha512()
5361
else:
54-
raise Exception("unknown hash type")
62+
raise AssetError(self, "unknown hash type")
5563

5664
# Calculate the hash of the file:
5765
with open(cache_file, 'rb') as file:
@@ -111,7 +119,8 @@ def fetch(self):
111119
return str(self.cache_file)
112120

113121
if not self.fetchable():
114-
raise Exception("Asset cache is invalid and downloads disabled")
122+
raise AssetError(self,
123+
"Asset cache is invalid and downloads disabled")
115124

116125
self.log.info("Downloading %s to %s...", self.url, self.cache_file)
117126
tmp_cache_file = self.cache_file.with_suffix(".download")
@@ -121,6 +130,20 @@ def fetch(self):
121130
with tmp_cache_file.open("xb") as dst:
122131
with urllib.request.urlopen(self.url) as resp:
123132
copyfileobj(resp, dst)
133+
length_hdr = resp.getheader("Content-Length")
134+
135+
# Verify downloaded file size against length metadata, if
136+
# available.
137+
if length_hdr is not None:
138+
length = int(length_hdr)
139+
fsize = tmp_cache_file.stat().st_size
140+
if fsize != length:
141+
self.log.error("Unable to download %s: "
142+
"connection closed before "
143+
"transfer complete (%d/%d)",
144+
self.url, fsize, length)
145+
tmp_cache_file.unlink()
146+
continue
124147
break
125148
except FileExistsError:
126149
self.log.debug("%s already exists, "
@@ -133,10 +156,23 @@ def fetch(self):
133156
tmp_cache_file)
134157
tmp_cache_file.unlink()
135158
continue
159+
except HTTPError as e:
160+
tmp_cache_file.unlink()
161+
self.log.error("Unable to download %s: HTTP error %d",
162+
self.url, e.code)
163+
# Treat 404 as fatal, since it is highly likely to
164+
# indicate a broken test rather than a transient
165+
# server or networking problem
166+
if e.code == 404:
167+
raise AssetError(self, "Unable to download: "
168+
"HTTP error %d" % e.code)
169+
continue
136170
except Exception as e:
137-
self.log.error("Unable to download %s: %s", self.url, e)
138171
tmp_cache_file.unlink()
139-
raise
172+
raise AssetError(self, "Unable to download: " % e)
173+
174+
if not os.path.exists(tmp_cache_file):
175+
raise AssetError(self, "Download retries exceeded", transient=True)
140176

141177
try:
142178
# Set these just for informational purposes
@@ -150,8 +186,7 @@ def fetch(self):
150186

151187
if not self._check(tmp_cache_file):
152188
tmp_cache_file.unlink()
153-
raise Exception("Hash of %s does not match %s" %
154-
(self.url, self.hash))
189+
raise AssetError(self, "Hash does not match %s" % self.hash)
155190
tmp_cache_file.replace(self.cache_file)
156191
# Remove write perms to stop tests accidentally modifying them
157192
os.chmod(self.cache_file, stat.S_IRUSR | stat.S_IRGRP)
@@ -173,15 +208,10 @@ def precache_test(test):
173208
log.info("Attempting to cache '%s'" % asset)
174209
try:
175210
asset.fetch()
176-
except HTTPError as e:
177-
# Treat 404 as fatal, since it is highly likely to
178-
# indicate a broken test rather than a transient
179-
# server or networking problem
180-
if e.code == 404:
211+
except AssetError as e:
212+
if not e.transient:
181213
raise
182-
183-
log.debug(f"HTTP error {e.code} from {asset.url} " +
184-
"skipping asset precache")
214+
log.error("%s: skipping asset precache" % e)
185215

186216
log.removeHandler(handler)
187217

tests/functional/test_aarch64_virt_gpu.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def test_aarch64_virt_with_virgl_blobs_gpu(self):
115115
self._run_virt_weston_test("glmark2-wayland -b:duration=1.0")
116116

117117
@skipIfMissingCommands('zstd')
118+
@skipIfMissingCommands('vulkaninfo')
118119
def test_aarch64_virt_with_vulkan_gpu(self):
119120

120121
self.require_device('virtio-gpu-gl-pci')

tests/functional/test_ppc64_e500.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class E500Test(LinuxKernelTest):
2020

2121
def test_ppc64_e500_buildroot(self):
2222
self.set_machine('ppce500')
23+
self.require_netdev('user')
2324
self.cpu = 'e5500'
2425

2526
uimage_path = self.ASSET_BR2_E5500_UIMAGE.fetch()

0 commit comments

Comments
 (0)