Docs testing patches
The following changes since commit ef009e4b4dc0421464008e6e303b892141ede579:
Merge tag 's390x-20240730' of https://github.com/davidhildenbrand/qemu into staging (2024-07-30 19:21:58 +1000)
are available in the Git repository at:
https://github.com/philmd/qemu.git tags/docs-testing-20240731
for you to fetch changes up to 7b60b971cc2f52ed2a69006a2ad709df2831cd67:
osdep.h: Clean up no-longer-needed back-compat for macOS 10 (2024-07-31 00:15:00 +0200)
----------------------------------------------------------------
Docs & testing patch queue
- Test QAPI firmware.json schema (Thomas)
- Handle new env.doc2path() return value (Peter)
- Improve how assets are used by some Avocado tests (Cleber)
- Remove obsolete check for macOS 10 (Peter)
----------------------------------------------------------------
Cleber Rosa (3):
tests/avocado: mips: fallback to HTTP given certificate expiration tests/avocado: mips: add hint for fetchasset plugin tests/avocado: test_arm_emcraft_sf2: handle RW requirements for asset
Peter Maydell (2):
docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a
str
osdep.h: Clean up no-longer-needed back-compat for macOS 10
Thomas Weißschuh (1):
docs: add test for firmware.json QAPI
docs/meson.build | 5 +++++ docs/sphinx/depfile.py | 2 +- include/qemu/osdep.h | 3 +-- tests/avocado/boot_linux_console.py | 24 ++++++++++++++---------- 4 files changed, 21 insertions(+), 13 deletions(-)
Signature · 1 line
2.45.2
[PULL 1/6] docs: add test for firmware.json QAPI
From: Thomas Weißschuh <[email protected]>
To make sure that the QAPI description stays valid, add a testcase.
Message-ID: <[email protected]>
--- docs/meson.build | 5 +++++ 1 file changed, 5 insertions(+)
docs/meson.build +5 -0
@@ -99,3 +99,8 @@ if build_docs alias_target('html', sphinxdocs) alias_target('man', sphinxmans) endif + +test('QAPI firmware.json regression tests', qapi_gen, + args: ['-o', meson.current_build_dir() / 'qapi', + meson.current_source_dir() / 'interop/firmware.json'], + suite: ['qapi-schema', 'qapi-interop'])
Signature · 1 line
2.45.2
[PULL 3/6] tests/avocado: mips: fallback to HTTP given certificate expiration
In reply to Philippe Mathieu-DaudéFrom: Cleber Rosa <[email protected]>
The SSL certificate installed at mipsdistros.mips.com has expired:
0 s:CN = mipsdistros.mips.com
i:C = US, O = Amazon, OU = Server CA 1B, CN = Amazon
a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256 v:NotBefore: Dec 23 00:00:00 2019 GMT; NotAfter: Jan 23 12:00:00 2021 GMT
Because this project has no control over that certificate and host, this falls back to plain HTTP instead. The integrity of the downloaded files can be guaranteed by the existing hashes for those files (which are not modified here).
Message-ID: <[email protected]>
--- tests/avocado/boot_linux_console.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/avocado/boot_linux_console.py +3 -3
@@ -299,7 +299,7 @@ def test_mips_malta32el_nanomips_4k(self): :avocado: tags=endian:little :avocado: tags=cpu:I7200 """ - kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' + kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' 'generic_nano32r6el_page4k.xz') kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
@@ -312,7 +312,7 @@ def test_mips_malta32el_nanomips_16k_up(self): :avocado: tags=endian:little :avocado: tags=cpu:I7200 """ - kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' + kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' 'generic_nano32r6el_page16k_up.xz') kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
@@ -325,7 +325,7 @@ def test_mips_malta32el_nanomips_64k_dbg(self): :avocado: tags=endian:little :avocado: tags=cpu:I7200 """ - kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/' + kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/' 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' 'generic_nano32r6el_page64k_dbg.xz') kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
Signature · 1 line
2.45.2
[PULL 4/6] tests/avocado: mips: add hint for fetchasset plugin
In reply to Philippe Mathieu-DaudéFrom: Cleber Rosa <[email protected]>
Avocado's fetchasset plugin runs before the actual Avocado job (and any test). It analyses the test's code looking for occurrences of "self.fetch_asset()" in the either the actual test or setUp() method. It's not able to fully analyze all code, though.
The way these tests are written, make the fetchasset plugin blind to the assets. This adds some more code duplication, true, but it will aid the fetchasset plugin to download or verify the existence of these assets in advance.
Message-ID: <[email protected]>
--- tests/avocado/boot_linux_console.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
tests/avocado/boot_linux_console.py +7 -5
@@ -274,8 +274,7 @@ def test_mips64el_malta_5KEc_cpio(self): # Wait for VM to shut down gracefully self.vm.wait() - def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash): - kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + def do_test_mips_malta32el_nanomips(self, kernel_path_xz): kernel_path = self.workdir + "kernel" with lzma.open(kernel_path_xz, 'rb') as f_in: with open(kernel_path, 'wb') as f_out:
@@ -303,7 +302,8 @@ def test_mips_malta32el_nanomips_4k(self): 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' 'generic_nano32r6el_page4k.xz') kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6' - self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash) + kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + self.do_test_mips_malta32el_nanomips(kernel_path_xz) def test_mips_malta32el_nanomips_16k_up(self): """
@@ -316,7 +316,8 @@ def test_mips_malta32el_nanomips_16k_up(self): 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' 'generic_nano32r6el_page16k_up.xz') kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc' - self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash) + kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + self.do_test_mips_malta32el_nanomips(kernel_path_xz) def test_mips_malta32el_nanomips_64k_dbg(self): """
@@ -329,7 +330,8 @@ def test_mips_malta32el_nanomips_64k_dbg(self): 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/' 'generic_nano32r6el_page64k_dbg.xz') kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180' - self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash) + kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash) + self.do_test_mips_malta32el_nanomips(kernel_path_xz) def test_aarch64_xlnx_versal_virt(self): """
Signature · 1 line
2.45.2
[PULL 2/6] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str
In reply to Philippe Mathieu-DaudéFrom: Peter Maydell <[email protected]>
In newer versions of Sphinx the env.doc2path() API is going to change to return a Path object rather than a str. This was originally visible in Sphinx 8.0.0rc1, but has been rolled back for the final 8.0.0 release. However it will probably emit a deprecation warning and is likely to change for good in 9.0:
https://github.com/sphinx-doc/sphinx/issues/12686
Our use in depfile.py assumes a str, and if it is passed a Path
it will fall over:
Handler <function write_depfile at 0x77a1775ff560> for event 'build-finished' threw an exception (exception: unsupported operand type(s) for +: 'PosixPath' and 'str')
Wrapping the env.doc2path() call in str() will coerce a Path object to the str we expect, and have no effect in older Sphinx versions that do return a str.
Cc: [email protected]
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2458
Message-ID: <[email protected]>
--- docs/sphinx/depfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
docs/sphinx/depfile.py +1 -1
@@ -19,7 +19,7 @@ def get_infiles(env): for x in env.found_docs: - yield env.doc2path(x) + yield str(env.doc2path(x)) yield from ((os.path.join(env.srcdir, dep) for dep in env.dependencies[x])) for mod in sys.modules.values():
Signature · 1 line
2.45.2
[PULL 6/6] osdep.h: Clean up no-longer-needed back-compat for macOS 10
In reply to Philippe Mathieu-DaudéFrom: Peter Maydell <[email protected]>
Our official support policy only supports the most recent two versions of macOS (currently macOS 13 Ventura and macOS 14 Sonoma), and we already have code that assumes at least macOS 12 Monterey or better. In commit 2d27c91e2b72ac7 we dropped some of the back-compat code for older macOS versions, but missed the guard in osdep.h that is providing a fallback for macOS 10 and earlier.
Simplify the ifdef to the "ifdef __APPLE__" that we use elsewhere for "is this macOS?".
Message-ID: <[email protected]>
--- include/qemu/osdep.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/qemu/osdep.h +1 -2
@@ -786,8 +786,7 @@ size_t qemu_get_host_physmem(void);* Toggle write/execute on the pages marked MAP_JIT * for the current thread. */ -#if defined(MAC_OS_VERSION_11_0 ) && \ -MAC_OS_X_VERSION_MIN_REQUIRED >=MAC_OS_VERSION_11_0 +#ifdef __APPLE__static inline void qemu_thread_jit_execute (void ) {pthread_jit_write_protect_np (true);
Signature · 1 line
2.45.2
[PULL 5/6] tests/avocado: test_arm_emcraft_sf2: handle RW requirements for asset
In reply to Philippe Mathieu-DaudéFrom: Cleber Rosa <[email protected]>
The asset used in the mentioned test gets truncated before it's used in the test. This means that the file gets modified, and thus the asset's expected hash doesn't match anymore. This causes cache misses and re-downloads every time the test is re-run.
Let's make a copy of the asset so that the one in the cache is preserved and the cache sees a hit on re-runs.
Message-ID: <[email protected]>
--- tests/avocado/boot_linux_console.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/avocado/boot_linux_console.py +4 -2
@@ -401,14 +401,16 @@ def test_arm_emcraft_sf2(self): 'fe371d32e50ca682391e1e70ab98c2942aeffb01/spi.bin') spi_hash = '65523a1835949b6f4553be96dec1b6a38fb05501' spi_path = self.fetch_asset(spi_url, asset_hash=spi_hash) + spi_path_rw = os.path.join(self.workdir, os.path.basename(spi_path)) + shutil.copy(spi_path, spi_path_rw) - file_truncate(spi_path, 16 << 20) # Spansion S25FL128SDPBHICO is 16 MiB + file_truncate(spi_path_rw, 16 << 20) # Spansion S25FL128SDPBHICO is 16 MiB self.vm.set_console() kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE self.vm.add_args('-kernel', uboot_path, '-append', kernel_command_line, - '-drive', 'file=' + spi_path + ',if=mtd,format=raw', + '-drive', 'file=' + spi_path_rw + ',if=mtd,format=raw', '-no-reboot') self.vm.launch() self.wait_for_console_pattern('Enter \'help\' for a list')
Signature · 1 line
2.45.2
Richard Henderson
AppliedQuoted 12 lines · Philippe Mathieu-Daudé
The following changes since commit
ef009e4b4dc0421464008e6e303b892141ede579:Merge tag 's390x-20240730' ofhttps://github.com/davidhildenbrand/qemu into staging (2024-07-30 19:21:58 +1000)are available in the Git repository at:
https://github.com/philmd/qemu.git tags/docs-testing-20240731for you to fetch changes up to
7b60b971cc2f52ed2a69006a2ad709df2831cd67:osdep.h: Clean up no-longer-needed back-compat for macOS 10 (2024-07-31 00:15:00 +0200)
Quoted 7 lines
----------------------------------------------------------------
Docs & testing patch queue- Test QAPI firmware.json schema (Thomas)
- Handle newenv.doc2path()return value (Peter)
- Improve how assets are used by some Avocado tests (Cleber)
- Remove obsolete check for macOS 10 (Peter)
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/9.1 as appropriate.
r~