aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-03 19:51:40 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-03 19:51:40 +0000
commit9b8bd69a86700ede757a4a103be076b94806977b (patch)
treed9f4bc0f991344e8217c92e61a2d6b38430e5679 /src
parentb8761321fd66e516c2b1236d06f92804763bce8b (diff)
downloadgnunet-9b8bd69a86700ede757a4a103be076b94806977b.tar.gz
gnunet-9b8bd69a86700ede757a4a103be076b94806977b.zip
ps is not good enough to use for testing
Diffstat (limited to 'src')
-rwxr-xr-xsrc/arm/test_gnunet_arm.sh56
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
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# ---------------------------------------------------------------------------------- 10# ----------------------------------------------------------------------------------
25echo -n "TEST: Bad argument checking... " 11echo -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
41fi 27fi
42LINES=`ps -u $USER -C gnunet-service-arm -o pid= | wc -l`
43if 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
48fi
49echo "PASS" 28echo "PASS"
50sleep 1 29sleep 1
51 30
@@ -60,19 +39,10 @@ if ! $exe $DEBUG -i resolver > $out ; then
60 exit 1 39 exit 1
61fi 40fi
62sleep 1 41sleep 1
63LINES=`ps -C gnunet-service-resolver -o pid= | wc -l`
64if 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
70fi
71echo "PASS" 42echo "PASS"
72 43
73# ---------------------------------------------------------------------------------- 44# ----------------------------------------------------------------------------------
74echo -n "TEST: Test -t on running service... " 45echo -n "TEST: Test -t on running service... "
75
76if ! $exe $DEBUG -t resolver > $base.out; then 46if ! $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
103fi 73fi
104sleep 1 74sleep 1
105LINES=`ps -C gnunet-service-resolver -o pid= | wc -l`
106if test $LINES -ne 0; then
107 sleep 5
108 LINES=`ps -C gnunet-service-resolver -o pid= | wc -l`
109fi
110if 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
118fi
119echo "PASS" 75echo "PASS"
120 76
121# ---------------------------------------------------------------------------------- 77# ----------------------------------------------------------------------------------
122echo -n "TEST: Test -t on stopped service... " 78echo -n "TEST: Test -t on stopped service... "
123
124if ! $exe $DEBUG -t resolver > $base.out; then 79if ! $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
145fi 100fi
146sleep 1 101sleep 1
147LINES=`ps -C gnunet-service-arm -o pid= | wc -l`
148if test $LINES -ne 0; then
149 sleep 5
150 LINES=`ps -C gnunet-service-arm -o pid= | wc -l`
151fi
152if 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
157fi
158echo "PASS" 102echo "PASS"
159 103
160rm -rf /tmp/test-gnunetd-arm/ 104rm -rf /tmp/test-gnunetd-arm/