diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-03 19:51:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-03 19:51:40 +0000 |
commit | 9b8bd69a86700ede757a4a103be076b94806977b (patch) | |
tree | d9f4bc0f991344e8217c92e61a2d6b38430e5679 /src | |
parent | b8761321fd66e516c2b1236d06f92804763bce8b (diff) | |
download | gnunet-9b8bd69a86700ede757a4a103be076b94806977b.tar.gz gnunet-9b8bd69a86700ede757a4a103be076b94806977b.zip |
ps is not good enough to use for testing
Diffstat (limited to 'src')
-rwxr-xr-x | src/arm/test_gnunet_arm.sh | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/arm/test_gnunet_arm.sh b/src/arm/test_gnunet_arm.sh index c7028729b..00c31a573 100755 --- a/src/arm/test_gnunet_arm.sh +++ b/src/arm/test_gnunet_arm.sh | |||
@@ -6,20 +6,6 @@ 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 | # ---------------------------------------------------------------------------------- |
25 | echo -n "TEST: Bad argument checking... " | 11 | echo -n "TEST: Bad argument checking... " |
@@ -39,13 +25,6 @@ if ! $exe $DEBUG -s > $out ; then | |||
39 | cat $out | 25 | cat $out |
40 | exit 1 | 26 | exit 1 |
41 | fi | 27 | fi |
42 | LINES=`ps -u $USER -C gnunet-service-arm -o pid= | wc -l` | ||
43 | if test $LINES -eq 0; then | ||
44 | echo "FAIL: found $LINES gnunet-service-arm processes" | ||
45 | echo "Command output was:" | ||
46 | cat $out | ||
47 | exit 1 | ||
48 | fi | ||
49 | echo "PASS" | 28 | echo "PASS" |
50 | sleep 1 | 29 | sleep 1 |
51 | 30 | ||
@@ -60,19 +39,10 @@ if ! $exe $DEBUG -i resolver > $out ; then | |||
60 | exit 1 | 39 | exit 1 |
61 | fi | 40 | fi |
62 | sleep 1 | 41 | sleep 1 |
63 | LINES=`ps -C gnunet-service-resolver -o pid= | wc -l` | ||
64 | if test $LINES -ne 1; then | ||
65 | echo "FAIL: unexpected output (got $LINES lines, wanted 1)" | ||
66 | echo "Command output was:" | ||
67 | cat $out | ||
68 | $exe -e > /dev/null | ||
69 | exit 1 | ||
70 | fi | ||
71 | echo "PASS" | 42 | echo "PASS" |
72 | 43 | ||
73 | # ---------------------------------------------------------------------------------- | 44 | # ---------------------------------------------------------------------------------- |
74 | echo -n "TEST: Test -t on running service... " | 45 | echo -n "TEST: Test -t on running service... " |
75 | |||
76 | if ! $exe $DEBUG -t resolver > $base.out; then | 46 | if ! $exe $DEBUG -t resolver > $base.out; then |
77 | echo "FAIL: error running $exe" | 47 | echo "FAIL: error running $exe" |
78 | exit 1 | 48 | exit 1 |
@@ -102,25 +72,10 @@ if ! $exe $DEBUG -k resolver > $out; then | |||
102 | exit 1 | 72 | exit 1 |
103 | fi | 73 | fi |
104 | sleep 1 | 74 | sleep 1 |
105 | LINES=`ps -C gnunet-service-resolver -o pid= | wc -l` | ||
106 | if test $LINES -ne 0; then | ||
107 | sleep 5 | ||
108 | LINES=`ps -C gnunet-service-resolver -o pid= | wc -l` | ||
109 | fi | ||
110 | if test $LINES -ne 0; then | ||
111 | sleep 2 | ||
112 | |||
113 | echo "FAIL: unexpected output" | ||
114 | echo "Command output was:" | ||
115 | cat $out | ||
116 | $exe -e > /dev/null | ||
117 | exit 1 | ||
118 | fi | ||
119 | echo "PASS" | 75 | echo "PASS" |
120 | 76 | ||
121 | # ---------------------------------------------------------------------------------- | 77 | # ---------------------------------------------------------------------------------- |
122 | echo -n "TEST: Test -t on stopped service... " | 78 | echo -n "TEST: Test -t on stopped service... " |
123 | |||
124 | if ! $exe $DEBUG -t resolver > $base.out; then | 79 | if ! $exe $DEBUG -t resolver > $base.out; then |
125 | echo "FAIL: error running $exe" | 80 | echo "FAIL: error running $exe" |
126 | cat $base.out | 81 | cat $base.out |
@@ -144,17 +99,6 @@ if ! $exe $DEBUG -e > $out; then | |||
144 | exit 1 | 99 | exit 1 |
145 | fi | 100 | fi |
146 | sleep 1 | 101 | sleep 1 |
147 | LINES=`ps -C gnunet-service-arm -o pid= | wc -l` | ||
148 | if test $LINES -ne 0; then | ||
149 | sleep 5 | ||
150 | LINES=`ps -C gnunet-service-arm -o pid= | wc -l` | ||
151 | fi | ||
152 | if test $LINES -ne 0; then | ||
153 | echo "FAIL: unexpected output, still have $LINES gnunet-service-arm processes" | ||
154 | echo "Command output was:" | ||
155 | cat $out | ||
156 | exit 1 | ||
157 | fi | ||
158 | echo "PASS" | 102 | echo "PASS" |
159 | 103 | ||
160 | rm -rf /tmp/test-gnunetd-arm/ | 104 | rm -rf /tmp/test-gnunetd-arm/ |