[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 17/20] iotests: Give access to the qemu-storage-daemon
From: |
Max Reitz |
Subject: |
[PATCH v2 17/20] iotests: Give access to the qemu-storage-daemon |
Date: |
Tue, 22 Sep 2020 12:49:29 +0200 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/check | 11 +++++++++++
tests/qemu-iotests/common.rc | 17 +++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index e14a1f354d..467a7cf1b7 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -644,6 +644,17 @@ if [ -z $QEMU_NBD_PROG ]; then
fi
export QEMU_NBD_PROG="$(type -p "$QEMU_NBD_PROG")"
+if [ -z "$QEMU_STGD_PROG" ]; then
+ if [ -x "$build_iotests/qemu-storage-daemon" ]; then
+ export QEMU_STGD_PROG="$build_iotests/qemu-storage-daemon"
+ elif [ -x "$build_root/storage-daemon/qemu-storage-daemon" ]; then
+ export QEMU_STGD_PROG="$build_root/storage-daemon/qemu-storage-daemon"
+ else
+ _init_error "qemu-storage-daemon not found"
+ fi
+fi
+export QEMU_STGD_PROG="$(type -p "$QEMU_STGD_PROG")"
+
if [ -x "$build_iotests/socket_scm_helper" ]
then
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 23f46da2db..e4751d4985 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -124,6 +124,7 @@ fi
: ${VALGRIND_QEMU_IMG=$VALGRIND_QEMU}
: ${VALGRIND_QEMU_IO=$VALGRIND_QEMU}
: ${VALGRIND_QEMU_NBD=$VALGRIND_QEMU}
+: ${VALGRIND_QEMU_STGD=$VALGRIND_QEMU}
# The Valgrind own parameters may be set with
# its environment variable VALGRIND_OPTS, e.g.
@@ -211,6 +212,21 @@ _qemu_nbd_wrapper()
return $RETVAL
}
+_qemu_storage_daemon_wrapper()
+{
+ local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
+ (
+ if [ -n "${QEMU_STGD_NEED_PID}" ]; then
+ echo $BASHPID > "${QEMU_TEST_DIR}/qemu-storage-daemon.pid"
+ fi
+ VALGRIND_QEMU="${VALGRIND_QEMU_STGD}" _qemu_proc_exec
"${VALGRIND_LOGFILE}" \
+ "$QEMU_STGD_PROG" $QEMU_STGD_OPTIONS "$@"
+ )
+ RETVAL=$?
+ _qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
+ return $RETVAL
+}
+
# Valgrind bug #409141 https://bugs.kde.org/show_bug.cgi?id=409141
# Until valgrind 3.16+ is ubiquitous, we must work around a hang in
# valgrind when issuing sigkill. Disable valgrind for this invocation.
@@ -223,6 +239,7 @@ export QEMU=_qemu_wrapper
export QEMU_IMG=_qemu_img_wrapper
export QEMU_IO=_qemu_io_wrapper
export QEMU_NBD=_qemu_nbd_wrapper
+export QEMU_STGD=_qemu_storage_daemon_wrapper
if [ "$IMGOPTSSYNTAX" = "true" ]; then
DRIVER="driver=$IMGFMT"
--
2.26.2
- [PATCH v2 07/20] iotests: Do not needlessly filter _make_test_img, (continued)
- [PATCH v2 07/20] iotests: Do not needlessly filter _make_test_img, Max Reitz, 2020/09/22
- [PATCH v2 08/20] iotests: Do not pipe _make_test_img, Max Reitz, 2020/09/22
- [PATCH v2 09/20] iotests: Use convert -n in some cases, Max Reitz, 2020/09/22
- [PATCH v2 10/20] iotests/046: Avoid renaming images, Max Reitz, 2020/09/22
- [PATCH v2 11/20] iotests: Derive image names from $TEST_IMG, Max Reitz, 2020/09/22
- [PATCH v2 12/20] iotests/091: Use _cleanup_qemu instad of "wait", Max Reitz, 2020/09/22
- [PATCH v2 13/20] iotests: Restrict some Python tests to file, Max Reitz, 2020/09/22
- [PATCH v2 15/20] iotests/287: Clean up subshell test image, Max Reitz, 2020/09/22
- [PATCH v2 16/20] storage-daemon: Call bdrv_close_all() on exit, Max Reitz, 2020/09/22
- [PATCH v2 14/20] iotests: Let _make_test_img guess $TEST_IMG_FILE, Max Reitz, 2020/09/22
- [PATCH v2 17/20] iotests: Give access to the qemu-storage-daemon,
Max Reitz <=
- [PATCH v2 18/20] iotests: Allow testing FUSE exports, Max Reitz, 2020/09/22
- [PATCH v2 19/20] iotests: Enable fuse for many tests, Max Reitz, 2020/09/22
- [PATCH v2 20/20] iotests/308: Add test for FUSE exports, Max Reitz, 2020/09/22
- Re: [PATCH v2 00/20] block/export: Allow exporting BDSs via FUSE, Daniel P . Berrangé, 2020/09/22