aboutsummaryrefslogtreecommitdiff
path: root/src/dht/test_dht_tools.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/test_dht_tools.sh')
-rwxr-xr-xsrc/dht/test_dht_tools.sh64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/dht/test_dht_tools.sh b/src/dht/test_dht_tools.sh
deleted file mode 100755
index 56cc99e15..000000000
--- a/src/dht/test_dht_tools.sh
+++ /dev/null
@@ -1,64 +0,0 @@
1#!/bin/sh
2# This file is in the public domain.
3
4out=`mktemp /tmp/test-gnunet-dht-logXXXXXXXX`
5tempcfg=`mktemp /tmp/test-dht-tools.XXXXXXXX`
6checkout="check.out"
7armexe="gnunet-arm -c $tempcfg "
8putexe="gnunet-dht-put -c $tempcfg "
9getexe="gnunet-dht-get -c $tempcfg "
10peerinfo="gnunet-peerinfo -c $tempcfg -sq"
11stop_arm()
12{
13 if ! $armexe $DEBUG -e -d > $out ; then
14 echo "FAIL: error running $armexe"
15 echo "Command output was:"
16 cat $out
17 rm -f $out $tempcfg
18 exit 1
19 fi
20 rm -f $out $tempcfg
21}
22
23cp test_dht_tools.conf $tempcfg
24
25echo -n "TEST: Starting ARM..."
26if ! $armexe $DEBUG -s > $out ; then
27 echo "FAIL: error running $armexe"
28 echo "Command output was:"
29 cat $out
30 stop_arm
31 exit 1
32fi
33echo "PASS"
34
35echo -n "TEST: Testing put..."
36if ! $putexe -k testkey -d testdata -t 8 > $out ; then
37 echo "FAIL: error running $putexe"
38 echo "Command output was:"
39 cat $out
40 stop_arm
41 exit 1
42fi
43echo "PASS"
44
45echo -n "TEST: Testing get..."
46echo "Result 0, type 8:" > $checkout
47echo "testdata" >> $checkout
48
49if ! $getexe -k testkey -T 100ms -t 8 > $out ; then
50 echo "FAIL: error running $putexe"
51 echo "Command output was:"
52 cat $out
53 stop_arm
54 exit 1
55fi
56
57if ! diff --strip-trailing-cr -q $out $checkout ; then
58 echo "FAIL: $out and $checkout differ:"
59 diff --strip-trailing-cr $out $checkout
60 stop_arm
61 exit 1
62fi
63echo "PASS"
64stop_arm