]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix remotebackend tests without socat 1508/head
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Sat, 5 Jul 2014 12:32:09 +0000 (14:32 +0200)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Sat, 5 Jul 2014 12:33:09 +0000 (14:33 +0200)
When socat is not installed, the testrunner would fail instead of
exiting without testing as planned.

This also adds `set -x` to the testrunner for future error diagnosis.

modules/remotebackend/testrunner.sh

index e607351dc75d6ca93c279894061bddc05af408e0..f1c0d8deb00711ad228ab8672c6b6d8d9d94161a 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-
+set -x
 new_api=0
 mode=$1
 
@@ -76,8 +76,8 @@ function stop_zeromq() {
 }
 
 function start_unix() {
-  if [ ! -x $socat ]; then
-     echo "Cannot find socat - cannot test (non-fatal)"
+  if [ -z "$socat" -o ! -x "$socat" ]; then
+     echo "Cannot find socat - skipping test (non-fatal)"
      exit 0
   fi
   
@@ -144,7 +144,7 @@ case "$mode" in
     stop_zeromq
   ;;
   *)
-     echo "Usage: $0 test_remotebackend_(pipe|http|post|json)"
+     echo "Usage: $0 test_remotebackend_(pipe|unix|http|post|json|zeromq)"
      exit 1
   ;;
 esac