aboutsummaryrefslogtreecommitdiff
path: root/src/statistics
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-23 20:15:55 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-23 20:15:55 +0000
commitcf69436d2bff114c097825eb5588f898396680cf (patch)
tree1f64f6b32dfa195ff824187343a3c7b54da8cc24 /src/statistics
parent7dcf37ac1b4955f3d5c66706be56d26b164b5853 (diff)
downloadgnunet-cf69436d2bff114c097825eb5588f898396680cf.tar.gz
gnunet-cf69436d2bff114c097825eb5588f898396680cf.zip
use mktmp
Diffstat (limited to 'src/statistics')
-rwxr-xr-xsrc/statistics/test_gnunet_statistics.sh24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/statistics/test_gnunet_statistics.sh b/src/statistics/test_gnunet_statistics.sh
index c94267939..b4c14cd6c 100755
--- a/src/statistics/test_gnunet_statistics.sh
+++ b/src/statistics/test_gnunet_statistics.sh
@@ -2,7 +2,7 @@
2 2
3rm -rf /tmp/test-gnunetd-statistics/ 3rm -rf /tmp/test-gnunetd-statistics/
4exe="./gnunet-statistics -c test_statistics_api_data.conf" 4exe="./gnunet-statistics -c test_statistics_api_data.conf"
5base=/tmp/gnunet-test-statistics 5out=`mktemp /tmp/test-gnunet-statistics-logXXXXXXXX`
6arm="gnunet-arm -c test_statistics_api_data.conf $DEBUG" 6arm="gnunet-arm -c test_statistics_api_data.conf $DEBUG"
7#DEBUG="-L DEBUG" 7#DEBUG="-L DEBUG"
8# ----------------------------------- 8# -----------------------------------
@@ -47,12 +47,12 @@ echo "PASS"
47# ---------------------------------------------------------------------------------- 47# ----------------------------------------------------------------------------------
48echo -n "TEST: viewing all stats..." 48echo -n "TEST: viewing all stats..."
49 49
50if ! $exe $DEBUG > $base.out; then 50if ! $exe $DEBUG > $out; then
51 echo "FAIL: error running $exe" 51 echo "FAIL: error running $exe"
52 $arm -e 52 $arm -e
53 exit 1 53 exit 1
54fi 54fi
55LINES=`cat $base.out | wc -l` 55LINES=`cat $out | wc -l`
56if test $LINES -ne 2; then 56if test $LINES -ne 2; then
57 echo "FAIL: unexpected output" 57 echo "FAIL: unexpected output"
58 $arm -e 58 $arm -e
@@ -63,12 +63,12 @@ echo "PASS"
63# ---------------------------------------------------------------------------------- 63# ----------------------------------------------------------------------------------
64echo -n "TEST: viewing stats by name..." 64echo -n "TEST: viewing stats by name..."
65 65
66if ! $exe $DEBUG -n other > $base.out; then 66if ! $exe $DEBUG -n other > $out; then
67 echo "FAIL: error running $exe" 67 echo "FAIL: error running $exe"
68 $arm -e 68 $arm -e
69 exit 1 69 exit 1
70fi 70fi
71LINES=`cat $base.out | grep 43 | wc -l` 71LINES=`cat $out | grep 43 | wc -l`
72if test $LINES -ne 1; then 72if test $LINES -ne 1; then
73 echo "FAIL: unexpected output" 73 echo "FAIL: unexpected output"
74 $arm -e 74 $arm -e
@@ -79,12 +79,12 @@ echo "PASS"
79# ---------------------------------------------------------------------------------- 79# ----------------------------------------------------------------------------------
80echo -n "TEST: viewing stats by subsystem..." 80echo -n "TEST: viewing stats by subsystem..."
81 81
82if ! $exe $DEBUG -s subsystem > $base.out; then 82if ! $exe $DEBUG -s subsystem > $out; then
83 echo "FAIL: error running $exe" 83 echo "FAIL: error running $exe"
84 $arm -e 84 $arm -e
85 exit 1 85 exit 1
86fi 86fi
87LINES=`cat $base.out | grep 42 | wc -l` 87LINES=`cat $out | grep 42 | wc -l`
88if test $LINES -ne 1; then 88if test $LINES -ne 1; then
89 echo "FAIL: unexpected output" 89 echo "FAIL: unexpected output"
90 $arm -e 90 $arm -e
@@ -114,12 +114,12 @@ echo "DONE"
114# ---------------------------------------------------------------------------------- 114# ----------------------------------------------------------------------------------
115echo -n "TEST: checking persistence..." 115echo -n "TEST: checking persistence..."
116 116
117if ! $exe $DEBUG > $base.out; then 117if ! $exe $DEBUG > $out; then
118 echo "FAIL: error running $exe" 118 echo "FAIL: error running $exe"
119 $arm -e 119 $arm -e
120 exit 1 120 exit 1
121fi 121fi
122LINES=`cat $base.out | grep 40 | wc -l` 122LINES=`cat $out | grep 40 | wc -l`
123if test $LINES -ne 1; then 123if test $LINES -ne 1; then
124 echo "FAIL: unexpected output" 124 echo "FAIL: unexpected output"
125 $arm -e 125 $arm -e
@@ -151,12 +151,12 @@ echo "DONE"
151# ---------------------------------------------------------------------------------- 151# ----------------------------------------------------------------------------------
152echo -n "TEST: checking removed persistence..." 152echo -n "TEST: checking removed persistence..."
153 153
154if ! $exe $DEBUG > $base.out; then 154if ! $exe $DEBUG > $out; then
155 echo "FAIL: error running $exe" 155 echo "FAIL: error running $exe"
156 $arm -e 156 $arm -e
157 exit 1 157 exit 1
158fi 158fi
159LINES=`cat $base.out | grep 40 | wc -l` 159LINES=`cat $out | grep 40 | wc -l`
160if test $LINES -ne 0; then 160if test $LINES -ne 0; then
161 echo "FAIL: unexpected output" 161 echo "FAIL: unexpected output"
162 $arm -e 162 $arm -e
@@ -169,5 +169,5 @@ echo -n "Stopping service..."
169$arm -e > /dev/null 169$arm -e > /dev/null
170sleep 1 170sleep 1
171echo "DONE" 171echo "DONE"
172rm -f $base.out 172rm -f $out
173rm -rf /tmp/test-gnunetd-statistics/ 173rm -rf /tmp/test-gnunetd-statistics/