qemu-e2k/tests
Daniel Henrique Barboza 981eb10603 qtest/virtio-9p-test.c: create/remove temp dirs after each test
The local 9p driver in virtio-9p-test.c its temporary dir right at the
start of qos-test (via virtio_9p_create_local_test_dir()) and only
deletes it after qos-test is finished (via
virtio_9p_remove_local_test_dir()).

This means that any qos-test machine that ends up running virtio-9p-test
local tests more than once will end up re-using the same temp dir. This
is what's happening in [1] after we introduced the riscv machine nodes:
if we enable slow tests with the '-m slow' flag using
qemu-system-riscv64, this is what happens:

- a temp dir is created;

- virtio-9p-device tests will run virtio-9p-test successfully;

- virtio-9p-pci tests will run virtio-9p-test, and fail right at the
  first slow test at fs_create_dir() because the "01" file was already
created by fs_create_dir() test when running with the virtio-9p-device.

The root cause is that we're creating a single temporary dir, via the
construct/destruct callbacks, and this temp dir is kept for the entire
qos-test run.

We can change each test to clean after themselves. This approach would
make the 'create' tests obsolete since we would need to create and
delete dirs/files/symlinks for the cleanup, turning them into the
'unlinkat' tests that comes right after.

We chose a different approach that handles the root cause: do not use
constructor/destructor to create the temp dir. Create one temp dir for
each test, and remove it after the test is complete. This is the
approach taken for other qtests like vhost-user-test.c where each test
requires a setup() and a subsequent cleanup(), all of those instantiated
in the .before callback.

[1] https://mail.gnu.org/archive/html/qemu-devel/2024-03/msg05807.html

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-Id: <20240327142011.805728-2-dbarboza@ventanamicro.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
2024-03-28 09:53:17 +01:00
..
avocado tests/avocado: sbsa-ref: add OpenBSD tests for misc 'max' setup 2024-03-20 09:52:27 +00:00
bench meson: remove unused variable 2023-12-31 09:11:27 +01:00
data tests: acpi: update expected SSDT.dimmpxm blob 2024-03-18 08:42:46 -04:00
decode tests/: spelling fixes 2023-09-08 13:08:52 +03:00
docker .gitlab-ci.d: Drop cross-win32-system job 2024-02-23 08:13:52 +01:00
fp tests/fp: Bump fp-test-mulAdd test timeout to 3 minutes 2024-01-12 13:23:48 +00:00
guest-debug tests/tcg: Factor out gdbstub test functions 2024-01-29 20:48:49 +10:00
image-fuzzer
include
keys
lcitool .gitlab-ci.d: Drop cross-win32-system job 2024-02-23 08:13:52 +01:00
migration tests/qtest: option to suspend during migration 2024-01-04 09:52:42 +08:00
multiboot
perf/block/qcow2
plugin tests/plugin/bb: migrate to new per_vcpu API 2024-03-06 12:35:36 +00:00
qapi-schema qapi: Reject "Returns" section when command doesn't return anything 2024-03-04 07:12:40 +01:00
qemu-iotests iotests: add test for stream job with an unaligned prefetch read 2024-03-26 14:21:26 +01:00
qtest qtest/virtio-9p-test.c: create/remove temp dirs after each test 2024-03-28 09:53:17 +01:00
rocker
tcg tests/tcg/s390x: Test TEST AND SET 2024-03-25 15:05:59 +01:00
tsan block: remove AioContext locking 2023-12-21 22:49:27 +01:00
uefi-test-tools tests/: spelling fixes 2023-09-08 13:08:52 +03:00
unit tests/unit/test-throttle: Avoid unintended integer division 2024-03-25 14:17:06 +00:00
vm tests/vm: ensure we build everything by default 2024-03-13 11:43:52 +00:00
vmstate-static-checker-data
dbus-vmstate-daemon.sh
Makefile.include tests: respect --enable/--disable-download for Avocado 2023-11-24 12:07:47 +01:00
meson.build configure, meson: rename targetos to host_os 2023-12-31 09:11:29 +01:00
test-qht-par.c
vhost-user-bridge.c error handling: Use RETRY_ON_EINTR() macro where applicable 2023-01-09 13:50:47 +01:00