[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 6/6] iotests: Work around failing readlink -f
From: |
Alex Bennée |
Subject: |
[PATCH v1 6/6] iotests: Work around failing readlink -f |
Date: |
Mon, 14 Sep 2020 16:07:16 +0100 |
From: Max Reitz <mreitz@redhat.com>
On macOS, (out of the box) readlink does not have -f. If the recent
"readlink -f" call introduced by b1cbc33a397 fails, just fall back to
the old behavior (which means you can run the iotests only from the
build tree, but that worked fine for six years, so it should be fine
still).
Keep any potential error message on stderr. If users want to run the
iotests from outside the build tree, this may point them to what's wrong
(with their system).
Fixes: b1cbc33a3971b6bb005d5ac3569feae35a71de0f
("iotests: Allow running from different directory")
Reported-by: Claudio Fontana <cfontana@suse.de>
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200914113809.63640-1-mreitz@redhat.com>
---
tests/qemu-iotests/check | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index e14a1f354dd9..75675e1a18f0 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -45,6 +45,10 @@ then
fi
source_iotests=$(cd "$source_iotests"; pwd) || _init_error "failed to
enter source tree"
build_iotests=$(readlink -f $(dirname "$0"))
+ if [ "$?" -ne 0 ]; then
+ # Perhaps -f is unsupported, revert to pre-b1cbc33a397 behavior
+ build_iotests=$PWD
+ fi
else
# called from the source tree
source_iotests=$PWD
--
2.20.1
- [PATCH v1 0/6] deprecation and linux-user tweaks (+test fix), Alex Bennée, 2020/09/14
- [PATCH v1 1/6] linux-user: test, don't assert addr != test in pgb_reserved_va, Alex Bennée, 2020/09/14
- [PATCH v1 2/6] configure: use add_to for tweaking deprecated_features, Alex Bennée, 2020/09/14
- [PATCH v1 4/6] configure: include tilegx-linux-user in the auto-exclude logic, Alex Bennée, 2020/09/14
- [PATCH v1 3/6] configure: also skip deprecated targets with target-list-exclude, Alex Bennée, 2020/09/14
- [PATCH v1 5/6] gitlab: create a build-deprecated target, Alex Bennée, 2020/09/14
- [PATCH v1 6/6] iotests: Work around failing readlink -f,
Alex Bennée <=