summaryrefslogtreecommitdiff
path: root/ctdb/tests
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-03-07 15:46:48 +1100
committerAmitay Isaacs <amitay@samba.org>2019-03-15 05:17:14 +0000
commit627a5cf1e717aab65b99eaba4e2efe78307adbf2 (patch)
treeb949eb3f2d521502e19dacbc634a5d8c91637ba6 /ctdb/tests
parent6555fbce995d3d3a7b162ea49a4a9844e234fed8 (diff)
downloadsamba-627a5cf1e717aab65b99eaba4e2efe78307adbf2.tar.gz
ctdb-tests: Fix remaining common.sh ShellCheck hits
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org>
Diffstat (limited to 'ctdb/tests')
-rw-r--r--ctdb/tests/scripts/common.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh
index b75fe066dcd..63df11242e7 100644
--- a/ctdb/tests/scripts/common.sh
+++ b/ctdb/tests/scripts/common.sh
@@ -5,13 +5,13 @@
# Print a message and exit.
die ()
{
- echo "$1" >&2 ; exit ${2:-1}
+ echo "$1" >&2 ; exit "${2:-1}"
}
# This expands the most probable problem cases like "." and "..".
TEST_SUBDIR=$(dirname "$0")
-if [ $(dirname "$TEST_SUBDIR") = "." ] ; then
- TEST_SUBDIR=$(cd "$TEST_SUBDIR" ; pwd)
+if [ "$(dirname "$TEST_SUBDIR")" = "." ] ; then
+ TEST_SUBDIR=$(cd "$TEST_SUBDIR" && pwd)
fi
. "${TEST_SCRIPTS_DIR}/script_install_paths.sh"
@@ -73,8 +73,9 @@ setup_ctdb_base ()
[ $# -ge 2 ] || die "usage: setup_ctdb_base <parent> <subdir> [item]..."
# If empty arguments are passed then we attempt to remove /
# (i.e. the root directory) below
- [ -n "$1" -a -n "$2" ] || \
+ if [ -z "$1" ] || [ -z "$2" ] ; then
die "usage: setup_ctdb_base <parent> <subdir> [item]..."
+ fi
_parent="$1"
_subdir="$2"