diff options
author | Kevin Wolf <kwolf@redhat.com> | 2020-09-02 13:03:26 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-09-10 11:11:05 +0200 |
commit | b1cbc33a3971b6bb005d5ac3569feae35a71de0f (patch) | |
tree | adb7aa44c4c2a139b6b0057b9be69d136f4630f5 /tests/qemu-iotests | |
parent | 374eedd1c47bafca912a67d556eb2f1c1c0b171a (diff) | |
download | qemu-b1cbc33a3971b6bb005d5ac3569feae35a71de0f.zip qemu-b1cbc33a3971b6bb005d5ac3569feae35a71de0f.tar.gz qemu-b1cbc33a3971b6bb005d5ac3569feae35a71de0f.tar.bz2 |
iotests: Allow running from different directory
It is convenient to be able to edit the tests and run them without
changing the current working directory back and forth. Instead of
assuming that $PWD is the qemu-iotests build directory, derive the build
directory from the executed script.
This allows 'check' to find the required files even when called from
another directory. The scratch directory will still be in the current
working directory.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200902110326.257115-1-kwolf@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
-rwxr-xr-x | tests/qemu-iotests/check | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index 3ab859a..e14a1f3 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -44,7 +44,7 @@ then _init_error "failed to obtain source tree name from check symlink" fi source_iotests=$(cd "$source_iotests"; pwd) || _init_error "failed to enter source tree" - build_iotests=$PWD + build_iotests=$(readlink -f $(dirname "$0")) else # called from the source tree source_iotests=$PWD |