All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] tests/functional: misc fixes to functional test suite
@ 2026-11-20 12:14 Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 01/12] tests/functional: update to newer sunxi kernel package Daniel P. Berrangé
                   ` (11 more replies)
  0 siblings, 12 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

The first 4 patches fix failures to download a number of assets
whose URLs have been deleted, or moved, content regenerated, or
put behind anubis.

They will need to go to the pending 11.2 release and stable branches
too.

The remaining patches are bug fixes except for the very last
patch. Those can likely all wait until 12.0, but cherry-picking
some of them into stable would be reasonable if desired.

After this series is applied we have one unresolvable problem
with assets for MIPS, the yamon-bin-02.22.zip file hosted on
AWS is throwing an error about using the wrong endpoint, but
I can't figure out what the right one is (if any).

Daniel P. Berrangé (12):
  tests/functional: update to newer sunxi kernel package
  tests/functional: update sha digests for tuxrun kernels
  tests/functional: update URL to rs6000 firmware
  tests/functional: add Accept header when downloading assets
  tests/functional: check if we are served an Anubis challenge
  tests/functional: don't write timestamp unless successful
  tests/functional: delete tmp file on interrupt
  tests/functional: honour make jobs in precache
  tests/functional: don't display stack trace on download fail
  tests/functional: always raise AssetError when download fails
  tests/functional: only run pre-cache once per class
  tests/functional: optionally display download progress

 docs/devel/testing/functional.rst       |  6 ++
 tests/Makefile.include                  |  2 +-
 tests/functional/aarch64/test_tuxrun.py |  4 +-
 tests/functional/arm/test_bpim2u.py     | 19 +++---
 tests/functional/arm/test_cubieboard.py | 15 ++---
 tests/functional/arm/test_orangepi.py   | 19 +++---
 tests/functional/arm/test_replay.py     | 12 ++--
 tests/functional/ppc/test_40p.py        |  3 +-
 tests/functional/qemu_test/asset.py     | 83 ++++++++++++++++++++-----
 tests/functional/qemu_test/testcase.py  |  8 ++-
 tests/functional/s390x/test_tuxrun.py   |  4 +-
 tests/functional/x86_64/test_tuxrun.py  |  4 +-
 12 files changed, 123 insertions(+), 56 deletions(-)

-- 
2.56.1



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 01/12] tests/functional: update to newer sunxi kernel package
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 15:17   ` Thomas Huth
  2026-11-20 12:14 ` [PATCH 02/12] tests/functional: update sha digests for tuxrun kernels Daniel P. Berrangé
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

The version we currently reference has been deleted from the
the apt.armbian.com host. 6.6.44 is the next oldest build
that is available.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/arm/test_bpim2u.py     | 19 ++++++++++---------
 tests/functional/arm/test_cubieboard.py | 15 ++++++++-------
 tests/functional/arm/test_orangepi.py   | 19 ++++++++++---------
 tests/functional/arm/test_replay.py     | 12 ++++++------
 4 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/tests/functional/arm/test_bpim2u.py b/tests/functional/arm/test_bpim2u.py
index 9192a2fbec4..e6fd80ae9d0 100755
--- a/tests/functional/arm/test_bpim2u.py
+++ b/tests/functional/arm/test_bpim2u.py
@@ -14,9 +14,10 @@
 class BananaPiMachine(LinuxKernelTest):
 
     ASSET_DEB = Asset(
-        ('https://apt.armbian.com/pool/main/l/linux-6.6.16/'
-         'linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb'),
-        '3d968c15b121ede871dce49d13ee7644d6f74b6b121b84c9a40f51b0c80d6d22')
+        ('https://apt.armbian.com/pool/main/l/linux-6.6.44/'
+         'linux-image-current-sunxi_24.8.2_armhf__6.6.44-'
+         'S7213-D53de-P4ceb-C697eH5c21-HK01ba-V014b-B58e9-R448a.deb'),
+        'd960131bed01a8bf48882ff133a37826dfdce84138f9a82e0bea331ba795fe78')
 
     ASSET_INITRD = Asset(
         ('https://github.com/groeck/linux-build-test/raw/'
@@ -37,8 +38,8 @@ class BananaPiMachine(LinuxKernelTest):
     def test_arm_bpim2u(self):
         self.set_machine('bpim2u')
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/'
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/'
                     'sun8i-r40-bananapi-m2-ultra.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
 
@@ -56,8 +57,8 @@ def test_arm_bpim2u(self):
     def test_arm_bpim2u_initrd(self):
         self.set_machine('bpim2u')
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/'
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/'
                     'sun8i-r40-bananapi-m2-ultra.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
         initrd_path = self.uncompress(self.ASSET_INITRD)
@@ -89,8 +90,8 @@ def test_arm_bpim2u_gmac(self):
 
         deb_path = self.ASSET_DEB.fetch()
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/'
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/'
                     'sun8i-r40-bananapi-m2-ultra.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
         rootfs_path = self.uncompress(self.ASSET_ROOTFS)
diff --git a/tests/functional/arm/test_cubieboard.py b/tests/functional/arm/test_cubieboard.py
index b536c2f77a0..eeafc26f90d 100755
--- a/tests/functional/arm/test_cubieboard.py
+++ b/tests/functional/arm/test_cubieboard.py
@@ -13,9 +13,10 @@
 class CubieboardMachine(LinuxKernelTest):
 
     ASSET_DEB = Asset(
-        ('https://apt.armbian.com/pool/main/l/linux-6.6.16/'
-         'linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb'),
-        '3d968c15b121ede871dce49d13ee7644d6f74b6b121b84c9a40f51b0c80d6d22')
+        ('https://apt.armbian.com/pool/main/l/linux-6.6.44/'
+         'linux-image-current-sunxi_24.8.2_armhf__6.6.44-'
+         'S7213-D53de-P4ceb-C697eH5c21-HK01ba-V014b-B58e9-R448a.deb'),
+        'd960131bed01a8bf48882ff133a37826dfdce84138f9a82e0bea331ba795fe78')
 
     ASSET_INITRD = Asset(
         ('https://github.com/groeck/linux-build-test/raw/'
@@ -37,8 +38,8 @@ class CubieboardMachine(LinuxKernelTest):
     def test_arm_cubieboard_initrd(self):
         self.set_machine('cubieboard')
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/' +
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/' +
                     'sun4i-a10-cubieboard.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
         initrd_path = self.uncompress(self.ASSET_INITRD)
@@ -68,8 +69,8 @@ def test_arm_cubieboard_initrd(self):
     def test_arm_cubieboard_sata(self):
         self.set_machine('cubieboard')
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/' +
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/' +
                     'sun4i-a10-cubieboard.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
 
diff --git a/tests/functional/arm/test_orangepi.py b/tests/functional/arm/test_orangepi.py
index 09780236553..c9cfdbd67aa 100755
--- a/tests/functional/arm/test_orangepi.py
+++ b/tests/functional/arm/test_orangepi.py
@@ -16,9 +16,10 @@
 class OrangePiMachine(LinuxKernelTest):
 
     ASSET_DEB = Asset(
-        ('https://apt.armbian.com/pool/main/l/linux-6.6.16/'
-         'linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb'),
-        '3d968c15b121ede871dce49d13ee7644d6f74b6b121b84c9a40f51b0c80d6d22')
+        ('https://apt.armbian.com/pool/main/l/linux-6.6.44/'
+         'linux-image-current-sunxi_24.8.2_armhf__6.6.44-'
+         'S7213-D53de-P4ceb-C697eH5c21-HK01ba-V014b-B58e9-R448a.deb'),
+        'd960131bed01a8bf48882ff133a37826dfdce84138f9a82e0bea331ba795fe78')
 
     ASSET_INITRD = Asset(
         ('https://github.com/groeck/linux-build-test/raw/'
@@ -49,8 +50,8 @@ class OrangePiMachine(LinuxKernelTest):
     def test_arm_orangepi(self):
         self.set_machine('orangepi-pc')
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/' +
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/' +
                     'sun8i-h3-orangepi-pc.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
 
@@ -68,8 +69,8 @@ def test_arm_orangepi(self):
     def test_arm_orangepi_initrd(self):
         self.set_machine('orangepi-pc')
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/' +
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/' +
                     'sun8i-h3-orangepi-pc.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
         initrd_path = self.uncompress(self.ASSET_INITRD)
@@ -99,8 +100,8 @@ def test_arm_orangepi_sd(self):
         self.set_machine('orangepi-pc')
         self.require_netdev('user')
         kernel_path = self.archive_extract(
-            self.ASSET_DEB, member='boot/vmlinuz-6.6.16-current-sunxi')
-        dtb_path = ('usr/lib/linux-image-6.6.16-current-sunxi/' +
+            self.ASSET_DEB, member='boot/vmlinuz-6.6.44-current-sunxi')
+        dtb_path = ('usr/lib/linux-image-6.6.44-current-sunxi/' +
                     'sun8i-h3-orangepi-pc.dtb')
         dtb_path = self.archive_extract(self.ASSET_DEB, member=dtb_path)
         rootfs_path = self.uncompress(self.ASSET_ROOTFS)
diff --git a/tests/functional/arm/test_replay.py b/tests/functional/arm/test_replay.py
index e002e6a2647..ee61f475930 100755
--- a/tests/functional/arm/test_replay.py
+++ b/tests/functional/arm/test_replay.py
@@ -24,10 +24,10 @@ def test_virt(self):
         self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1)
 
     ASSET_CUBIE_KERNEL = Asset(
-        ('https://apt.armbian.com/pool/main/l/linux-6.6.16/'
-         'linux-image-current-sunxi_24.2.1_armhf_'
-         '_6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb'),
-        '3d968c15b121ede871dce49d13ee7644d6f74b6b121b84c9a40f51b0c80d6d22')
+        ('https://apt.armbian.com/pool/main/l/linux-6.6.44/'
+         'linux-image-current-sunxi_24.8.2_armhf__6.6.44-'
+         'S7213-D53de-P4ceb-C697eH5c21-HK01ba-V014b-B58e9-R448a.deb'),
+        'd960131bed01a8bf48882ff133a37826dfdce84138f9a82e0bea331ba795fe78')
 
     ASSET_CUBIE_INITRD = Asset(
         ('https://github.com/groeck/linux-build-test/raw/'
@@ -37,9 +37,9 @@ def test_virt(self):
     def test_cubieboard(self):
         self.set_machine('cubieboard')
         kernel_path = self.archive_extract(self.ASSET_CUBIE_KERNEL,
-            member='boot/vmlinuz-6.6.16-current-sunxi')
+            member='boot/vmlinuz-6.6.44-current-sunxi')
         dtb_path = self.archive_extract(self.ASSET_CUBIE_KERNEL,
-            member='usr/lib/linux-image-6.6.16-current-sunxi/sun4i-a10-cubieboard.dtb')
+            member='usr/lib/linux-image-6.6.44-current-sunxi/sun4i-a10-cubieboard.dtb')
         initrd_path = self.uncompress(self.ASSET_CUBIE_INITRD)
 
         kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 02/12] tests/functional: update sha digests for tuxrun kernels
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 01/12] tests/functional: update to newer sunxi kernel package Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 12:23   ` Marc-André Lureau
  2026-11-20 12:14 ` [PATCH 03/12] tests/functional: update URL to rs6000 firmware Daniel P. Berrangé
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

The images appear to have been regenerated since the recorded
digests no longer match

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/aarch64/test_tuxrun.py | 4 ++--
 tests/functional/s390x/test_tuxrun.py   | 4 ++--
 tests/functional/x86_64/test_tuxrun.py  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/functional/aarch64/test_tuxrun.py b/tests/functional/aarch64/test_tuxrun.py
index 2ff321582d3..6c4367c8a20 100755
--- a/tests/functional/aarch64/test_tuxrun.py
+++ b/tests/functional/aarch64/test_tuxrun.py
@@ -18,10 +18,10 @@ class TuxRunAarch64Test(TuxRunBaselineTest):
 
     ASSET_ARM64_KERNEL = Asset(
         'https://storage.tuxboot.com/kernels/6.18.54/arm64/Image.gz',
-        '39f4633bbcb444267d4d829bd28d8868a287c4c160cda64b0fd23fb090571c4e')
+        'e297f12682af7e88735a0aae38e6fbd137192b516ab5f0fc1a81c4bcc3992e80')
     ASSET_ARM64_VMLINUX = Asset(
         'https://storage.tuxboot.com/kernels/6.18.54/arm64/vmlinux.xz',
-        '6487eb113ef6e841aedab6cb6fa704006377d68f64dd544570aa42f462a52b85')
+        'aa9b984337e975528162ed873cf18a072b27be8e4f48e6cf0723e9b490c63171')
     ASSET_ARM64_ROOTFS = Asset(
         'https://storage.tuxboot.com/buildroot/20260924/arm64/rootfs.ext4.zst',
         '4ab8cec9d1e17dbb1abdf2ae1939ad4f9d0dc2466230f6a119a7c1845cdef0b1')
diff --git a/tests/functional/s390x/test_tuxrun.py b/tests/functional/s390x/test_tuxrun.py
index 1dd662aaaf0..be38fcded2e 100755
--- a/tests/functional/s390x/test_tuxrun.py
+++ b/tests/functional/s390x/test_tuxrun.py
@@ -18,10 +18,10 @@ class TuxRunS390xTest(TuxRunBaselineTest):
 
     ASSET_S390X_KERNEL = Asset(
         'https://storage.tuxboot.com/kernels/6.18.54/s390/bzImage',
-        '5efeb31754b211440e1595ab11355bb006fe78a2c0604ed0a8c55c4598b71aec')
+        'b5022f97e243b8ecd51fc7ce4290a15806ecc51a41edbe777fc0fcdda567269e')
     ASSET_S390X_VMLINUX = Asset(
         'https://storage.tuxboot.com/kernels/6.18.54/s390/vmlinux.xz',
-        '5bbd4d34e0950f88053a9bfd16078896df4b1ee1696fc2ad62488e681a6bdd8e')
+        'cd70050ddb638e81c2f1b96a4629c224aedd36bf8ae3b56b264b070e94642e25')
     ASSET_S390X_ROOTFS = Asset(
         'https://storage.tuxboot.com/buildroot/20260924/s390/rootfs.ext4.zst',
         '5ba18c4d18831c50a0c743990f7bdee1d3b520629d423c55b668d8fbbac9c6f5')
diff --git a/tests/functional/x86_64/test_tuxrun.py b/tests/functional/x86_64/test_tuxrun.py
index 1a1138d16ae..efe907bed82 100755
--- a/tests/functional/x86_64/test_tuxrun.py
+++ b/tests/functional/x86_64/test_tuxrun.py
@@ -18,10 +18,10 @@ class TuxRunX86Test(TuxRunBaselineTest):
 
     ASSET_X86_64_KERNEL = Asset(
         'https://storage.tuxboot.com/kernels/6.18.54/x86_64/bzImage',
-        '24a3ade610c2cc426ff821050de8a35930b0371357d94cc2c334abac6658552b')
+        'ba98a8a07d5f3f3e20119341059c0f0096fda499d30e30049c1ea64553b7e7c2')
     ASSET_X86_64_VMLINUX = Asset(
         'https://storage.tuxboot.com/kernels/6.18.54/x86_64/vmlinux.xz',
-        '77bf44cca48c9c1b9c142e16a2311d58b8ae3462b61bce44bcaf9243b5f26628')
+        'bc8af37608753c6ba47c6fe85f4034188b5f15bb757a0cbd79672c65122278ab')
     ASSET_X86_64_ROOTFS = Asset(
         'https://storage.tuxboot.com/buildroot/20260924/x86_64/rootfs.ext4.zst',
         '8e310455b0244414ccff29c507f7ccfd4032e3587cc405e49ab0322738e3e27c')
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 03/12] tests/functional: update URL to rs6000 firmware
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 01/12] tests/functional: update to newer sunxi kernel package Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 02/12] tests/functional: update sha digests for tuxrun kernels Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 20:44   ` Thomas Huth
  2026-11-20 12:14 ` [PATCH 04/12] tests/functional: add Accept header when downloading assets Daniel P. Berrangé
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

The current mirror URL is throwing permission denied errors,
so switch to an alternate site discoverd via Google.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/ppc/test_40p.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/functional/ppc/test_40p.py b/tests/functional/ppc/test_40p.py
index 4c1c9bad6ec..084fe4c4e54 100755
--- a/tests/functional/ppc/test_40p.py
+++ b/tests/functional/ppc/test_40p.py
@@ -17,8 +17,7 @@ class IbmPrep40pMachine(QemuSystemTest):
     timeout = 60
 
     ASSET_BIOS = Asset(
-        ('http://ftpmirror.your.org/pub/misc/'
-         'ftp.software.ibm.com/rs6000/firmware/'
+        ('https://public.dhe.ibm.com/eserver/pseries/firmware/'
          '7020-40p/P12H0456.IMG'),
         'd957f79c73f760d1455d2286fcd901ed6d06167320eb73511b478a939be25b3f')
     ASSET_NETBSD40 = Asset(
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 04/12] tests/functional: add Accept header when downloading assets
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (2 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 03/12] tests/functional: update URL to rs6000 firmware Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 20:46   ` Thomas Huth
  2026-11-20 12:14 ` [PATCH 05/12] tests/functional: check if we are served an Anubis challenge Daniel P. Berrangé
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

elinux.org is currently triggering an Anubis challenge for requests
to download assets. After comparing the headers that curl sends, it
was narrowed down to the omission of an "Accept" header.

A missing "Accept" header is a rule that Anubis added a year ago
which is known to hit python's urllib:

  https://github.com/TecharoHQ/anubis/issues/1346

the bug indicates the rule was removed by default at that time,
however, rules have evolved further since then and look like they
are hitting our downloads. Adding the header is simple & harmless.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 0abd89e0a38..ffa01aba2fb 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -137,7 +137,16 @@ def _try_to_fetch(self, tmp_cache_file):
         for _retries in range(3):
             try:
                 with tmp_cache_file.open("xb") as dst:
-                    with urllib.request.urlopen(self.url) as resp:
+                    req = urllib.request.Request(
+                        self.url,
+                        headers={
+                            # Workaround Anubis challenge which some sites
+                            # trigger when Accept is missing:
+                            #  https://github.com/TecharoHQ/anubis/issues/1346
+                            "Accept": "*/*",
+                        }
+                    )
+                    with urllib.request.urlopen(req) as resp:
                         copyfileobj(resp, dst)
                         length_hdr = resp.getheader("Content-Length")
 
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 05/12] tests/functional: check if we are served an Anubis challenge
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (3 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 04/12] tests/functional: add Accept header when downloading assets Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 13:01   ` BALATON Zoltan
  2026-11-20 12:14 ` [PATCH 06/12] tests/functional: don't write timestamp unless successful Daniel P. Berrangé
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

If we get an Anubis challenge, we'll detect the problem as a mismatched
sha256 digest, however, it is difficult to diagnose that Anubis was the
root cause. Add a crude check to detect the challenge and give a clear
message in the logs when the download fails.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index ffa01aba2fb..bb7c7d5bb8f 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -244,6 +244,15 @@ def fetch(self):
             self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
 
         if not self._check(tmp_cache_file):
+            # Open in binary mode in case the file is binary
+            # content that can't decode as valid utf-8
+            with open(tmp_cache_file, mode='rb') as fh:
+                f = fh.read(10*1024)
+                if "anubis".encode() in f:
+                    tmp_cache_file.unlink()
+                    raise AssetError(self,
+                                     f"Got Anubis challenge instead of content",
+                                     transient=True)
             tmp_cache_file.unlink()
             raise AssetError(self, f"Hash does not match {self.hash}")
         tmp_cache_file.replace(self.cache_file)
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 06/12] tests/functional: don't write timestamp unless successful
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (4 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 05/12] tests/functional: check if we are served an Anubis challenge Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 07/12] tests/functional: delete tmp file on interrupt Daniel P. Berrangé
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

The current code creates the timestamp file before running
the precache operation, so it remains on disk even after
a download error. This prevents re-trying of downloads to
get the missing files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index bb7c7d5bb8f..51c76993d07 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -307,5 +307,5 @@ def precache_suites(path, cache_tstamp):
         loader = unittest.loader.defaultTestLoader
         tests = loader.loadTestsFromNames([path], None)
 
-        with open(cache_tstamp, "w", encoding='utf-8'):
-            Asset.precache_suite(tests)
+        Asset.precache_suite(tests)
+        Path(cache_tstamp).touch()
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 07/12] tests/functional: delete tmp file on interrupt
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (5 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 06/12] tests/functional: don't write timestamp unless successful Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 08/12] tests/functional: honour make jobs in precache Daniel P. Berrangé
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

If the user interrupts the download, delete the temporary
file so we don't get a long timeout waiting on a stale
download when re-running.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 51c76993d07..5a9a0f37e9a 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -225,8 +225,12 @@ def fetch(self):
         self.log.info("Downloading %s to %s...", self.url, self.cache_file)
         tmp_cache_file = self.cache_file.with_suffix(".download")
 
-        if self._try_to_fetch(tmp_cache_file):
-            return str(self.cache_file)
+        try:
+            if self._try_to_fetch(tmp_cache_file):
+                return str(self.cache_file)
+        except KeyboardInterrupt:
+            tmp_cache_file.unlink()
+            raise
 
         if not os.path.exists(tmp_cache_file):
             raise AssetError(self, "Download retries exceeded", transient=True)
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 08/12] tests/functional: honour make jobs in precache
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (6 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 07/12] tests/functional: delete tmp file on interrupt Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 09/12] tests/functional: don't display stack trace on download fail Daniel P. Berrangé
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

Pass $(NINJAFLAGS) when running precache so that it does not
run in parallel until the user requested a parallel make.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index a1f60802b9b..f983b1ae2dd 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -49,7 +49,7 @@ $(FUNCTIONAL_TARGETS):
 
 .PHONY: check-functional-precache
 check-functional-precache:
-	@$(NINJA) precache-functional
+	@$(NINJA) $(NINJAFLAGS) precache-functional
 	@$(PYTHON) $(SRC_PATH)/scripts/clean_functional_cache.py
 
 .PHONY: check-functional
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 09/12] tests/functional: don't display stack trace on download fail
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (7 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 08/12] tests/functional: honour make jobs in precache Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 10/12] tests/functional: always raise AssetError when download fails Daniel P. Berrangé
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

Just display the short error message which is sufficient to
diagnose the problem and makes the logs far easier to read.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/testcase.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index d4aee359517..8fa0af5a698 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -28,7 +28,7 @@
 from qemu.utils import hvf_available, kvm_available, tcg_available
 
 from .archive import archive_extract
-from .asset import Asset
+from .asset import Asset, AssetError
 from .config import BUILD_DIR, dso_suffix
 from .uncompress import uncompress
 
@@ -256,7 +256,11 @@ def main():
 
         cache = os.environ.get("QEMU_TEST_PRECACHE", None)
         if cache is not None:
-            Asset.precache_suites(test_module, cache)
+            try:
+                Asset.precache_suites(test_module, cache)
+            except AssetError as e:
+                print(f"ERROR: {e}")
+                sys.exit(1)
             return
 
         tr = pycotap.TAPTestRunner(message_log = pycotap.LogMode.LogToError,
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 10/12] tests/functional: always raise AssetError when download fails
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (8 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 09/12] tests/functional: don't display stack trace on download fail Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 11/12] tests/functional: only run pre-cache once per class Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 12/12] tests/functional: optionally display download progress Daniel P. Berrangé
  11 siblings, 0 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

If two processes are downloading the same file, the second will
wait for the first to finish. The second may encounter problems,
however, and raise FileNotFoundError or TimeoutError. The layers
up the stack, however, only expect/handle AssetError.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 5a9a0f37e9a..313efcf7626 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -103,7 +103,9 @@ def _wait_for_other_download(self, tmp_cache_file):
         except:
             if os.path.exists(self.cache_file):
                 return True
-            raise
+            raise AssetError(
+                self, f"Other thread failed download to {tmp_cache_file}",
+                transient=True)
         waittime = lastchange = 600
         while waittime > 0:
             sleep(1)
@@ -113,7 +115,9 @@ def _wait_for_other_download(self, tmp_cache_file):
             except:
                 if os.path.exists(self.cache_file):
                     return True
-                raise
+                raise AssetError(
+                    self, f"Other thread failed download to {tmp_cache_file}",
+                    transient=True)
             if new_size != current_size:
                 lastchange = waittime
                 current_size = new_size
@@ -121,7 +125,8 @@ def _wait_for_other_download(self, tmp_cache_file):
                 return False
 
         self.log.debug("Time out while waiting for %s!", tmp_cache_file)
-        raise TimeoutError(f"Time out while waiting for {tmp_cache_file}")
+        raise AssetError(f"Time out while waiting for {tmp_cache_file}",
+                         transient=True)
 
     def _save_time_stamp(self):
         '''
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 11/12] tests/functional: only run pre-cache once per class
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (9 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 10/12] tests/functional: always raise AssetError when download fails Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  2026-11-20 12:14 ` [PATCH 12/12] tests/functional: optionally display download progress Daniel P. Berrangé
  11 siblings, 0 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

When precaching assets, we iterate over test cases, downloading
all assets in the class containing the test suite. This often
results in iterating over assets in the class multiple times.

If we fail to download an asset from a non-transient problem,
it will not end up in the cache, and so the subsequent iterations
will retry the failed download again wasting time, as well as
making the logs more verbose.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 313efcf7626..7bebdd4d481 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -273,11 +273,13 @@ def fetch(self):
         return str(self.cache_file)
 
     @staticmethod
-    def precache_test(test):
+    def precache_test(test, done):
         '''
         Look for variables starting with "ASSET_" and try to fetch the asset
         that is specified there.
         '''
+        if test.__class__ in done:
+            return
         log = logging.getLogger('qemu-test')
         log.setLevel(logging.DEBUG)
         handler = logging.StreamHandler(sys.stdout)
@@ -295,18 +297,19 @@ def precache_test(test):
                         raise
                     log.error("%s: skipping asset precache", e)
 
+        done[test.__class__] = True
         log.removeHandler(handler)
 
     @staticmethod
-    def precache_suite(suite):
+    def precache_suite(suite, done):
         '''
         Iterate through all tests/suites in a suite and precache their assets
         '''
         for test in suite:
             if isinstance(test, unittest.TestSuite):
-                Asset.precache_suite(test)
+                Asset.precache_suite(test, done)
             elif isinstance(test, unittest.TestCase):
-                Asset.precache_test(test)
+                Asset.precache_test(test, done)
 
     @staticmethod
     def precache_suites(path, cache_tstamp):
@@ -316,5 +319,5 @@ def precache_suites(path, cache_tstamp):
         loader = unittest.loader.defaultTestLoader
         tests = loader.loadTestsFromNames([path], None)
 
-        Asset.precache_suite(tests)
+        Asset.precache_suite(tests, {})
         Path(cache_tstamp).touch()
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 12/12] tests/functional: optionally display download progress
  2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
                   ` (10 preceding siblings ...)
  2026-11-20 12:14 ` [PATCH 11/12] tests/functional: only run pre-cache once per class Daniel P. Berrangé
@ 2026-11-20 12:14 ` Daniel P. Berrangé
  11 siblings, 0 replies; 19+ messages in thread
From: Daniel P. Berrangé @ 2026-11-20 12:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Daniel P. Berrangé,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

If "QEMU_TEST_VERBOSE=1" is set then display the file download
progress. This is not enabled by default since meson buffers
output, but if running the test file directly it can be helpful
to see. This requires the 'tqdm' python package to be present
on the system and will have no effect if missing.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 docs/devel/testing/functional.rst   |  6 ++++++
 tests/functional/qemu_test/asset.py | 29 +++++++++++++++++++++++++++--
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/docs/devel/testing/functional.rst b/docs/devel/testing/functional.rst
index 60a427d175d..8aac3ef9508 100644
--- a/docs/devel/testing/functional.rst
+++ b/docs/devel/testing/functional.rst
@@ -329,6 +329,12 @@ default, but the location can be changed by setting the
 To force the test suite to re-download the cache, even if still valid,
 set the ``QEMU_TEST_REFRESH_CACHE`` environment variable.
 
+To see progress information during the downloads, set ``QEMU_TEST_VERBOSE``
+to ``1``. Since meson buffers output and only display it on completion,
+this is only suitable if running the test precaching directly::
+
+    QEMU_TEST_VERBOSE=1 ./run tests/functional/mips/test_malta.py
+
 Skipping tests
 --------------
 
diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 7bebdd4d481..aa071ea1960 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -18,9 +18,13 @@
 import urllib.request
 from time import sleep
 from pathlib import Path
-from shutil import copyfileobj
 from urllib.error import HTTPError, URLError
 
+try:
+    from tqdm import tqdm
+except:
+    tqdm = None
+
 
 class AssetError(Exception):
     '''This exception will be raised if an asset is not usable'''
@@ -139,6 +143,14 @@ def _save_time_stamp(self):
         self.cache_file.with_suffix(".stamp").write_text(f"{int(time.time())}")
 
     def _try_to_fetch(self, tmp_cache_file):
+        def copyfileprog(prg, src, dst):
+            rd = src.read
+            wr = dst.write
+            while buf := rd(256 * 1024):
+                wr(buf)
+                if prg is not None:
+                    prg.update(len(buf))
+
         for _retries in range(3):
             try:
                 with tmp_cache_file.open("xb") as dst:
@@ -152,8 +164,21 @@ def _try_to_fetch(self, tmp_cache_file):
                         }
                     )
                     with urllib.request.urlopen(req) as resp:
-                        copyfileobj(resp, dst)
                         length_hdr = resp.getheader("Content-Length")
+                        verbose = os.environ.get("QEMU_TEST_VERBOSE", False)
+                        if tqdm is not None and verbose:
+                            args = {
+                                "desc": os.path.basename(self.url)
+                            }
+                            if length_hdr is not None:
+                                args["total"] = int(length_hdr)
+                            prg = tqdm(**args)
+                            try:
+                                copyfileprog(prg, resp, dst)
+                            finally:
+                                prg.close()
+                        else:
+                            copyfileprog(None, resp, dst)
 
                 # Verify downloaded file size against length metadata, if
                 # available.
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 02/12] tests/functional: update sha digests for tuxrun kernels
  2026-11-20 12:14 ` [PATCH 02/12] tests/functional: update sha digests for tuxrun kernels Daniel P. Berrangé
@ 2026-11-20 12:23   ` Marc-André Lureau
  0 siblings, 0 replies; 19+ messages in thread
From: Marc-André Lureau @ 2026-11-20 12:23 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: qemu-devel, Paolo Bonzini, Pierrick Bouvier, Zhao Liu,
	Peter Maydell, Matthew Rosato, Halil Pasic,
	Philippe Mathieu-Daudé, Strahinja Jankovic, Niek Linnenbank,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

On Fri, Nov 20, 2026 at 4:16 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> The images appear to have been regenerated since the recorded
> digests no longer match
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

See also
https://patchew.org/QEMU/20261112133320.418012-2-marcandre.lureau@redhat.com/

> ---
>  tests/functional/aarch64/test_tuxrun.py | 4 ++--
>  tests/functional/s390x/test_tuxrun.py   | 4 ++--
>  tests/functional/x86_64/test_tuxrun.py  | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/tests/functional/aarch64/test_tuxrun.py b/tests/functional/aarch64/test_tuxrun.py
> index 2ff321582d3..6c4367c8a20 100755
> --- a/tests/functional/aarch64/test_tuxrun.py
> +++ b/tests/functional/aarch64/test_tuxrun.py
> @@ -18,10 +18,10 @@ class TuxRunAarch64Test(TuxRunBaselineTest):
>
>      ASSET_ARM64_KERNEL = Asset(
>          'https://storage.tuxboot.com/kernels/6.18.54/arm64/Image.gz',
> -        '39f4633bbcb444267d4d829bd28d8868a287c4c160cda64b0fd23fb090571c4e')
> +        'e297f12682af7e88735a0aae38e6fbd137192b516ab5f0fc1a81c4bcc3992e80')
>      ASSET_ARM64_VMLINUX = Asset(
>          'https://storage.tuxboot.com/kernels/6.18.54/arm64/vmlinux.xz',
> -        '6487eb113ef6e841aedab6cb6fa704006377d68f64dd544570aa42f462a52b85')
> +        'aa9b984337e975528162ed873cf18a072b27be8e4f48e6cf0723e9b490c63171')
>      ASSET_ARM64_ROOTFS = Asset(
>          'https://storage.tuxboot.com/buildroot/20260924/arm64/rootfs.ext4.zst',
>          '4ab8cec9d1e17dbb1abdf2ae1939ad4f9d0dc2466230f6a119a7c1845cdef0b1')
> diff --git a/tests/functional/s390x/test_tuxrun.py b/tests/functional/s390x/test_tuxrun.py
> index 1dd662aaaf0..be38fcded2e 100755
> --- a/tests/functional/s390x/test_tuxrun.py
> +++ b/tests/functional/s390x/test_tuxrun.py
> @@ -18,10 +18,10 @@ class TuxRunS390xTest(TuxRunBaselineTest):
>
>      ASSET_S390X_KERNEL = Asset(
>          'https://storage.tuxboot.com/kernels/6.18.54/s390/bzImage',
> -        '5efeb31754b211440e1595ab11355bb006fe78a2c0604ed0a8c55c4598b71aec')
> +        'b5022f97e243b8ecd51fc7ce4290a15806ecc51a41edbe777fc0fcdda567269e')
>      ASSET_S390X_VMLINUX = Asset(
>          'https://storage.tuxboot.com/kernels/6.18.54/s390/vmlinux.xz',
> -        '5bbd4d34e0950f88053a9bfd16078896df4b1ee1696fc2ad62488e681a6bdd8e')
> +        'cd70050ddb638e81c2f1b96a4629c224aedd36bf8ae3b56b264b070e94642e25')
>      ASSET_S390X_ROOTFS = Asset(
>          'https://storage.tuxboot.com/buildroot/20260924/s390/rootfs.ext4.zst',
>          '5ba18c4d18831c50a0c743990f7bdee1d3b520629d423c55b668d8fbbac9c6f5')
> diff --git a/tests/functional/x86_64/test_tuxrun.py b/tests/functional/x86_64/test_tuxrun.py
> index 1a1138d16ae..efe907bed82 100755
> --- a/tests/functional/x86_64/test_tuxrun.py
> +++ b/tests/functional/x86_64/test_tuxrun.py
> @@ -18,10 +18,10 @@ class TuxRunX86Test(TuxRunBaselineTest):
>
>      ASSET_X86_64_KERNEL = Asset(
>          'https://storage.tuxboot.com/kernels/6.18.54/x86_64/bzImage',
> -        '24a3ade610c2cc426ff821050de8a35930b0371357d94cc2c334abac6658552b')
> +        'ba98a8a07d5f3f3e20119341059c0f0096fda499d30e30049c1ea64553b7e7c2')
>      ASSET_X86_64_VMLINUX = Asset(
>          'https://storage.tuxboot.com/kernels/6.18.54/x86_64/vmlinux.xz',
> -        '77bf44cca48c9c1b9c142e16a2311d58b8ae3462b61bce44bcaf9243b5f26628')
> +        'bc8af37608753c6ba47c6fe85f4034188b5f15bb757a0cbd79672c65122278ab')
>      ASSET_X86_64_ROOTFS = Asset(
>          'https://storage.tuxboot.com/buildroot/20260924/x86_64/rootfs.ext4.zst',
>          '8e310455b0244414ccff29c507f7ccfd4032e3587cc405e49ab0322738e3e27c')
> --
> 2.56.1
>
>


-- 
Marc-André Lureau


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 05/12] tests/functional: check if we are served an Anubis challenge
  2026-11-20 12:14 ` [PATCH 05/12] tests/functional: check if we are served an Anubis challenge Daniel P. Berrangé
@ 2026-11-20 13:01   ` BALATON Zoltan
  2026-11-20 13:06     ` BALATON Zoltan
  0 siblings, 1 reply; 19+ messages in thread
From: BALATON Zoltan @ 2026-11-20 13:01 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: qemu-devel, Paolo Bonzini, Pierrick Bouvier, Zhao Liu,
	Peter Maydell, Matthew Rosato, Halil Pasic,
	Philippe Mathieu-Daudé, Strahinja Jankovic, Niek Linnenbank,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]

On Fri, 20 Nov 2026, Daniel P. Berrangé wrote:
> If we get an Anubis challenge, we'll detect the problem as a mismatched
> sha256 digest, however, it is difficult to diagnose that Anubis was the
> root cause. Add a crude check to detect the challenge and give a clear
> message in the logs when the download fails.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> tests/functional/qemu_test/asset.py | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
> index ffa01aba2fb..bb7c7d5bb8f 100644
> --- a/tests/functional/qemu_test/asset.py
> +++ b/tests/functional/qemu_test/asset.py
> @@ -244,6 +244,15 @@ def fetch(self):
>             self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, e)
>
>         if not self._check(tmp_cache_file):
> +            # Open in binary mode in case the file is binary
> +            # content that can't decode as valid utf-8
> +            with open(tmp_cache_file, mode='rb') as fh:
> +                f = fh.read(10*1024)
> +                if "anubis".encode() in f:
> +                    tmp_cache_file.unlink()
> +                    raise AssetError(self,
> +                                     f"Got Anubis challenge instead of content",
> +                                     transient=True)
>             tmp_cache_file.unlink()

I don't know python but there's already tmp_cache_file.unlink() here. Is 
the one above needed too?

Regards,
BALATON Zoltan

>             raise AssetError(self, f"Hash does not match {self.hash}")
>         tmp_cache_file.replace(self.cache_file)
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 05/12] tests/functional: check if we are served an Anubis challenge
  2026-11-20 13:01   ` BALATON Zoltan
@ 2026-11-20 13:06     ` BALATON Zoltan
  0 siblings, 0 replies; 19+ messages in thread
From: BALATON Zoltan @ 2026-11-20 13:06 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: qemu-devel, Paolo Bonzini, Pierrick Bouvier, Zhao Liu,
	Peter Maydell, Matthew Rosato, Halil Pasic,
	Philippe Mathieu-Daudé, Strahinja Jankovic, Niek Linnenbank,
	Michael S. Tsirkin, Alex Bennée, qemu-s390x, qemu-arm,
	Christian Borntraeger, qemu-ppc, Thomas Huth,
	Hervé Poussineau, Eric Farman

[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

On Fri, 20 Nov 2026, BALATON Zoltan wrote:
> On Fri, 20 Nov 2026, Daniel P. Berrangé wrote:
>> If we get an Anubis challenge, we'll detect the problem as a mismatched
>> sha256 digest, however, it is difficult to diagnose that Anubis was the
>> root cause. Add a crude check to detect the challenge and give a clear
>> message in the logs when the download fails.
>> 
>> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>> ---
>> tests/functional/qemu_test/asset.py | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>> 
>> diff --git a/tests/functional/qemu_test/asset.py 
>> b/tests/functional/qemu_test/asset.py
>> index ffa01aba2fb..bb7c7d5bb8f 100644
>> --- a/tests/functional/qemu_test/asset.py
>> +++ b/tests/functional/qemu_test/asset.py
>> @@ -244,6 +244,15 @@ def fetch(self):
>>             self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file, 
>> e)
>>
>>         if not self._check(tmp_cache_file):
>> +            # Open in binary mode in case the file is binary
>> +            # content that can't decode as valid utf-8
>> +            with open(tmp_cache_file, mode='rb') as fh:
>> +                f = fh.read(10*1024)
>> +                if "anubis".encode() in f:
>> +                    tmp_cache_file.unlink()
>> +                    raise AssetError(self,
>> +                                     f"Got Anubis challenge instead of 
>> content",
>> +                                     transient=True)
>>             tmp_cache_file.unlink()
>
> I don't know python but there's already tmp_cache_file.unlink() here. Is the 
> one above needed too?

I got it, raise exits so need to unlink before.

Regards,
BALATON Zoltan

>>             raise AssetError(self, f"Hash does not match {self.hash}")
>>         tmp_cache_file.replace(self.cache_file)
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/12] tests/functional: update to newer sunxi kernel package
  2026-11-20 12:14 ` [PATCH 01/12] tests/functional: update to newer sunxi kernel package Daniel P. Berrangé
@ 2026-11-20 15:17   ` Thomas Huth
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2026-11-20 15:17 UTC (permalink / raw)
  To: Daniel P. Berrangé, qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Michael S. Tsirkin,
	Alex Bennée, qemu-s390x, qemu-arm, Christian Borntraeger,
	qemu-ppc, Thomas Huth, Hervé Poussineau, Eric Farman

Am 20.11.26 um 13:14 schrieb Daniel P. Berrangé:
> The version we currently reference has been deleted from the
> the apt.armbian.com host. 6.6.44 is the next oldest build
> that is available.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/functional/arm/test_bpim2u.py     | 19 ++++++++++---------
>   tests/functional/arm/test_cubieboard.py | 15 ++++++++-------
>   tests/functional/arm/test_orangepi.py   | 19 ++++++++++---------
>   tests/functional/arm/test_replay.py     | 12 ++++++------
>   4 files changed, 34 insertions(+), 31 deletions(-)
Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 03/12] tests/functional: update URL to rs6000 firmware
  2026-11-20 12:14 ` [PATCH 03/12] tests/functional: update URL to rs6000 firmware Daniel P. Berrangé
@ 2026-11-20 20:44   ` Thomas Huth
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2026-11-20 20:44 UTC (permalink / raw)
  To: Daniel P. Berrangé, qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Michael S. Tsirkin,
	Alex Bennée, qemu-s390x, qemu-arm, Christian Borntraeger,
	qemu-ppc, Thomas Huth, Hervé Poussineau, Eric Farman

Am 20.11.26 um 13:14 schrieb Daniel P. Berrangé:
> The current mirror URL is throwing permission denied errors,
> so switch to an alternate site discoverd via Google.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/functional/ppc/test_40p.py | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tests/functional/ppc/test_40p.py b/tests/functional/ppc/test_40p.py
> index 4c1c9bad6ec..084fe4c4e54 100755
> --- a/tests/functional/ppc/test_40p.py
> +++ b/tests/functional/ppc/test_40p.py
> @@ -17,8 +17,7 @@ class IbmPrep40pMachine(QemuSystemTest):
>       timeout = 60
>   
>       ASSET_BIOS = Asset(
> -        ('http://ftpmirror.your.org/pub/misc/'
> -         'ftp.software.ibm.com/rs6000/firmware/'
> +        ('https://public.dhe.ibm.com/eserver/pseries/firmware/'
>            '7020-40p/P12H0456.IMG'),
>           'd957f79c73f760d1455d2286fcd901ed6d06167320eb73511b478a939be25b3f')
>       ASSET_NETBSD40 = Asset(

Tested-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 04/12] tests/functional: add Accept header when downloading assets
  2026-11-20 12:14 ` [PATCH 04/12] tests/functional: add Accept header when downloading assets Daniel P. Berrangé
@ 2026-11-20 20:46   ` Thomas Huth
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas Huth @ 2026-11-20 20:46 UTC (permalink / raw)
  To: Daniel P. Berrangé, qemu-devel
  Cc: Paolo Bonzini, Pierrick Bouvier, Zhao Liu, Peter Maydell,
	Matthew Rosato, Halil Pasic, Philippe Mathieu-Daudé,
	Strahinja Jankovic, Niek Linnenbank, Michael S. Tsirkin,
	Alex Bennée, qemu-s390x, qemu-arm, Christian Borntraeger,
	qemu-ppc, Thomas Huth, Hervé Poussineau, Eric Farman

Am 20.11.26 um 13:14 schrieb Daniel P. Berrangé:
> elinux.org is currently triggering an Anubis challenge for requests
> to download assets. After comparing the headers that curl sends, it
> was narrowed down to the omission of an "Accept" header.
> 
> A missing "Accept" header is a rule that Anubis added a year ago
> which is known to hit python's urllib:
> 
>    https://github.com/TecharoHQ/anubis/issues/1346
> 
> the bug indicates the rule was removed by default at that time,
> however, rules have evolved further since then and look like they
> are hitting our downloads. Adding the header is simple & harmless.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>   tests/functional/qemu_test/asset.py | 11 ++++++++++-
>   1 file changed, 10 insertions(+), 1 deletion(-)
Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-11-20 20:47 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 12:14 [PATCH 00/12] tests/functional: misc fixes to functional test suite Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 01/12] tests/functional: update to newer sunxi kernel package Daniel P. Berrangé
2026-11-20 15:17   ` Thomas Huth
2026-11-20 12:14 ` [PATCH 02/12] tests/functional: update sha digests for tuxrun kernels Daniel P. Berrangé
2026-11-20 12:23   ` Marc-André Lureau
2026-11-20 12:14 ` [PATCH 03/12] tests/functional: update URL to rs6000 firmware Daniel P. Berrangé
2026-11-20 20:44   ` Thomas Huth
2026-11-20 12:14 ` [PATCH 04/12] tests/functional: add Accept header when downloading assets Daniel P. Berrangé
2026-11-20 20:46   ` Thomas Huth
2026-11-20 12:14 ` [PATCH 05/12] tests/functional: check if we are served an Anubis challenge Daniel P. Berrangé
2026-11-20 13:01   ` BALATON Zoltan
2026-11-20 13:06     ` BALATON Zoltan
2026-11-20 12:14 ` [PATCH 06/12] tests/functional: don't write timestamp unless successful Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 07/12] tests/functional: delete tmp file on interrupt Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 08/12] tests/functional: honour make jobs in precache Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 09/12] tests/functional: don't display stack trace on download fail Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 10/12] tests/functional: always raise AssetError when download fails Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 11/12] tests/functional: only run pre-cache once per class Daniel P. Berrangé
2026-11-20 12:14 ` [PATCH 12/12] tests/functional: optionally display download progress Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.