aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-26 08:52:43 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-26 08:52:43 +0000
commit02e344b557bfb88630df2c6d04f028c602f0f009 (patch)
tree384e7c7ca0671623d71b23171cdf3a01920e7a6c
parent626c2c8db33bfd00ed7d567a6e58182ca126df37 (diff)
downloadgnunet-02e344b557bfb88630df2c6d04f028c602f0f009.tar.gz
gnunet-02e344b557bfb88630df2c6d04f028c602f0f009.zip
-check if timeout command exists before using it
-rwxr-xr-xsrc/gns/test_gns_cname_lookup.sh5
-rwxr-xr-xsrc/gns/test_gns_delegated_lookup.sh3
-rwxr-xr-xsrc/gns/test_gns_lookup.sh3
-rwxr-xr-xsrc/gns/test_gns_mx_lookup.sh3
4 files changed, 9 insertions, 5 deletions
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"
11TEST_RECORD_NAME_SERVER="server" 11TEST_RECORD_NAME_SERVER="server"
12TEST_RECORD_NAME_PLUS="www" 12TEST_RECORD_NAME_PLUS="www"
13TEST_RECORD_NAME_DNS="www3" 13TEST_RECORD_NAME_DNS="www3"
14which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
14 15
15gnunet-arm -s -c test_gns_lookup.conf 16gnunet-arm -s -c test_gns_lookup.conf
16gnunet-identity -C testego -c test_gns_lookup.conf 17gnunet-identity -C testego -c test_gns_lookup.conf
17gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf 18gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf
18gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf 19gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf
19gnunet-namestore -p -z testego -a -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf 20gnunet-namestore -p -z testego -a -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf
20RES_CNAME=$(timeout 5 gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf) 21RES_CNAME=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf`
21RES_CNAME_DNS=$(timeout 5 gnunet-gns --raw -z testego -u www3.gnu -t A -c test_gns_lookup.conf) 22RES_CNAME_DNS=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www3.gnu -t A -c test_gns_lookup.conf`
22gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf 23gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t CNAME -V $TEST_RECORD_CNAME_DNS -e never -c test_gns_lookup.conf
23gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf 24gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_PLUS -t CNAME -V $TEST_RECORD_CNAME_PLUS -e never -c test_gns_lookup.conf
24gnunet-namestore -p -z testego -d -n $TEST_RECORD_CNAME_SERVER -t A -V $TEST_IP_PLUS -e never -c test_gns_lookup.conf 25gnunet-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 @@
1#!/bin/bash 1#!/bin/bash
2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT 2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
3which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
3 4
4TEST_IP="127.0.0.1" 5TEST_IP="127.0.0.1"
5gnunet-arm -s -c test_gns_lookup.conf 6gnunet-arm -s -c test_gns_lookup.conf
@@ -8,7 +9,7 @@ DELEGATED_PKEY=$(gnunet-identity -d -c test_gns_lookup.conf | grep delegatedego
8gnunet-identity -C testego -c test_gns_lookup.conf 9gnunet-identity -C testego -c test_gns_lookup.conf
9gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf 10gnunet-namestore -p -z testego -a -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
10gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 11gnunet-namestore -p -z delegatedego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
11RES_IP=$(timeout 5 gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf) 12RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.b.gnu -t A -c test_gns_lookup.conf`
12gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf 13gnunet-namestore -z testego -d -n b -t PKEY -V $DELEGATED_PKEY -e never -c test_gns_lookup.conf
13gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 14gnunet-namestore -z delegatedego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
14gnunet-arm -e -c test_gns_lookup.conf 15gnunet-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 @@
1#!/bin/bash 1#!/bin/bash
2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT 2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
3rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME` 3rm -r `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME`
4which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
4TEST_IP="127.0.0.1" 5TEST_IP="127.0.0.1"
5gnunet-arm -s -c test_gns_lookup.conf 6gnunet-arm -s -c test_gns_lookup.conf
6gnunet-identity -C testego -c test_gns_lookup.conf 7gnunet-identity -C testego -c test_gns_lookup.conf
7gnunet-namestore -p -z testego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 8gnunet-namestore -p -z testego -a -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
8RES_IP=$(timeout 5 gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf) 9RES_IP=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t A -c test_gns_lookup.conf`
9gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf 10gnunet-namestore -z testego -d -n www -t A -V $TEST_IP -e never -c test_gns_lookup.conf
10gnunet-identity -D testego -c test_gns_lookup.conf 11gnunet-identity -D testego -c test_gns_lookup.conf
11gnunet-arm -e -c test_gns_lookup.conf 12gnunet-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 @@
1#!/bin/bash 1#!/bin/bash
2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT 2trap "gnunet-arm -e -c test_gns_lookup.conf" SIGINT
3rm -fr `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME` 3rm -fr `gnunet-config -c test_gns_lookup.conf -s PATHS -o SERVICEHOME`
4which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
4 5
5TEST_MX="5,mail.gnu" 6TEST_MX="5,mail.gnu"
6gnunet-arm -s -c test_gns_lookup.conf 7gnunet-arm -s -c test_gns_lookup.conf
7gnunet-identity -C testego -c test_gns_lookup.conf 8gnunet-identity -C testego -c test_gns_lookup.conf
8gnunet-namestore -p -z testego -a -n www -t MX -V "$TEST_MX" -e never -c test_gns_lookup.conf 9gnunet-namestore -p -z testego -a -n www -t MX -V "$TEST_MX" -e never -c test_gns_lookup.conf
9 10
10RES_MX=$(timeout 5 gnunet-gns --raw -z testego -u www.gnu -t MX -c test_gns_lookup.conf) 11RES_MX=`$DO_TIMEOUT gnunet-gns --raw -z testego -u www.gnu -t MX -c test_gns_lookup.conf`
11gnunet-namestore -z testego -d -n www -t MX -V "$TEST_MX" -e never -c test_gns_lookup.conf 12gnunet-namestore -z testego -d -n www -t MX -V "$TEST_MX" -e never -c test_gns_lookup.conf
12gnunet-identity -D testego -c test_gns_lookup.conf 13gnunet-identity -D testego -c test_gns_lookup.conf
13gnunet-arm -e -c test_gns_lookup.conf 14gnunet-arm -e -c test_gns_lookup.conf