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