From 6a2f23915ac3b585d706fd0b7df505b7e47ba9b4 Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Wed, 4 Apr 2018 14:31:54 +0200 Subject: [PATCH] Fix path lookup stuff once more Sigh. realpath is "portable", except not implemented on older versions of coreutils, including the one in Ubuntu Trusty :-( So, default to using realpath (which has the advantage of not requiring options anywhere), and fall back to readlink -f if that doesn't exist in our path. If that also fails, then the test suite will fail, but have a nice "readlink: -f: invalid option" or some such all over it, pointing to what the likely culprit is. --- tests/run/simple_test | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/run/simple_test b/tests/run/simple_test index 4d057b4..777b91d 100755 --- a/tests/run/simple_test +++ b/tests/run/simple_test @@ -5,12 +5,19 @@ if [ -z "$TMPDIR" ] then TMPDIR=/tmp fi + +REALPATH=$(which realpath) +if [ -z "$REALPATH" ] +then + REALPATH="readlink -f" +fi + tmpdir=`mktemp -d $TMPDIR/tmp.XXXXXX` conffile=${tmpdir}/nbd.conf pidfile=${tmpdir}/nbd.pid tmpnam=${tmpdir}/nbd.dd mydir=$(dirname $0) -certdir=$(realpath ${mydir}/certs) +certdir=$($REALPATH ${mydir}/certs) cleanup="$2" PID="" -- 2.7.4