summaryrefslogtreecommitdiff
path: root/ctdb/tests
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-08-05 10:12:23 +1000
committerAmitay Isaacs <amitay@samba.org>2019-08-14 09:11:34 +0000
commit034f4cfab8b6690e07f5b9cfaaa5cb31ac29336e (patch)
treec7137298ba4c6fee7a1fe04293d187ea8e4f0cbe /ctdb/tests
parent83f73b5abcef860a5a80b685337e5947c7c41b24 (diff)
downloadsamba-034f4cfab8b6690e07f5b9cfaaa5cb31ac29336e.tar.gz
ctdb-tests: Avoid shellcheck warning SC2164
SC2164 Use 'cd ... || exit' or 'cd ... || return' in case cd fails Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests')
-rwxr-xr-xctdb/tests/run_tests.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh
index 087eae4257b..5d2d3ff560b 100755
--- a/ctdb/tests/run_tests.sh
+++ b/ctdb/tests/run_tests.sh
@@ -300,7 +300,10 @@ for f in "${tests[@]}" ; do
if [ $status -eq 127 ] ; then
# Find the the top-level tests directory
- d=$(cd "$TEST_SCRIPTS_DIR"; echo "$PWD")
+ d=$(cd "$TEST_SCRIPTS_DIR" && echo "$PWD")
+ if [ -z "$d" ] ; then
+ die "Unable to find TEST_SCRIPTS_DIR=\"${TEST_SCRIPTS_DIR}\""
+ fi
tests_dir=$(dirname "$d")
# Strip off current directory from beginning, if there, just
# to make paths more friendly.