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
10 # ----------------------------------------------------------------------------------
11 echo -n "TEST: Bad argument checking... "
13 if $exe -x 2> /dev/null; then
14 echo "FAIL: error running $exe"
19 # ----------------------------------------------------------------------------------
20 echo -n "TEST: Start ARM... "
22 if ! $exe $DEBUG -s > $out ; then
23 echo "FAIL: error running $exe"
24 echo "Command output was:"
31 # ----------------------------------------------------------------------------------
32 echo -n "TEST: Start another service... "
34 if ! $exe $DEBUG -i resolver > $out ; then
35 echo "FAIL: error running $exe"
36 echo "Command output was:"
44 # ----------------------------------------------------------------------------------
45 echo -n "TEST: Test -t on running service... "
46 if ! $exe $DEBUG -t resolver > $base.out; then
47 echo "FAIL: error running $exe"
50 LINES=`cat $base.out | grep resolver | grep not | wc -l`
51 if test $LINES -ne 0; then
52 echo "FAIL: unexpected output:"
57 LINES=`cat $base.out | grep resolver | grep -v not | wc -l`
58 if test $LINES -ne 1; then
59 echo "FAIL: unexpected output"
66 # ----------------------------------------------------------------------------------
67 echo -n "TEST: Stop a service... "
69 if ! $exe $DEBUG -k resolver > $out; then
70 echo "FAIL: error running $exe"
77 # ----------------------------------------------------------------------------------
78 echo -n "TEST: Test -t on stopped service... "
79 if ! $exe $DEBUG -t resolver > $base.out; then
80 echo "FAIL: error running $exe"
85 LINES=`cat $base.out | grep resolver | grep not | wc -l`
86 if test $LINES -ne 1; then
87 echo "FAIL: unexpected output"
94 # ----------------------------------------------------------------------------------
95 echo -n "TEST: Stop ARM... "
97 if ! $exe $DEBUG -e > $out; then
98 echo "FAIL: error running $exe"
104 rm -rf /tmp/test-gnunetd-arm/