* [PULL for-9.0 2/2] qtest/virtio-9p-test.c: remove g_test_slow() gate
2024-03-30 13:33 [PULL for-9.0 0/2] 9p queue 2024-03-29 Christian Schoenebeck
@ 2024-03-30 13:33 ` Christian Schoenebeck
2024-03-30 13:33 ` [PULL for-9.0 1/2] qtest/virtio-9p-test.c: create/remove temp dirs after each test Christian Schoenebeck
2024-04-01 12:09 ` [PULL for-9.0 0/2] 9p queue 2024-03-29 Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Christian Schoenebeck @ 2024-03-30 13:33 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Greg Kurz, Daniel Henrique Barboza, Thomas Huth
From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Commit 558f5c42ef gated the local tests with g_test_slow() to skip them
in 'make check'. The reported issue back then was this following CI
problem:
https://lists.nongnu.org/archive/html/qemu-devel/2020-11/msg05510.html
This problem ended up being fixed after it was detected with the
recently added risc-v machine nodes [1]. virtio-9p-test.c is now
creating and removing temporary dirs for each test run, instead of
creating a single dir for the entire qos-test scope.
We're now able to run these tests with 'make check' in the CI, so let's
go ahead and re-enable them.
This reverts commit 558f5c42efded3e0d0b20a90bce2a9a14580d824.
[1] https://mail.gnu.org/archive/html/qemu-devel/2024-03/msg05807.html
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-Id: <20240327142011.805728-3-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>
---
tests/qtest/virtio-9p-test.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c
index 0179b3a394..3c8cd235cf 100644
--- a/tests/qtest/virtio-9p-test.c
+++ b/tests/qtest/virtio-9p-test.c
@@ -746,15 +746,6 @@ static void register_virtio_9p_test(void)
/* 9pfs test cases using the 'local' filesystem driver */
-
- /*
- * XXX: Until we are sure that these tests can run everywhere,
- * keep them as "slow" so that they aren't run with "make check".
- */
- if (!g_test_slow()) {
- return;
- }
-
opts.before = assign_9p_local_driver;
qos_add_test("local/config", "virtio-9p", pci_config, &opts);
qos_add_test("local/create_dir", "virtio-9p", fs_create_dir, &opts);
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PULL for-9.0 1/2] qtest/virtio-9p-test.c: create/remove temp dirs after each test
2024-03-30 13:33 [PULL for-9.0 0/2] 9p queue 2024-03-29 Christian Schoenebeck
2024-03-30 13:33 ` [PULL for-9.0 2/2] qtest/virtio-9p-test.c: remove g_test_slow() gate Christian Schoenebeck
@ 2024-03-30 13:33 ` Christian Schoenebeck
2024-04-01 12:09 ` [PULL for-9.0 0/2] 9p queue 2024-03-29 Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Christian Schoenebeck @ 2024-03-30 13:33 UTC (permalink / raw)
To: qemu-devel, Peter Maydell; +Cc: Greg Kurz, Daniel Henrique Barboza, Thomas Huth
From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
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>
---
tests/qtest/virtio-9p-test.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c
index 65e69491e5..0179b3a394 100644
--- a/tests/qtest/virtio-9p-test.c
+++ b/tests/qtest/virtio-9p-test.c
@@ -693,9 +693,20 @@ static void fs_unlinkat_hardlink(void *obj, void *data,
g_assert(stat(real_file, &st_real) == 0);
}
+static void cleanup_9p_local_driver(void *data)
+{
+ /* remove previously created test dir when test is completed */
+ virtio_9p_remove_local_test_dir();
+}
+
static void *assign_9p_local_driver(GString *cmd_line, void *arg)
{
+ /* make sure test dir for the 'local' tests exists */
+ virtio_9p_create_local_test_dir();
+
virtio_9p_assign_local_driver(cmd_line, "security_model=mapped-xattr");
+
+ g_test_queue_destroy(cleanup_9p_local_driver, NULL);
return arg;
}
@@ -759,15 +770,3 @@ static void register_virtio_9p_test(void)
}
libqos_init(register_virtio_9p_test);
-
-static void __attribute__((constructor)) construct_9p_test(void)
-{
- /* make sure test dir for the 'local' tests exists */
- virtio_9p_create_local_test_dir();
-}
-
-static void __attribute__((destructor)) destruct_9p_test(void)
-{
- /* remove previously created test dir when test suite completed */
- virtio_9p_remove_local_test_dir();
-}
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PULL for-9.0 0/2] 9p queue 2024-03-29
2024-03-30 13:33 [PULL for-9.0 0/2] 9p queue 2024-03-29 Christian Schoenebeck
2024-03-30 13:33 ` [PULL for-9.0 2/2] qtest/virtio-9p-test.c: remove g_test_slow() gate Christian Schoenebeck
2024-03-30 13:33 ` [PULL for-9.0 1/2] qtest/virtio-9p-test.c: create/remove temp dirs after each test Christian Schoenebeck
@ 2024-04-01 12:09 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2024-04-01 12:09 UTC (permalink / raw)
To: Christian Schoenebeck
Cc: qemu-devel, Greg Kurz, Daniel Henrique Barboza, Thomas Huth
On Sat, 30 Mar 2024 at 13:39, Christian Schoenebeck
<qemu_oss@crudebyte.com> wrote:
>
> The following changes since commit 5012e522aca161be5c141596c66e5cc6082538a9:
>
> Update version for v9.0.0-rc1 release (2024-03-26 19:46:55 +0000)
>
> are available in the Git repository at:
>
> https://github.com/cschoenebeck/qemu.git tags/pull-9p-20240329
>
> for you to fetch changes up to dcae75fba1084823d0fc87caa13f0ba6f32155f3:
>
> qtest/virtio-9p-test.c: remove g_test_slow() gate (2024-03-28 09:54:47 +0100)
>
> ----------------------------------------------------------------
> Changes for 9p tests only:
>
> * Fix 9p tests for riscv.
>
> * Re-enable 9p 'local' tests for running in CI pipelines.
>
> ----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread