Skip to content

tests/qtest: fix the disk tests on a host with a small /tmp

Denis V. Lunev qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7tests/qtest/libqos: let mkqcow2() report failuretests/qtest/libqos/libqos.c tests/qtest/libqos/libqos.h tests/qtest/virtio-scsi-test.c+7 -40 replies
2/7tests/qtest/ide-test: skip when the scratch files cannot be createdtests/qtest/ide-test.c+23 -60 replies
3/7tests/qtest/ahci-test: skip when the scratch files cannot be createdtests/qtest/ahci-test.c+37 -110 replies
4/7tests/qtest/hd-geo-test: skip when the scratch file cannot be createdtests/qtest/hd-geo-test.c+12 -40 replies
5/7tests/qtest/libqtest: create images with a byte-precise sizetests/qtest/libqtest.c tests/qtest/libqtest.h+19 -20 replies
6/7tests/qtest/ide-test: build the shared disks with qemu-imgtests/qtest/ide-test.c+54 -150 replies
7/7tests/qtest/hd-geo-test: build the test images with qemu-imgtests/qtest/hd-geo-test.c+86 -430 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] tests/qtest: fix the disk tests on a host with a small /tmp

John reported ide-test dying at startup in the NetBSD VM:

ERROR:../src/tests/qtest/ide-test.c:1260:main: assertion failed:
(ret == 0)

The hypothesys is that the ftruncate() of a 64 MiB scratch image. NetBSD mounts /tmp as a tmpfs sized at 25% of RAM and charges a file its full length themoment it is extended, so a sparse image is not free there and the call returns ENOSPC. The assert dates to 2013, nothing regressed.

The series is designed to do two things:
* reduce the amount of space needed switching to QCOW2
* tolerate the failure skipping the test if there is not enough space

Patches 1-4 skip instead of aborting, the way hd-geo-test has since a0d6d7454a. Patches 5-7 build the images with qemu-img where only the virtual size matters: peak scratch space goes from 129 MiB to 1.6 MiB for ide-test and from 4126 MiB to 1.5 MiB for hd-geo-test.

Hope this should help. John, can you give a try to this in the test? I do not have NetBSD handy and will start with this tomorrow if you will share guest config.

Denis V. Lunev (7):
tests/qtest/libqos: let mkqcow2() report failure tests/qtest/ide-test: skip when the scratch files cannot be created tests/qtest/ahci-test: skip when the scratch files cannot be created tests/qtest/hd-geo-test: skip when the scratch file cannot be created tests/qtest/libqtest: create images with a byte-precise size tests/qtest/ide-test: build the shared disks with qemu-img tests/qtest/hd-geo-test: build the test images with qemu-img

 tests/qtest/ahci-test.c        |  48 ++++++++---
 tests/qtest/hd-geo-test.c      | 145 ++++++++++++++++++++++-----------
 tests/qtest/ide-test.c         |  96 +++++++++++++++++-----
 tests/qtest/libqos/libqos.c    |   4 +-
 tests/qtest/libqos/libqos.h    |   2 +-
 tests/qtest/libqtest.c         |   9 +-
 tests/qtest/libqtest.h         |  12 +++
 tests/qtest/virtio-scsi-test.c |   5 +-
 8 files changed, 237 insertions(+), 84 deletions(-)
Signature · 1 line
2.53.0