From: Martin Schwenke Date: Mon, 23 Sep 2019 06:13:05 +0000 (+1000) Subject: ctdb-tests: Generalise pattern for matching valgrind memcheck executable X-Git-Tag: talloc-2.3.1~738 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08fea1ced39652954ae44d8cdc4dc405b31786b6;p=thirdparty%2Fsamba.git ctdb-tests: Generalise pattern for matching valgrind memcheck executable On my laptop this is "memcheck-amd64-linux instead of just "memcheck". Alternatively, this part of the test could simply be skipped if $VALGRIND is set. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/simple/06_ctdb_getpid.sh b/ctdb/tests/simple/06_ctdb_getpid.sh index 5dae0c1f295..48540d052b2 100755 --- a/ctdb/tests/simple/06_ctdb_getpid.sh +++ b/ctdb/tests/simple/06_ctdb_getpid.sh @@ -61,13 +61,17 @@ while [ $n -lt $num_nodes ] ; do read pid try_command_on_node $n "ls -l /proc/${pid}/exe | sed -e 's@.*/@@'" echo -n "Node ${n}, PID ${pid} looks to be running \"$out\" - " - if [ "$out" = "ctdbd" ] ; then - echo "GOOD!" - elif [ -n "$VALGRIND" -a "$out" = "memcheck" ] ; then - # We could check cmdline too if this isn't good enough. - echo "GOOD enough!" - else - die "BAD!" - fi + case "$out" in + ctdbd) : ;; + memcheck*) + if [ -z "$VALGRIND" ] ; then + die "BAD" + fi + ;; + *) die "BAD" + esac + + echo "GOOD!" + n=$(($n + 1)) done <<<"$pids_onnode"