]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Generalise pattern for matching valgrind memcheck executable
authorMartin Schwenke <martin@meltin.net>
Mon, 23 Sep 2019 06:13:05 +0000 (16:13 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 24 Sep 2019 02:27:29 +0000 (02:27 +0000)
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/simple/06_ctdb_getpid.sh

index 5dae0c1f295d4d99f93370ce8f8357da0b32df05..48540d052b2a77a9bb2998c7ec7fbaa07575bbf3 100755 (executable)
@@ -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"