qemu/tests/qtest
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
..
fuzz
libqos libqos/virtio.c: Correct 'flags' reading in qvirtqueue_kick 2024-03-25 15:05:59 +01:00
ac97-test.c
acpi-utils.c
acpi-utils.h
adm1266-test.c
adm1272-test.c
ahci-test.c
am53c974-test.c
arm-cpu-features.c target: Improve error reporting for CpuModelInfo member @props 2024-03-12 14:03:00 +01:00
aspeed_fsi-test.c
aspeed_gpio-test.c
aspeed_hace-test.c
aspeed_smc-test.c
bcm2835-dma-test.c
bcm2835-i2c-test.c tests/qtest: Add testcase for BCM2835 BSC 2024-03-05 13:22:55 +00:00
bios-tables-test-allowed-diff.h tests: acpi: update expected SSDT.dimmpxm blob 2024-03-18 08:42:46 -04:00
bios-tables-test.c tests: smbios: add test for legacy mode CLI options 2024-03-18 08:42:45 -04:00
boot-order-test.c
boot-sector.c
boot-sector.h
boot-serial-test.c
cdrom-test.c
cmsdk-apb-dualtimer-test.c
cmsdk-apb-timer-test.c
cmsdk-apb-watchdog-test.c
cpu-plug-test.c
cxl-test.c
dbus-display-test.c
dbus-vmstate-test.c
device-introspect-test.c
device-plug-test.c
display-vga-test.c
drive_del-test.c
ds1338-test.c
e1000-test.c
e1000e-test.c
eepro100-test.c
emc141x-test.c
endianness-test.c
erst-test.c
es1370-test.c
fdc-test.c
fuzz-e1000e-test.c
fuzz-lsi53c895a-test.c
fuzz-megasas-test.c
fuzz-sb16-test.c
fuzz-sdcard-test.c
fuzz-virtio-scsi-test.c
fuzz-xlnx-dp-test.c
fw_cfg-test.c
hd-geo-test.c
hexloader-test.c
i440fx-test.c
i82801b11-test.c
ide-test.c
igb-test.c
intel-hda-test.c
ioh3420-test.c
ipmi-bt-test.c
ipmi-kcs-test.c
ipoctal232-test.c
isl_pmbus_vr-test.c
ivshmem-test.c
libqmp.c
libqmp.h
libqtest-single.h
libqtest.c tests/qtest/libqtest.c: Check for g_setenv() failure 2024-03-25 14:17:07 +00:00
libqtest.h
lpc-ich9-test.c
lsm303dlhc-mag-test.c
m48t59-test.c
machine-none-test.c
max34451-test.c
megasas-test.c
meson.build tests/qtest: Add STM32L4x5 GPIO QTest testcase 2024-03-07 12:19:25 +00:00
microbit-test.c
migration-helpers.c
migration-helpers.h
migration-test.c migration: Revert mapped-ram multifd support to fd: URI 2024-03-22 12:12:08 -04:00
modules-test.c
ne2000-test.c
netdev-socket.c
npcm7xx_adc-test.c
npcm7xx_emc-test.c tests/qtest/npcm7xx_emc_test: Don't leak cmd_line 2024-03-25 10:40:59 +00:00
npcm7xx_gpio-test.c
npcm7xx_pwm-test.c
npcm7xx_rng-test.c
npcm7xx_sdhci-test.c
npcm7xx_smbus-test.c
npcm7xx_timer-test.c
npcm7xx_watchdog_timer-test.c
npcm_gmac-test.c
numa-test.c
nvme-test.c
pca9552-test.c misc/pca955*: Move models under hw/gpio 2024-03-25 15:05:38 +01:00
pci-test.c
pcnet-test.c
pflash-cfi02-test.c
pnv-host-i2c-test.c misc/pca955*: Move models under hw/gpio 2024-03-25 15:05:38 +01:00
pnv-xscom-test.c
pnv-xscom.h
prom-env-test.c
pvpanic-pci-test.c
pvpanic-test.c
pxe-test.c
q35-test.c
qmp-cmd-test.c
qmp-test.c
qom-test.c
qos-test.c
qtest_aspeed.c
qtest_aspeed.h
readconfig-test.c
rtas-test.c
rtc-test.c
rtl8139-test.c
sdhci-test.c
sifive-e-aon-watchdog-test.c
spapr-phb-test.c
sse-timer-test.c
stm32l4x5_exti-test.c tests/qtest: Check that EXTI fan-in irqs are correctly connected 2024-02-27 13:01:41 +00:00
stm32l4x5_gpio-test.c tests/qtest: Add STM32L4x5 GPIO QTest testcase 2024-03-07 12:19:25 +00:00
stm32l4x5_rcc-test.c tests/qtest/stm32l4x5_rcc-test.c: Add tests for the STM32L4x5_RCC 2024-03-05 13:22:56 +00:00
stm32l4x5_syscfg-test.c
tco-test.c
test-arm-mptimer.c
test-filter-mirror.c
test-filter-redirector.c
test-hmp.c
test-netfilter.c
test-x86-cpuid-compat.c
tmp105-test.c
tpm-crb-swtpm-test.c
tpm-crb-test.c
tpm-emu.c
tpm-emu.h
tpm-tests.c
tpm-tests.h
tpm-tis-device-swtpm-test.c
tpm-tis-device-test.c
tpm-tis-i2c-test.c
tpm-tis-swtpm-test.c
tpm-tis-test.c
tpm-tis-util.c
tpm-tis-util.h
tpm-util.c
tpm-util.h
tulip-test.c
ufs-test.c
usb-hcd-ehci-test.c
usb-hcd-ohci-test.c
usb-hcd-uhci-test.c
usb-hcd-xhci-test.c
vhost-user-blk-test.c
vhost-user-test.c
virtio-9p-test.c qtest/virtio-9p-test.c: create/remove temp dirs after each test 2024-03-28 09:53:17 +01:00
virtio-blk-test.c
virtio-ccw-test.c
virtio-iommu-test.c hw/i386/q35: Set virtio-iommu aw-bits default value to 39 2024-03-12 17:59:03 -04:00
virtio-net-failover.c
virtio-net-test.c
virtio-rng-test.c
virtio-scsi-test.c
virtio-serial-test.c
virtio-test.c
vmgenid-test.c
vmxnet3-test.c
vnc-display-test.c
wdt_ib700-test.c
xlnx-can-test.c
xlnx-canfd-test.c
xlnx-versal-trng-test.c