* [PATCH] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar
@ 2022-11-25 15:58 Christian Schoenebeck
2022-12-01 11:03 ` Thomas Huth
2022-12-12 12:43 ` Thomas Huth
0 siblings, 2 replies; 4+ messages in thread
From: Christian Schoenebeck @ 2022-11-25 15:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Coiby Xu, Thomas Huth, Stefan Hajnoczi
This test requires environment variable QTEST_QEMU_STORAGE_DAEMON_BINARY
to be defined for running. If not, it would immediately abort all qtests
and prevent other, unrelated tests from running.
To fix that, just skip vhost-user-blk-test instead and log a message
about missing environment variable.
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
I also tried g_test_skip(errmsg) from the setup handlers instead, but it
always caused the tests to abort with an error:
../tests/qtest/libqtest.c:179: kill_qemu() tried to terminate QEMU process
but encountered exit status 1 (expected 0)
I haven't further investigated.
tests/qtest/vhost-user-blk-test.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c
index 07a4c2d500..dc37f5af4d 100644
--- a/tests/qtest/vhost-user-blk-test.c
+++ b/tests/qtest/vhost-user-blk-test.c
@@ -983,6 +983,12 @@ static void register_vhost_user_blk_test(void)
.before = vhost_user_blk_test_setup,
};
+ if (!getenv("QTEST_QEMU_STORAGE_DAEMON_BINARY")) {
+ g_test_message("QTEST_QEMU_STORAGE_DAEMON_BINARY not defined, "
+ "skipping vhost-user-blk-test");
+ return;
+ }
+
/*
* tests for vhost-user-blk and vhost-user-blk-pci
* The tests are borrowed from tests/virtio-blk-test.c. But some tests
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar
2022-11-25 15:58 [PATCH] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar Christian Schoenebeck
@ 2022-12-01 11:03 ` Thomas Huth
2022-12-02 13:30 ` Thomas Huth
2022-12-12 12:43 ` Thomas Huth
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2022-12-01 11:03 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel; +Cc: Coiby Xu, Stefan Hajnoczi
On 25/11/2022 16.58, Christian Schoenebeck wrote:
> This test requires environment variable QTEST_QEMU_STORAGE_DAEMON_BINARY
> to be defined for running. If not, it would immediately abort all qtests
> and prevent other, unrelated tests from running.
>
> To fix that, just skip vhost-user-blk-test instead and log a message
> about missing environment variable.
>
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
>
> I also tried g_test_skip(errmsg) from the setup handlers instead, but it
> always caused the tests to abort with an error:
>
> ../tests/qtest/libqtest.c:179: kill_qemu() tried to terminate QEMU process
> but encountered exit status 1 (expected 0)
>
> I haven't further investigated.
>
> tests/qtest/vhost-user-blk-test.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c
> index 07a4c2d500..dc37f5af4d 100644
> --- a/tests/qtest/vhost-user-blk-test.c
> +++ b/tests/qtest/vhost-user-blk-test.c
> @@ -983,6 +983,12 @@ static void register_vhost_user_blk_test(void)
> .before = vhost_user_blk_test_setup,
> };
>
> + if (!getenv("QTEST_QEMU_STORAGE_DAEMON_BINARY")) {
> + g_test_message("QTEST_QEMU_STORAGE_DAEMON_BINARY not defined, "
> + "skipping vhost-user-blk-test");
> + return;
> + }
Could we use g_test_skip() here?
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar
2022-12-01 11:03 ` Thomas Huth
@ 2022-12-02 13:30 ` Thomas Huth
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2022-12-02 13:30 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel; +Cc: Coiby Xu, Stefan Hajnoczi
On 01/12/2022 12.03, Thomas Huth wrote:
> On 25/11/2022 16.58, Christian Schoenebeck wrote:
>> This test requires environment variable QTEST_QEMU_STORAGE_DAEMON_BINARY
>> to be defined for running. If not, it would immediately abort all qtests
>> and prevent other, unrelated tests from running.
>>
>> To fix that, just skip vhost-user-blk-test instead and log a message
>> about missing environment variable.
>>
>> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
>> ---
>>
>> I also tried g_test_skip(errmsg) from the setup handlers instead, but it
>> always caused the tests to abort with an error:
>> ../tests/qtest/libqtest.c:179: kill_qemu() tried to terminate QEMU process
>> but encountered exit status 1 (expected 0)
>> I haven't further investigated.
>>
>> tests/qtest/vhost-user-blk-test.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/tests/qtest/vhost-user-blk-test.c
>> b/tests/qtest/vhost-user-blk-test.c
>> index 07a4c2d500..dc37f5af4d 100644
>> --- a/tests/qtest/vhost-user-blk-test.c
>> +++ b/tests/qtest/vhost-user-blk-test.c
>> @@ -983,6 +983,12 @@ static void register_vhost_user_blk_test(void)
>> .before = vhost_user_blk_test_setup,
>> };
>> + if (!getenv("QTEST_QEMU_STORAGE_DAEMON_BINARY")) {
>> + g_test_message("QTEST_QEMU_STORAGE_DAEMON_BINARY not defined, "
>> + "skipping vhost-user-blk-test");
>> + return;
>> + }
>
> Could we use g_test_skip() here?
Maybe I should also read the lines between "---" and "diff", sorry!
Would be interesting to know why it does not work, though, anyway, for this
patch here:
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar
2022-11-25 15:58 [PATCH] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar Christian Schoenebeck
2022-12-01 11:03 ` Thomas Huth
@ 2022-12-12 12:43 ` Thomas Huth
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2022-12-12 12:43 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel; +Cc: Coiby Xu, Stefan Hajnoczi
On 25/11/2022 16.58, Christian Schoenebeck wrote:
> This test requires environment variable QTEST_QEMU_STORAGE_DAEMON_BINARY
> to be defined for running. If not, it would immediately abort all qtests
> and prevent other, unrelated tests from running.
>
> To fix that, just skip vhost-user-blk-test instead and log a message
> about missing environment variable.
>
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
>
> I also tried g_test_skip(errmsg) from the setup handlers instead, but it
> always caused the tests to abort with an error:
>
> ../tests/qtest/libqtest.c:179: kill_qemu() tried to terminate QEMU process
> but encountered exit status 1 (expected 0)
>
> I haven't further investigated.
>
> tests/qtest/vhost-user-blk-test.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c
> index 07a4c2d500..dc37f5af4d 100644
> --- a/tests/qtest/vhost-user-blk-test.c
> +++ b/tests/qtest/vhost-user-blk-test.c
> @@ -983,6 +983,12 @@ static void register_vhost_user_blk_test(void)
> .before = vhost_user_blk_test_setup,
> };
>
> + if (!getenv("QTEST_QEMU_STORAGE_DAEMON_BINARY")) {
> + g_test_message("QTEST_QEMU_STORAGE_DAEMON_BINARY not defined, "
> + "skipping vhost-user-blk-test");
> + return;
> + }
> +
> /*
> * tests for vhost-user-blk and vhost-user-blk-pci
> * The tests are borrowed from tests/virtio-blk-test.c. But some tests
Thanks, queued to my testing-next branch now:
https://gitlab.com/thuth/qemu/-/commits/testing-next/
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-12 12:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25 15:58 [PATCH] tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar Christian Schoenebeck
2022-12-01 11:03 ` Thomas Huth
2022-12-02 13:30 ` Thomas Huth
2022-12-12 12:43 ` Thomas Huth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.