From: Christian Grothoff Date: Thu, 26 Sep 2013 08:52:43 +0000 (+0000) Subject: -check if timeout command exists before using it X-Git-Tag: initial-import-from-subversion-38251~7077 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=02e344b557bfb88630df2c6d04f028c602f0f009;p=oweals%2Fgnunet.git -check if timeout command exists before using it --- diff --git a/src/gns/test_gns_cname_lookup.sh b/src/gns/test_gns_cname_lookup.sh index d6b82a4b0..14e14c570 100755 --- a/src/gns/test_gns_cname_lookup.sh +++ b/src/gns/test_gns_cname_lookup.sh @@ -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 diff --git a/src/gns/test_gns_delegated_lookup.sh b/src/gns/test_gns_delegated_lookup.sh index 570c3d212..83710d28b 100755 --- a/src/gns/test_gns_delegated_lookup.sh +++ b/src/gns/test_gns_delegated_lookup.sh @@ -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 diff --git a/src/gns/test_gns_lookup.sh b/src/gns/test_gns_lookup.sh index bfb59c50f..499109fc5 100755 --- a/src/gns/test_gns_lookup.sh +++ b/src/gns/test_gns_lookup.sh @@ -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 diff --git a/src/gns/test_gns_mx_lookup.sh b/src/gns/test_gns_mx_lookup.sh index 79d4860c2..563f750c2 100755 --- a/src/gns/test_gns_mx_lookup.sh +++ b/src/gns/test_gns_mx_lookup.sh @@ -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