From 1d2a7b8d059d4f090b351b8decca0ddf274c82a0 Mon Sep 17 00:00:00 2001 From: Klaus Wenninger Date: Wed, 20 Nov 2019 15:20:19 +0100 Subject: [PATCH] Fix: regressions.sh: make parameter passing consistent --- tests/regressions.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/regressions.sh b/tests/regressions.sh index 6cfb303..7ab80be 100755 --- a/tests/regressions.sh +++ b/tests/regressions.sh @@ -32,7 +32,7 @@ : ${SBD_USE_DM:="yes"} sbd() { - LD_PRELOAD=${SBD_PRELOAD} SBD_WATCHDOG_TIMEOUT=5 SBD_DEVICE="${SBD_DEVICE}" SBD_PRELOAD_LOG=${SBD_PRELOAD_LOG} SBD_WATCHDOG_DEV=/dev/watchdog setsid ${SBD_BINARY} -p ${SBD_PIDFILE} $* + LD_PRELOAD=${SBD_PRELOAD} SBD_WATCHDOG_TIMEOUT=5 SBD_DEVICE="${SBD_DEVICE}" SBD_PRELOAD_LOG=${SBD_PRELOAD_LOG} SBD_WATCHDOG_DEV=/dev/watchdog setsid ${SBD_BINARY} -p ${SBD_PIDFILE} "$@" } sbd_wipe_disk() { @@ -98,26 +98,26 @@ sbd_daemon_cleanup() { pkill -TERM --pidfile ${SBD_PIDFILE} 2>/dev/null sleep 5 pkill -KILL --pidfile ${SBD_PIDFILE} 2>/dev/null - pkill -KILL --parent $(cat ${SBD_PIDFILE} 2>/dev/null) 2>/dev/null + pkill -KILL --parent "$(cat ${SBD_PIDFILE} 2>/dev/null)" 2>/dev/null echo > ${SBD_PIDFILE} } _ok() { - echo -- $@ - $@ + echo "-- $*" + "$@" rc=$? if [ $rc -ne 0 ]; then - echo "$@ failed with $rc" + echo "$* failed with $rc" exit $rc fi } _no() { - echo -- $@ - $@ + echo "-- $*" + "$@" rc=$? if [ $rc -eq 0 ]; then - echo "$@ did NOT fail ($rc)" + echo "$* did NOT fail ($rc)" exit $rc fi return 0 @@ -126,7 +126,7 @@ _no() { _in_log() { grep "$@" ${SBD_PRELOAD_LOG} >/dev/null if [ $? -ne 0 ]; then - echo "didn't find '$@' in log:" + echo "didn't find '$*' in log:" cat ${SBD_PRELOAD_LOG} sbd_daemon_cleanup exit 1 @@ -227,10 +227,10 @@ test_stall_inquisitor() { sbd_daemon_cleanup sbd -d ${D[1]} -d ${D[2]} -d ${D[3]} -n test-1 watch sleep 10 - _ok kill -0 $(cat ${SBD_PIDFILE}) - kill -STOP $(cat ${SBD_PIDFILE}) + _ok kill -0 "$(cat ${SBD_PIDFILE})" + kill -STOP "$(cat ${SBD_PIDFILE})" sleep 10 - kill -CONT $(cat ${SBD_PIDFILE}) 2>/dev/null + kill -CONT "$(cat ${SBD_PIDFILE})" 2>/dev/null _in_log "watchdog fired" } -- 1.8.3.1