[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 098/100] iotests: Use absolute paths for executables
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 098/100] iotests: Use absolute paths for executables |
Date: |
Fri, 7 Jul 2017 19:08:53 +0200 |
From: Max Reitz <address@hidden>
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()
{
(
--
1.8.3.1
- [Qemu-devel] [PULL 084/100] qcow2: add .bdrv_can_store_new_dirty_bitmap, (continued)
- [Qemu-devel] [PULL 084/100] qcow2: add .bdrv_can_store_new_dirty_bitmap, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 083/100] block: add bdrv_can_store_new_dirty_bitmap, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 087/100] qmp: add x-debug-block-dirty-bitmap-sha256, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 088/100] iotests: test qcow2 persistent dirty bitmap, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 093/100] iotests: skip 159 & 170 with luks format, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 092/100] block: release persistent bitmaps on inactivate, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 091/100] qmp: block-dirty-bitmap-remove: remove persistent, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 089/100] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 090/100] qcow2: add .bdrv_remove_persistent_dirty_bitmap, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 094/100] iotests: fix remainining tests to work with LUKS, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 098/100] iotests: Use absolute paths for executables,
Kevin Wolf <=
- [Qemu-devel] [PULL 099/100] iotests: Add test for colon handling, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 096/100] iotests: add more LUKS hash combination tests, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 095/100] iotests: reduce PBKDF iterations when testing LUKS, Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 100/100] tests: Avoid non-portable 'echo -ARG', Kevin Wolf, 2017/07/07
- [Qemu-devel] [PULL 097/100] iotests: chown LUKS device before qemu-io launches, Kevin Wolf, 2017/07/07
- Re: [Qemu-devel] [PULL 000/100] Block layer patches, Peter Maydell, 2017/07/10