aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-06-10 14:32:30 +0000
committerChristian Grothoff <christian@grothoff.org>2009-06-10 14:32:30 +0000
commit858c90f69646776847b2b940679361b88bceab43 (patch)
treeaf4440e08b484c9c4e544a985925899aaacfcbca /src
parent663f23d7c45185faf7cdb863ad2758808415e4fc (diff)
downloadgnunet-858c90f69646776847b2b940679361b88bceab43.tar.gz
gnunet-858c90f69646776847b2b940679361b88bceab43.zip
improving script
Diffstat (limited to 'src')
-rwxr-xr-xsrc/arm/test_gnunet_arm.sh83
1 files changed, 51 insertions, 32 deletions
diff --git a/src/arm/test_gnunet_arm.sh b/src/arm/test_gnunet_arm.sh
index 72f7a176b..7586d78bb 100755
--- a/src/arm/test_gnunet_arm.sh
+++ b/src/arm/test_gnunet_arm.sh
@@ -3,6 +3,7 @@
3rm -rf /tmp/test-gnunetd-arm/ 3rm -rf /tmp/test-gnunetd-arm/
4exe="./gnunet-arm -c test_arm_api_data.conf" 4exe="./gnunet-arm -c test_arm_api_data.conf"
5base=/tmp/gnunet-test-arm 5base=/tmp/gnunet-test-arm
6out=/tmp/test-gnunetd-arm.log
6#DEBUG="-L DEBUG" 7#DEBUG="-L DEBUG"
7 8
8# ---------------------------------------------------------------------------------- 9# ----------------------------------------------------------------------------------
@@ -17,31 +18,39 @@ echo "PASS"
17# ---------------------------------------------------------------------------------- 18# ----------------------------------------------------------------------------------
18echo -n "TEST: Start ARM... " 19echo -n "TEST: Start ARM... "
19 20
20if ! $exe $DEBUG -s > /dev/null ; then 21if ! $exe $DEBUG -s > $out ; then
21 echo "FAIL: error running $exe" 22 echo "FAIL: error running $exe"
23 echo "Command output was:"
24 cat $out
22 exit 1 25 exit 1
23fi 26fi
24LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l` 27LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l`
25if test $LINES -eq 0; then 28if test $LINES -eq 0; then
26 echo "FAIL: found $LINES gnunet-service-arm processes" 29 echo "FAIL: found $LINES gnunet-service-arm processes"
27 exit 1 30 echo "Command output was:"
31 cat $out
32 exit 1
28fi 33fi
29echo "PASS" 34echo "PASS"
30 35
31# ---------------------------------------------------------------------------------- 36# ----------------------------------------------------------------------------------
32echo -n "TEST: Start another service... " 37echo -n "TEST: Start another service... "
33 38
34if ! $exe $DEBUG -i resolver > /dev/null ; then 39if ! $exe $DEBUG -i resolver > $out ; then
35 echo "FAIL: error running $exe" 40 echo "FAIL: error running $exe"
41 echo "Command output was:"
42 cat $out
36 kill %% 43 kill %%
37 exit 1 44 exit 1
38fi 45fi
39sleep 1 46sleep 1
40LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l` 47LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l`
41if test $LINES -ne 1; then 48if test $LINES -ne 1; then
42 echo "FAIL: unexpected output (got $LINES lines, wanted 1)" 49 echo "FAIL: unexpected output (got $LINES lines, wanted 1)"
43 $exe -e 50 echo "Command output was:"
44 exit 1 51 cat $out
52 $exe -e > /dev/null
53 exit 1
45fi 54fi
46echo "PASS" 55echo "PASS"
47 56
@@ -54,32 +63,36 @@ if ! $exe $DEBUG -t resolver > $base.out; then
54fi 63fi
55LINES=`cat $base.out | grep resolver | grep not | wc -l` 64LINES=`cat $base.out | grep resolver | grep not | wc -l`
56if test $LINES -ne 0; then 65if test $LINES -ne 0; then
57 echo "FAIL: unexpected output" 66 echo "FAIL: unexpected output:"
58 $exe -e 67 cat $base.out
59 exit 1 68 $exe -e
69 exit 1
60fi 70fi
61LINES=`cat $base.out | grep resolver | grep -v not | wc -l` 71LINES=`cat $base.out | grep resolver | grep -v not | wc -l`
62if test $LINES -ne 1; then 72if test $LINES -ne 1; then
63 echo "FAIL: unexpected output" 73 echo "FAIL: unexpected output"
64 $exe -e 74 cat $base.out
65 exit 1 75 $exe -e
76 exit 1
66fi 77fi
67echo "PASS" 78echo "PASS"
68 79
69# ---------------------------------------------------------------------------------- 80# ----------------------------------------------------------------------------------
70echo -n "TEST: Stop a service... " 81echo -n "TEST: Stop a service... "
71 82
72if ! $exe $DEBUG -k resolver > /dev/null; then 83if ! $exe $DEBUG -k resolver > $out; then
73 echo "FAIL: error running $exe" 84 echo "FAIL: error running $exe"
74 $exe -e 85 $exe -e
75 exit 1 86 exit 1
76fi 87fi
77sleep 1 88sleep 1
78LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l` 89LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l`
79if test $LINES -ne 0; then 90if test $LINES -ne 0; then
80 echo "FAIL: unexpected output" 91 echo "FAIL: unexpected output"
81 $exe -e 92 echo "Command output was:"
82 exit 1 93 cat $out
94 $exe -e > /dev/null
95 exit 1
83fi 96fi
84echo "PASS" 97echo "PASS"
85 98
@@ -87,31 +100,37 @@ echo "PASS"
87echo -n "TEST: Test -t on stopped service... " 100echo -n "TEST: Test -t on stopped service... "
88 101
89if ! $exe $DEBUG -t resolver > $base.out; then 102if ! $exe $DEBUG -t resolver > $base.out; then
90 echo "FAIL: error running $exe" 103 echo "FAIL: error running $exe"
91 $exe -e 104 cat $base.out
92 exit 1 105 $exe -e > /dev/null
106 exit 1
93fi 107fi
94LINES=`cat $base.out | grep resolver | grep not | wc -l` 108LINES=`cat $base.out | grep resolver | grep not | wc -l`
95if test $LINES -ne 1; then 109if test $LINES -ne 1; then
96 echo "FAIL: unexpected output" 110 echo "FAIL: unexpected output"
97 $exe -e 111 cat $base.out
98 exit 1 112 $exe -e > /dev/null
113 exit 1
99fi 114fi
100echo "PASS" 115echo "PASS"
101 116
102# ---------------------------------------------------------------------------------- 117# ----------------------------------------------------------------------------------
103echo -n "TEST: Stop ARM... " 118echo -n "TEST: Stop ARM... "
104 119
105if ! $exe $DEBUG -e > /dev/null; then 120if ! $exe $DEBUG -e > $out; then
106 echo "FAIL: error running $exe" 121 echo "FAIL: error running $exe"
107 exit 1 122 exit 1
108fi 123fi
124sleep 1
109LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l` 125LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l`
110if test $LINES -ne 0; then 126if test $LINES -ne 0; then
111 echo "FAIL: unexpected output" 127 echo "FAIL: unexpected output, still have $LINES gnunet-service-arm processes"
112 exit 1 128 echo "Command output was:"
129 cat $out
130 exit 1
113fi 131fi
114echo "PASS" 132echo "PASS"
115 133
116rm -rf /tmp/test-gnunetd-arm/ 134rm -rf /tmp/test-gnunetd-arm/
117rm -f $base.out 135rm -f $base.out $out
136