Skip to content

Commit

Permalink
tests/qtest/vhost-user-blk-test: don't abort all qtests on missing envar
Browse files Browse the repository at this point in the history
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>
Message-Id: <E1oybRD-0005D5-5r@lizzy.crudebyte.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
cschoenebeck authored and huth committed Dec 15, 2022
1 parent 954a6c4 commit 4bf1b66
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/qtest/vhost-user-blk-test.c
Expand Up @@ -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
Expand Down

0 comments on commit 4bf1b66

Please sign in to comment.