Skip to content

test/functional: improve functional test debugging & fix tuxrun

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest18 patches 2 repliesIn review
  2. v115 patches 20 repliesSuperseded

Changes in v2 from the cover letter

- Changed console interaction to forbid 'failure_message' without 'success_message'
- Reword console interaction log messages
- Avoid stack trace when seeing early failure
- Rewrote comment in acpi bits test
- Avoid duplicate os.environ access

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18tests/functional: fix mips64el test to honour workdirtests/functional/test_mips64el_malta.py+1 -10 replies
2/18tests/functional: automatically clean up scratch files after testsdocs/devel/testing/functional.rst tests/functional/qemu_test/testcase.py+15 -50 replies
3/18tests/functional: remove "AVOCADO" from env variable nametests/functional/test_mips64el_malta.py+1 -10 replies
4/18tests/functional: remove todo wrt avocado.utils.wait_fortests/functional/test_m68k_nextcube.py+1 -20 replies
5/18tests/functional: remove leftover :avocado: tagstests/functional/test_arm_bpim2u.py tests/functional/test_arm_orangepi.py+0 -470 replies
6/18tests/functional: remove obsolete reference to avocado bugtests/functional/qemu_test/tuxruntest.py+0 -10 replies
7/18tests/functional: remove comments talking about avocadotests/functional/test_acpi_bits.py+6 -70 replies
8/18tests/functional: honour self.workdir in ACPI bits teststests/functional/test_acpi_bits.py+13 -310 replies
9/18tests/functional: put QEMUMachine logs in testcase log directorytests/functional/qemu_test/testcase.py+3 -20 replies
10/18tests/functional: honour requested test VM name in QEMUMachinetests/functional/qemu_test/testcase.py+1 -00 replies
11/18tests/functional: enable debug logging for QEMUMachinetests/functional/qemu_test/testcase.py+6 -01 reply
12/18tests/functional: logs details of console interaction operationstests/functional/qemu_test/cmd.py+3 -00 replies
13/18tests/functional: don't try to wait for the empty stringtests/functional/test_virtio_gpu.py+1 -20 replies
14/18tests/functional: require non-NULL success_message for console waittests/functional/qemu_test/cmd.py+7 -20 replies
15/18tests/functional: rewrite console handling to be bytewisetests/functional/qemu_test/cmd.py+64 -150 replies
16/18tests/functional: remove time.sleep usage from tuxrun teststests/functional/qemu_test/tuxruntest.py+6 -100 replies
17/18tests/functional: add a QMP backdoor for debugging stalled testsdocs/devel/testing/functional.rst tests/functional/qemu_test/testcase.py+17 -00 replies
18/18tests/functional: avoid accessing log_filename on earlier failurestests/functional/qemu_test/testcase.py+6 -40 replies

Reviews trailers per patch

10 of 18 patches have a Reviewed-by or Acked-by.

PatchAlex BennéePhilippe Mathieu-DaudéThomas Huth
1/18R-b R-b
2/18R-b
3/18R-b R-b
4/18R-b
5/18R-b
6/18R-b
7/18
8/18R-b
9/18R-b
10/18R-b
11/18T-b R-b
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/18] test/functional: improve functional test debugging & fix tuxrun

This started out as a series to get rid of the many GBs of temp files the functional tests leave behind. Then it expanded into improving the functional test debugging by ensuring we preserve the QEMU stdout/stderr log file created by the QEMUMachine class. In the course of doing that I encountered some other minor points worth fixing, and then got side tracked into looking at the tuxrun hangs with aarch64be. Investigating the latter exposed some further holes in the debugging story prompting yet more patches, as well as a final solution for tuxrun. So this series does:

* Purge all scratch files created by tests
* Preserve the stdout/stderr log file
* Capture debug log messages on QEMUMachine
* Provide a QMP backdoor for debugging stuck QEMUs
* Enhance console handling for partial line matches
* Fix the tuxrun tests by eliminating sleeps

There's quite alot of code here, but at the same time it feels like the kind of stuff that'll be valuable either in the 9.2 release, or in the soon to exist 9.2 stable branch.

NB, with this series applied Thomas' tuxrun conversion to functional testing survives 200 iterations on my machine, whereas it would reliably hang in < 20, and often in < 10, before.

Changed in v2:

- Changed console interaction to forbid 'failure_message' without 'success_message'
- Reword console interaction log messages
- Avoid stack trace when seeing early failure
- Rewrote comment in acpi bits test
- Avoid duplicate os.environ access

Daniel P. Berrangé (18):
tests/functional: fix mips64el test to honour workdir tests/functional: automatically clean up scratch files after tests tests/functional: remove "AVOCADO" from env variable name tests/functional: remove todo wrt avocado.utils.wait_for tests/functional: remove leftover :avocado: tags tests/functional: remove obsolete reference to avocado bug tests/functional: remove comments talking about avocado tests/functional: honour self.workdir in ACPI bits tests tests/functional: put QEMUMachine logs in testcase log directory tests/functional: honour requested test VM name in QEMUMachine tests/functional: enable debug logging for QEMUMachine tests/functional: logs details of console interaction operations tests/functional: don't try to wait for the empty string tests/functional: require non-NULL success_message for console wait tests/functional: rewrite console handling to be bytewise tests/functional: remove time.sleep usage from tuxrun tests tests/functional: add a QMP backdoor for debugging stalled tests tests/functional: avoid accessing log_filename on earlier failures

 docs/devel/testing/functional.rst        | 16 +++++
 tests/functional/qemu_test/cmd.py        | 89 +++++++++++++++++++-----
 tests/functional/qemu_test/testcase.py   | 43 +++++++++---
 tests/functional/qemu_test/tuxruntest.py | 17 ++---
 tests/functional/test_acpi_bits.py       | 57 +++++----------
 tests/functional/test_arm_bpim2u.py      | 20 ------
 tests/functional/test_arm_orangepi.py    | 27 -------
 tests/functional/test_m68k_nextcube.py   |  3 +-
 tests/functional/test_mips64el_malta.py  |  4 +-
 tests/functional/test_virtio_gpu.py      |  3 +-
 10 files changed, 150 insertions(+), 129 deletions(-)
Signature · 1 line
2.46.0