diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-01 20:19:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-01 20:19:44 +0000 |
commit | f5803d960e5983c906b9f7ae2ffff63b284e8098 (patch) | |
tree | 28f9924793b011be5a7529b02b71b807187fae73 /src | |
parent | 0f6f81917b4978623ff76e28dd60c20bfc17489c (diff) | |
download | gnunet-f5803d960e5983c906b9f7ae2ffff63b284e8098.tar.gz gnunet-f5803d960e5983c906b9f7ae2ffff63b284e8098.zip |
better ARM test script
Diffstat (limited to 'src')
-rw-r--r-- | src/arm/arm.h | 2 | ||||
-rwxr-xr-x | src/arm/test_gnunet_arm.sh | 33 |
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 | |||
6 | out=/tmp/test-gnunetd-arm.log | 6 | out=/tmp/test-gnunetd-arm.log |
7 | #DEBUG="-L DEBUG" | 7 | #DEBUG="-L DEBUG" |
8 | 8 | ||
9 | # ------------------------------------------- | ||
10 | echo -n "TEST: can this script work?... " | ||
11 | LINES=`ps -C gnunet-service-arm -o pid= | wc -l` | ||
12 | if test $LINES -ne 0; then | ||
13 | echo "No (arm exists). Exiting early." | ||
14 | exit 0 | ||
15 | fi | ||
16 | LINES=`ps -C gnunet-service-resolver -o pid= | wc -l` | ||
17 | if test $LINES -ne 0; then | ||
18 | echo "No (resolver exists). Exiting early." | ||
19 | exit 0 | ||
20 | fi | ||
21 | echo "Yes." | ||
22 | |||
23 | |||
9 | # ---------------------------------------------------------------------------------- | 24 | # ---------------------------------------------------------------------------------- |
10 | echo -n "TEST: Bad argument checking... " | 25 | echo -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 |
26 | fi | 41 | fi |
27 | LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l` | 42 | LINES=`ps -u $USER -C gnunet-service-arm -o pid= | wc -l` |
28 | if test $LINES -eq 0; then | 43 | if 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 |
45 | fi | 60 | fi |
46 | sleep 1 | 61 | sleep 1 |
47 | LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l` | 62 | LINES=`ps -C gnunet-service-resolver -o pid= | wc -l` |
48 | if test $LINES -ne 1; then | 63 | if 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 |
87 | fi | 102 | fi |
88 | sleep 1 | 103 | sleep 1 |
89 | LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l` | 104 | LINES=`ps -C gnunet-service-resolver -o pid= | wc -l` |
90 | if test $LINES -ne 0; then | 105 | if test $LINES -ne 0; then |
106 | sleep 5 | ||
107 | LINES=`ps -C gnunet-service-resolver -o pid= | wc -l` | ||
108 | fi | ||
109 | if 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 |
123 | fi | 144 | fi |
124 | sleep 1 | 145 | sleep 1 |
125 | LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l` | 146 | LINES=`ps -C gnunet-service-arm -o pid= | wc -l` |
147 | if test $LINES -ne 0; then | ||
148 | sleep 5 | ||
149 | LINES=`ps -C gnunet-service-arm -o pid= | wc -l` | ||
150 | fi | ||
126 | if test $LINES -ne 0; then | 151 | if 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:" |