-check if timeout command exists before using it
authorChristian Grothoff <christian@grothoff.org>
Thu, 26 Sep 2013 08:52:43 +0000 (08:52 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 26 Sep 2013 08:52:43 +0000 (08:52 +0000)
src/gns/test_gns_cname_lookup.sh
src/gns/test_gns_delegated_lookup.sh
src/gns/test_gns_lookup.sh
src/gns/test_gns_mx_lookup.sh

index d6b82a4b0738068582a00bcf7e9a527f1b02b1c0..14e14c5703d56dc744fa0c9bb0e79ab4367b0213 100755 (executable)
@@ -11,14 +11,15 @@ TEST_RECORD_CNAME_DNS="gnunet.org"
 TEST_RECORD_NAME_SERVER="server"
 TEST_RECORD_NAME_PLUS="www"
 TEST_RECORD_NAME_DNS="www3"
+which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
 
 gnunet-arm -s -c test_gns_lookup.conf
 gnunet-identity -C testego -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf
-RES_CNAME=$(timeout 5 gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf)
-RES_CNAME_DNS=$(timeout 5 gnunet-gns --raw -z testego -u www3.gnu -t A -c test_gns_lookup.conf)
+RES_CNAME=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf`
+RES_CNAME_DNS=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www3.gnu -t A -c test_gns_lookup.conf`
 gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -d -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf
index 570c3d212c252dbfa6325937d0b2272efce36aac..83710d28be0438296545c6e933fa72e8b07a8ab6 100755 (executable)
@@ -1,5 +1,6 @@
 #!/bin/bash
 trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
+which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
 
 TEST_IP="127.0.0.1"
 gnunet-arm -s -c test_gns_lookup.conf
@@ -8,7 +9,7 @@ DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego
 gnunet-identity -C testego -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
 gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
-RES_IP=$(timeout 5 gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf)
+RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf`
 gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY  -e never -c test_gns_lookup.conf
 gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP  -e never -c test_gns_lookup.conf
 gnunet-arm -e -c test_gns_lookup.conf
index bfb59c50fc67a865d920bff07c099b733ea819b3..499109fc5cdacd1935cbc000b2efafe8cd44b321 100755 (executable)
@@ -1,11 +1,12 @@
 #!/bin/bash
 trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
 rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME`
+which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
 TEST_IP="127.0.0.1"
 gnunet-arm -s -c test_gns_lookup.conf
 gnunet-identity -C testego -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
-RES_IP=$(timeout 5 gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf)
+RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf`
 gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
 gnunet-identity -D testego -c test_gns_lookup.conf
 gnunet-arm -e -c test_gns_lookup.conf
index 79d4860c2aad4d43d03ff6f4f3187d29b90b4bc1..563f750c2ebc9b2e99cc17a983f7196814eaabcb 100755 (executable)
@@ -1,13 +1,14 @@
 #!/bin/bash
 trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
 rm -fr `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME`
+which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
 
 TEST_MX="5,mail.gnu"
 gnunet-arm -s -c test_gns_lookup.conf
 gnunet-identity -C testego -c test_gns_lookup.conf
 gnunet-namestore -p -z testego -a -n www -t MX -V "$TEST_MX" -e never -c test_gns_lookup.conf
 
-RES_MX=$(timeout 5 gnunet-gns --raw -z testego -u www.gnu -t MX -c test_gns_lookup.conf)
+RES_MX=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t MX -c test_gns_lookup.conf`
 gnunet-namestore -z testego -d -n www -t MX -V "$TEST_MX" -e never -c test_gns_lookup.conf
 gnunet-identity -D testego -c test_gns_lookup.conf
 gnunet-arm -e -c test_gns_lookup.conf