ctdb-tests: Improve test portability
authorMartin Schwenke <martin@meltin.net>
Thu, 5 Mar 2020 10:48:59 +0000 (21:48 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 22 Jul 2020 02:42:38 +0000 (02:42 +0000)
"wc -l" on some platforms (e.g. FreeBSD) contains leading spaces, so
strip them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
ctdb/tests/INTEGRATION/simple/cluster.010.getrelock.sh

index 58633af973df0629dc5ec39d1bd1bccd02e76cc1..03cf4317a39839d81d4fb910aab0f74bdb363253 100755 (executable)
@@ -18,7 +18,7 @@ if [ -z "$out" ] ; then
     exit 0
 fi
 
-n=$(sort -u "$outfile" | wc -l)
+n=$(sort -u "$outfile" | wc -l | tr -d '[:space:]')
 if [ "$n" = 1 ] ; then
        echo "GOOD: All nodes have the same recovery lock setting"
 else