diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/qtest/meson.build | 7 | ||||
| -rw-r--r-- | tests/qtest/vhost-user-blk-test.c | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index e22a0792c5..2bc3efd49f 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -276,8 +276,11 @@ foreach dir : target_dirs endif qtest_env.set('G_TEST_DBUS_DAEMON', meson.source_root() / 'tests/dbus-vmstate-daemon.sh') qtest_env.set('QTEST_QEMU_BINARY', './qemu-system-' + target_base) - qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon') - + if have_tools and have_vhost_user_blk_server + qtest_env.set('QTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon') + test_deps += [qsd] + endif + foreach test : target_qtests # Executables are shared across targets, declare them only the first time we # encounter them diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk-test.c index 8796c74ca4..6f108a1b62 100644 --- a/tests/qtest/vhost-user-blk-test.c +++ b/tests/qtest/vhost-user-blk-test.c @@ -789,6 +789,14 @@ static const char *qtest_qemu_storage_daemon_binary(void) exit(0); } + /* If we've got a path to the binary, check whether we can access it */ + if (strchr(qemu_storage_daemon_bin, '/') && + access(qemu_storage_daemon_bin, X_OK) != 0) { + fprintf(stderr, "ERROR: '%s' is not accessible\n", + qemu_storage_daemon_bin); + exit(1); + } + return qemu_storage_daemon_bin; } |