[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 58/85] iotests: Use absolute paths for executables
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 58/85] iotests: Use absolute paths for executables |
Date: |
Tue, 11 Jul 2017 18:07:47 +0200 |
A user may specify a relative path for accessing qemu, qemu-img, etc.
through environment variables ($QEMU_PROG and friends) or a symlink.
If a test decides to change its working directory, relative paths will
cease to work, however. Work around this by making all of the paths to
programs that should undergo testing absolute. Besides "realpath", we
also have to use "type -p" to support programs in $PATH.
As a side effect, this fixes specifying these programs as symlinks for
out-of-tree builds: Before, you would have to create two symlinks, one
in the build and one in the source tree (the first one for common.config
to find, the second one for the iotest to use). Now it is sufficient to
create one in the build tree because common.config will resolve it.
Reported-by: Kevin Wolf <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Tested-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/common.config | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index d1b45f5..e0883a0 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -103,6 +103,17 @@ if [ -z "$QEMU_VXHS_PROG" ]; then
export QEMU_VXHS_PROG="`set_prog_path qnio_server`"
fi
+export QEMU_PROG=$(realpath -- "$(type -p "$QEMU_PROG")")
+export QEMU_IMG_PROG=$(realpath -- "$(type -p "$QEMU_IMG_PROG")")
+export QEMU_IO_PROG=$(realpath -- "$(type -p "$QEMU_IO_PROG")")
+export QEMU_NBD_PROG=$(realpath -- "$(type -p "$QEMU_NBD_PROG")")
+
+# This program is not built as part of qemu but (possibly) provided by the
+# system, so it may not be present at all
+if [ -n "$QEMU_VXHS_PROG" ]; then
+ export QEMU_VXHS_PROG=$(realpath -- "$(type -p "$QEMU_VXHS_PROG")")
+fi
+
_qemu_wrapper()
{
(
--
2.9.4
- Re: [Qemu-block] [Qemu-devel] [PULL 50/85] qcow2: add .bdrv_remove_persistent_dirty_bitmap, (continued)
[Qemu-block] [PULL 52/85] block: release persistent bitmaps on inactivate, Max Reitz, 2017/07/11
[Qemu-block] [PULL 51/85] qmp: block-dirty-bitmap-remove: remove persistent, Max Reitz, 2017/07/11
[Qemu-block] [PULL 53/85] iotests: skip 159 & 170 with luks format, Max Reitz, 2017/07/11
[Qemu-block] [PULL 54/85] iotests: fix remainining tests to work with LUKS, Max Reitz, 2017/07/11
[Qemu-block] [PULL 55/85] iotests: reduce PBKDF iterations when testing LUKS, Max Reitz, 2017/07/11
[Qemu-block] [PULL 56/85] iotests: add more LUKS hash combination tests, Max Reitz, 2017/07/11
[Qemu-block] [PULL 58/85] iotests: Use absolute paths for executables,
Max Reitz <=
[Qemu-block] [PULL 59/85] iotests: Add test for colon handling, Max Reitz, 2017/07/11
[Qemu-block] [PULL 60/85] tests: Avoid non-portable 'echo -ARG', Max Reitz, 2017/07/11
[Qemu-block] [PULL 61/85] block: add bdrv_measure() API, Max Reitz, 2017/07/11
[Qemu-block] [PULL 62/85] raw-format: add bdrv_measure() support, Max Reitz, 2017/07/11
[Qemu-block] [PULL 57/85] iotests: chown LUKS device before qemu-io launches, Max Reitz, 2017/07/11
[Qemu-block] [PULL 63/85] qcow2: extract preallocation calculation function, Max Reitz, 2017/07/11
[Qemu-block] [PULL 64/85] qcow2: make refcount size calculation conservative, Max Reitz, 2017/07/11
[Qemu-block] [PULL 65/85] qcow2: extract image creation option parsing, Max Reitz, 2017/07/11
[Qemu-block] [PULL 66/85] qcow2: add bdrv_measure() support, Max Reitz, 2017/07/11
[Qemu-block] [PULL 68/85] qemu-iotests: support per-format golden output files, Max Reitz, 2017/07/11