summaryrefslogtreecommitdiff
path: root/src/arm
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-01 20:19:44 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-01 20:19:44 +0000
commitf5803d960e5983c906b9f7ae2ffff63b284e8098 (patch)
tree28f9924793b011be5a7529b02b71b807187fae73 /src/arm
parent0f6f81917b4978623ff76e28dd60c20bfc17489c (diff)
downloadgnunet-f5803d960e5983c906b9f7ae2ffff63b284e8098.tar.gz
gnunet-f5803d960e5983c906b9f7ae2ffff63b284e8098.zip
better ARM test script
Diffstat (limited to 'src/arm')
-rw-r--r--src/arm/arm.h2
-rwxr-xr-xsrc/arm/test_gnunet_arm.sh33
2 files changed, 30 insertions, 5 deletions
diff --git a/src/arm/arm.h b/src/arm/arm.h
index a8f5d0706..2293ec036 100644
--- a/src/arm/arm.h
+++ b/src/arm/arm.h
@@ -27,6 +27,6 @@
27 27
28#include "gnunet_common.h" 28#include "gnunet_common.h"
29 29
30#define DEBUG_ARM GNUNET_YES 30#define DEBUG_ARM GNUNET_NO
31 31
32#endif 32#endif
diff --git a/src/arm/test_gnunet_arm.sh b/src/arm/test_gnunet_arm.sh
index 85c9d5ea9..207e03d94 100755
--- a/src/arm/test_gnunet_arm.sh
+++ b/src/arm/test_gnunet_arm.sh
@@ -6,6 +6,21 @@ base=/tmp/gnunet-test-arm
6out=/tmp/test-gnunetd-arm.log 6out=/tmp/test-gnunetd-arm.log
7#DEBUG="-L DEBUG" 7#DEBUG="-L DEBUG"
8 8
9# -------------------------------------------
10echo -n "TEST: can this script work?... "
11LINES=`ps -C gnunet-service-arm -o pid= | wc -l`
12if test $LINES -ne 0; then
13 echo "No (arm exists). Exiting early."
14 exit 0
15fi
16LINES=`ps -C gnunet-service-resolver -o pid= | wc -l`
17if test $LINES -ne 0; then
18 echo "No (resolver exists). Exiting early."
19 exit 0
20fi
21echo "Yes."
22
23
9# ---------------------------------------------------------------------------------- 24# ----------------------------------------------------------------------------------
10echo -n "TEST: Bad argument checking... " 25echo -n "TEST: Bad argument checking... "
11 26
@@ -24,7 +39,7 @@ if ! $exe $DEBUG -s > $out ; then
24 cat $out 39 cat $out
25 exit 1 40 exit 1
26fi 41fi
27LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l` 42LINES=`ps -u $USER -C gnunet-service-arm -o pid= | wc -l`
28if test $LINES -eq 0; then 43if test $LINES -eq 0; then
29 echo "FAIL: found $LINES gnunet-service-arm processes" 44 echo "FAIL: found $LINES gnunet-service-arm processes"
30 echo "Command output was:" 45 echo "Command output was:"
@@ -44,7 +59,7 @@ if ! $exe $DEBUG -i resolver > $out ; then
44 exit 1 59 exit 1
45fi 60fi
46sleep 1 61sleep 1
47LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l` 62LINES=`ps -C gnunet-service-resolver -o pid= | wc -l`
48if test $LINES -ne 1; then 63if test $LINES -ne 1; then
49 echo "FAIL: unexpected output (got $LINES lines, wanted 1)" 64 echo "FAIL: unexpected output (got $LINES lines, wanted 1)"
50 echo "Command output was:" 65 echo "Command output was:"
@@ -86,8 +101,14 @@ if ! $exe $DEBUG -k resolver > $out; then
86 exit 1 101 exit 1
87fi 102fi
88sleep 1 103sleep 1
89LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l` 104LINES=`ps -C gnunet-service-resolver -o pid= | wc -l`
90if test $LINES -ne 0; then 105if test $LINES -ne 0; then
106 sleep 5
107 LINES=`ps -C gnunet-service-resolver -o pid= | wc -l`
108fi
109if test $LINES -ne 0; then
110 sleep 2
111
91 echo "FAIL: unexpected output" 112 echo "FAIL: unexpected output"
92 echo "Command output was:" 113 echo "Command output was:"
93 cat $out 114 cat $out
@@ -122,7 +143,11 @@ if ! $exe $DEBUG -e > $out; then
122 exit 1 143 exit 1
123fi 144fi
124sleep 1 145sleep 1
125LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l` 146LINES=`ps -C gnunet-service-arm -o pid= | wc -l`
147if test $LINES -ne 0; then
148 sleep 5
149 LINES=`ps -C gnunet-service-arm -o pid= | wc -l`
150fi
126if test $LINES -ne 0; then 151if test $LINES -ne 0; then
127 echo "FAIL: unexpected output, still have $LINES gnunet-service-arm processes" 152 echo "FAIL: unexpected output, still have $LINES gnunet-service-arm processes"
128 echo "Command output was:" 153 echo "Command output was:"