Skip to content

tests/functional: various improvements wrt assets/scratch files

Daniel P. Berrangé qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest32 patches 4 repliesIn review
  2. v231 patches 32 repliesSuperseded
  3. v122 patches 40 repliesSuperseded

Changes in v3 from the cover letter

* Rebase and update for recently changed/added tests
* Drop mistaken submodule update
* Fix syntax error with has_cmd usage
* Fix undefined variable error in virtio gpu tests
* Fix whitespace issues
* Fix typos
* Add patch to fix execute perms on some recent tests

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32tests/functional: add execute permission to aspeed teststests/functional/test_aarch64_aspeed.py tests/functional/test_arm_aspeed_ast1030.py tests/functional/test_arm_aspeed_ast2500.py +4 more+0 -01 reply
2/32tests/functional: remove many unused importstests/functional/qemu_test/asset.py tests/functional/qemu_test/tesseract.py tests/functional/qemu_test/tuxruntest.py +13 more+7 -190 replies
3/32tests/functional: resolve str(Asset) to cache file pathtests/functional/qemu_test/asset.py+3 -01 reply
4/32tests/functional: remove duplicated 'which' function impltests/functional/qemu_test/__init__.py tests/functional/qemu_test/cmd.py tests/functional/test_acpi_bits.py +1 more+13 -250 replies
5/32tests/functional: simplify 'which' implementationtests/functional/qemu_test/cmd.py+1 -10 replies
6/32tests/functional: drop 'tesseract_available' helpertests/functional/qemu_test/tesseract.py tests/functional/test_m68k_nextcube.py+4 -161 reply
7/32tests/functional: introduce some helpful decoratorstests/functional/qemu_test/__init__.py tests/functional/qemu_test/decorators.py+110 -00 replies
8/32tests/functional: switch to new test skip decoratorstests/functional/test_acpi_bits.py tests/functional/test_arm_aspeed_ast2600.py tests/functional/test_arm_bflt.py +13 more+61 -1220 replies
9/32tests/functional: drop 'has_cmd' and 'has_cmds' helperstests/functional/qemu_test/__init__.py tests/functional/qemu_test/cmd.py tests/functional/qemu_test/tuxruntest.py+9 -570 replies
10/32tests/functional: add helpers for building file pathstests/functional/qemu_test/testcase.py+95 -00 replies
11/32tests/functional: switch over to using self.log_file(...)tests/functional/qemu_test/testcase.py tests/functional/test_virtio_gpu.py+5 -80 replies
12/32tests/functional: switch over to using self.build_file(...)tests/functional/qemu_test/cmd.py tests/functional/qemu_test/testcase.py tests/functional/test_aarch64_virt.py +1 more+9 -160 replies
13/32tests/functional: switch over to using self.data_file(...)tests/functional/test_acpi_bits.py+7 -150 replies
14/32tests/functional: switch over to using self.scratch_file()tests/functional/qemu_test/linuxkernel.py tests/functional/qemu_test/tuxruntest.py tests/functional/test_aarch64_aspeed.py +42 more+118 -1390 replies
15/32tests/functional: remove redundant 'rmtree' calltests/functional/test_sh4eb_r2d.py+0 -30 replies
16/32tests/functional: move archive handling into new archive.py filetests/functional/qemu_test/archive.py tests/functional/qemu_test/utils.py+34 -200 replies
17/32tests/functional: move uncompress handling into new uncompress.py filetests/functional/qemu_test/uncompress.py tests/functional/qemu_test/utils.py+38 -250 replies
18/32tests/functional: add common zip_extract helpertests/functional/qemu_test/archive.py+8 -00 replies
19/32tests/functional: add common deb_extract helpertests/functional/qemu_test/archive.py tests/functional/qemu_test/linuxkernel.py+17 -90 replies
20/32tests/functional: let cpio_extract accept filenamestests/functional/qemu_test/archive.py+11 -50 replies
21/32tests/functional: add a generalized archive_extracttests/functional/qemu_test/__init__.py tests/functional/qemu_test/archive.py+59 -00 replies
22/32tests/functional: add 'archive_extract' to QemuBaseTesttests/functional/qemu_test/testcase.py+32 -00 replies
23/32tests/functional: convert tests to new archive_extract helpertests/functional/qemu_test/linuxkernel.py tests/functional/test_aarch64_aspeed.py tests/functional/test_aarch64_raspi3.py +34 more+134 -2050 replies
24/32tests/functional: add a generalized uncompress helpertests/functional/qemu_test/__init__.py tests/functional/qemu_test/uncompress.py+48 -00 replies
25/32tests/functional: add 'uncompress' to QemuBaseTesttests/functional/qemu_test/testcase.py+25 -00 replies
26/32tests/functional: convert tests to new uncompress helpertests/functional/test_aarch64_raspi4.py tests/functional/test_aarch64_sbsaref.py tests/functional/test_alpha_clipper.py +11 more+31 -880 replies
27/32tests/functional: drop back compat imports from utils.pytests/functional/qemu_test/utils.py+0 -50 replies
28/32tests/functional: replace 'run_cmd' with subprocess helperstests/functional/qemu_test/archive.py tests/functional/qemu_test/tesseract.py tests/functional/qemu_test/testcase.py +3 more+41 -300 replies
29/32tests/functional: remove now unused 'run_cmd' helpertests/functional/qemu_test/__init__.py tests/functional/qemu_test/cmd.py+1 -120 replies
30/32tests/functional: skip tests if assets are not availabletests/functional/qemu_test/asset.py tests/functional/qemu_test/testcase.py+18 -10 replies
31/32tests/functional: ignore errors when caching assets, except for 404tests/functional/qemu_test/asset.py+13 -10 replies
32/32MAINTAINERS: add myself as reviewer for functional test suiteMAINTAINERS+1 -01 reply

Reviews trailers per patch

All 32 patches have a Reviewed-by or Acked-by.

PatchThomas HuthRichard Henderson
1/32R-b
2/32R-b
3/32R-b
4/32R-b
5/32R-b R-b
6/32R-b
7/32R-b
8/32R-b
9/32R-b
10/32R-b
11/32R-b
12/32R-b
13/32R-b
14/32R-b
15/32R-b
16/32R-b
17/32R-b
18/32R-b
19/32R-b
20/32R-b
21/32R-b
22/32R-b
23/32R-b
24/32R-b
25/32R-b
26/32R-b
27/32R-b
28/32R-b
29/32R-b
30/32R-b
31/32R-b
32/32R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/32] tests/functional: various improvements wrt assets/scratch files

This series is an attempt to bring a little more guaranteed order to asset and scratch file handling in the functional tests. The main highlights are:

* Add custom @skipXXXXX decorators for common scenarios present in QEMU tests

* Add helpers for creating file paths for various well known types of data, or well known locations, to avoid adhoc path manipulation

* Add helpers to simplify uncompressing and extracting archives, from files downloaded as assets

The series overall has a neutral diffstat, but if you look at just test files, as opposed to the shared infra, you'll see a significant reduction of lines of code in the tests, and I believe its easier to read them with less boilerplate.

This is based on:

     https://gitlab.com/thuth/qemu.git tags/pull-request-2024-12-11

Changes in v3:

* Rebase and update for recently changed/added tests
* Drop mistaken submodule update
* Fix syntax error with has_cmd usage
* Fix undefined variable error in virtio gpu tests
* Fix whitespace issues
* Fix typos
* Add patch to fix execute perms on some recent tests

Changes in v2:

* Put archive & uncompress helpers in their own files
* Have archive_extract & uncompress directly handle assets and format detection
* Drop has_cmd/has_cmds helpers in favour of 'which'
* Drop obsolete tessract version check
* Simplify 'which' impl
* Replace 'run_cmd' with direct use of subprocess
* Remove even more unused imports
* Gracefully handle asset download failure by skipping tests
* Drop redundant hardcoded ./contrib path in virtio GPU test
* Various docs improvements to decorators
* Drop formatting change to import statements

Daniel P. Berrangé (32):
tests/functional: add execute permission to aspeed tests tests/functional: remove many unused imports tests/functional: resolve str(Asset) to cache file path tests/functional: remove duplicated 'which' function impl tests/functional: simplify 'which' implementation tests/functional: drop 'tesseract_available' helper tests/functional: introduce some helpful decorators tests/functional: switch to new test skip decorators tests/functional: drop 'has_cmd' and 'has_cmds' helpers tests/functional: add helpers for building file paths tests/functional: switch over to using self.log_file(...) tests/functional: switch over to using self.build_file(...) tests/functional: switch over to using self.data_file(...) tests/functional: switch over to using self.scratch_file() tests/functional: remove redundant 'rmtree' call tests/functional: move archive handling into new archive.py file tests/functional: move uncompress handling into new uncompress.py file tests/functional: add common zip_extract helper tests/functional: add common deb_extract helper tests/functional: let cpio_extract accept filenames tests/functional: add a generalized archive_extract tests/functional: add 'archive_extract' to QemuBaseTest tests/functional: convert tests to new archive_extract helper tests/functional: add a generalized uncompress helper tests/functional: add 'uncompress' to QemuBaseTest tests/functional: convert tests to new uncompress helper tests/functional: drop back compat imports from utils.py tests/functional: replace 'run_cmd' with subprocess helpers tests/functional: remove now unused 'run_cmd' helper tests/functional: skip tests if assets are not available tests/functional: ignore errors when caching assets, except for 404
MAINTAINERS: add myself as reviewer for functional test suite

 MAINTAINERS                                   |   1 +
 tests/functional/qemu_test/__init__.py        |   9 +-
 tests/functional/qemu_test/archive.py         | 117 ++++++++++
 tests/functional/qemu_test/asset.py           |  26 ++-
 tests/functional/qemu_test/cmd.py             |  76 ++-----
 tests/functional/qemu_test/decorators.py      | 107 +++++++++
 tests/functional/qemu_test/linuxkernel.py     |  29 +--
 tests/functional/qemu_test/tesseract.py       |  21 +-
 tests/functional/qemu_test/testcase.py        | 205 ++++++++++++++++--
 tests/functional/qemu_test/tuxruntest.py      |  19 +-
 tests/functional/qemu_test/uncompress.py      |  83 +++++++
 tests/functional/qemu_test/utils.py           |  45 ----
 tests/functional/test_aarch64_aspeed.py       |  23 +-
 tests/functional/test_aarch64_raspi3.py       |   9 +-
 tests/functional/test_aarch64_raspi4.py       |  21 +-
 tests/functional/test_aarch64_sbsaref.py      |  12 +-
 .../functional/test_aarch64_sbsaref_alpine.py |   1 -
 .../test_aarch64_sbsaref_freebsd.py           |   1 -
 tests/functional/test_aarch64_virt.py         |  14 +-
 tests/functional/test_acpi_bits.py            | 124 ++++-------
 tests/functional/test_alpha_clipper.py        |   6 +-
 tests/functional/test_arm_aspeed_ast1030.py   |  18 +-
 tests/functional/test_arm_aspeed_ast2500.py   |   8 +-
 tests/functional/test_arm_aspeed_ast2600.py   |  14 +-
 tests/functional/test_arm_aspeed_palmetto.py  |   0
 tests/functional/test_arm_aspeed_rainier.py   |  11 +-
 tests/functional/test_arm_aspeed_romulus.py   |   0
 tests/functional/test_arm_bflt.py             |  13 +-
 tests/functional/test_arm_bpim2u.py           |  44 ++--
 tests/functional/test_arm_canona1100.py       |  10 +-
 tests/functional/test_arm_collie.py           |   2 +-
 tests/functional/test_arm_cubieboard.py       |  40 ++--
 tests/functional/test_arm_emcraft_sf2.py      |   2 +-
 tests/functional/test_arm_integratorcp.py     |  28 +--
 tests/functional/test_arm_orangepi.py         |  60 +++--
 tests/functional/test_arm_raspi2.py           |  21 +-
 tests/functional/test_arm_smdkc210.py         |  18 +-
 tests/functional/test_arm_sx1.py              |   2 +-
 tests/functional/test_arm_vexpress.py         |  10 +-
 tests/functional/test_linux_initrd.py         |   7 +-
 tests/functional/test_m68k_mcf5208evb.py      |   8 +-
 tests/functional/test_m68k_nextcube.py        |  24 +-
 tests/functional/test_m68k_q800.py            |   5 +-
 .../functional/test_microblaze_s3adsp1800.py  |   9 +-
 .../test_microblazeel_s3adsp1800.py           |  10 +-
 tests/functional/test_mips64el_fuloong2e.py   |  10 +-
 tests/functional/test_mips64el_loongson3v.py  |   8 +-
 tests/functional/test_mips64el_malta.py       |  45 ++--
 tests/functional/test_mips_malta.py           |  19 +-
 tests/functional/test_mipsel_malta.py         |  24 +-
 tests/functional/test_or1k_sim.py             |   7 +-
 tests/functional/test_ppc64_e500.py           |   7 +-
 tests/functional/test_ppc64_hv.py             |  39 +---
 tests/functional/test_ppc64_tuxrun.py         |   7 +-
 tests/functional/test_ppc_40p.py              |   7 +-
 tests/functional/test_ppc_amiga.py            |  20 +-
 tests/functional/test_ppc_bamboo.py           |  15 +-
 tests/functional/test_ppc_mac.py              |   8 +-
 tests/functional/test_ppc_mpc8544ds.py        |   8 +-
 tests/functional/test_ppc_virtex_ml507.py     |  10 +-
 tests/functional/test_rx_gdbsim.py            |  13 +-
 tests/functional/test_s390x_ccw_virtio.py     |   6 +-
 tests/functional/test_s390x_topology.py       |   7 +-
 tests/functional/test_sh4_r2d.py              |  14 +-
 tests/functional/test_sh4eb_r2d.py            |  14 +-
 tests/functional/test_sparc64_sun4u.py        |  11 +-
 tests/functional/test_sparc_sun4m.py          |   7 +-
 tests/functional/test_virtio_gpu.py           |  16 +-
 tests/functional/test_xtensa_lx60.py          |   8 +-
 69 files changed, 887 insertions(+), 756 deletions(-)
 create mode 100644 tests/functional/qemu_test/archive.py
 create mode 100644 tests/functional/qemu_test/decorators.py
 create mode 100644 tests/functional/qemu_test/uncompress.py
 mode change 100644 => 100755 tests/functional/test_aarch64_aspeed.py
 mode change 100644 => 100755 tests/functional/test_arm_aspeed_ast1030.py
 mode change 100644 => 100755 tests/functional/test_arm_aspeed_ast2500.py
 mode change 100644 => 100755 tests/functional/test_arm_aspeed_ast2600.py
 mode change 100644 => 100755 tests/functional/test_arm_aspeed_palmetto.py
 mode change 100644 => 100755 tests/functional/test_arm_aspeed_rainier.py
 mode change 100644 => 100755 tests/functional/test_arm_aspeed_romulus.py
Signature · 1 line
2.46.0