3 rm -rf /tmp/test-gnunetd-arm/
4 exe="./gnunet-arm -c test_arm_api_data.conf"
5 base=/tmp/gnunet-test-arm
6 out=/tmp/test-gnunetd-arm.log
9 # ----------------------------------------------------------------------------------
10 echo -n "TEST: Bad argument checking... "
12 if $exe -x 2> /dev/null; then
13 echo "FAIL: error running $exe"
18 # ----------------------------------------------------------------------------------
19 echo -n "TEST: Start ARM... "
21 if ! $exe $DEBUG -s > $out ; then
22 echo "FAIL: error running $exe"
23 echo "Command output was:"
27 LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l`
28 if test $LINES -eq 0; then
29 echo "FAIL: found $LINES gnunet-service-arm processes"
30 echo "Command output was:"
36 # ----------------------------------------------------------------------------------
37 echo -n "TEST: Start another service... "
39 if ! $exe $DEBUG -i resolver > $out ; then
40 echo "FAIL: error running $exe"
41 echo "Command output was:"
47 LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l`
48 if test $LINES -ne 1; then
49 echo "FAIL: unexpected output (got $LINES lines, wanted 1)"
50 echo "Command output was:"
57 # ----------------------------------------------------------------------------------
58 echo -n "TEST: Test -t on running service... "
60 if ! $exe $DEBUG -t resolver > $base.out; then
61 echo "FAIL: error running $exe"
64 LINES=`cat $base.out | grep resolver | grep not | wc -l`
65 if test $LINES -ne 0; then
66 echo "FAIL: unexpected output:"
71 LINES=`cat $base.out | grep resolver | grep -v not | wc -l`
72 if test $LINES -ne 1; then
73 echo "FAIL: unexpected output"
80 # ----------------------------------------------------------------------------------
81 echo -n "TEST: Stop a service... "
83 if ! $exe $DEBUG -k resolver > $out; then
84 echo "FAIL: error running $exe"
89 LINES=`ps ax | grep gnunet-service-resolver | grep -v grep | wc -l`
90 if test $LINES -ne 0; then
91 echo "FAIL: unexpected output"
92 echo "Command output was:"
99 # ----------------------------------------------------------------------------------
100 echo -n "TEST: Test -t on stopped service... "
102 if ! $exe $DEBUG -t resolver > $base.out; then
103 echo "FAIL: error running $exe"
108 LINES=`cat $base.out | grep resolver | grep not | wc -l`
109 if test $LINES -ne 1; then
110 echo "FAIL: unexpected output"
117 # ----------------------------------------------------------------------------------
118 echo -n "TEST: Stop ARM... "
120 if ! $exe $DEBUG -e > $out; then
121 echo "FAIL: error running $exe"
125 LINES=`ps ax | grep gnunet-service-arm | grep -v grep | wc -l`
126 if test $LINES -ne 0; then
127 echo "FAIL: unexpected output, still have $LINES gnunet-service-arm processes"
128 echo "Command output was:"
134 rm -rf /tmp/test-gnunetd-arm/