diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-23 20:15:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-23 20:15:55 +0000 |
commit | cf69436d2bff114c097825eb5588f898396680cf (patch) | |
tree | 1f64f6b32dfa195ff824187343a3c7b54da8cc24 /src/statistics | |
parent | 7dcf37ac1b4955f3d5c66706be56d26b164b5853 (diff) | |
download | gnunet-cf69436d2bff114c097825eb5588f898396680cf.tar.gz gnunet-cf69436d2bff114c097825eb5588f898396680cf.zip |
use mktmp
Diffstat (limited to 'src/statistics')
-rwxr-xr-x | src/statistics/test_gnunet_statistics.sh | 24 |
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 | ||
3 | rm -rf /tmp/test-gnunetd-statistics/ | 3 | rm -rf /tmp/test-gnunetd-statistics/ |
4 | exe="./gnunet-statistics -c test_statistics_api_data.conf" | 4 | exe="./gnunet-statistics -c test_statistics_api_data.conf" |
5 | base=/tmp/gnunet-test-statistics | 5 | out=`mktemp /tmp/test-gnunet-statistics-logXXXXXXXX` |
6 | arm="gnunet-arm -c test_statistics_api_data.conf $DEBUG" | 6 | arm="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 | # ---------------------------------------------------------------------------------- |
48 | echo -n "TEST: viewing all stats..." | 48 | echo -n "TEST: viewing all stats..." |
49 | 49 | ||
50 | if ! $exe $DEBUG > $base.out; then | 50 | if ! $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 |
54 | fi | 54 | fi |
55 | LINES=`cat $base.out | wc -l` | 55 | LINES=`cat $out | wc -l` |
56 | if test $LINES -ne 2; then | 56 | if 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 | # ---------------------------------------------------------------------------------- |
64 | echo -n "TEST: viewing stats by name..." | 64 | echo -n "TEST: viewing stats by name..." |
65 | 65 | ||
66 | if ! $exe $DEBUG -n other > $base.out; then | 66 | if ! $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 |
70 | fi | 70 | fi |
71 | LINES=`cat $base.out | grep 43 | wc -l` | 71 | LINES=`cat $out | grep 43 | wc -l` |
72 | if test $LINES -ne 1; then | 72 | if 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 | # ---------------------------------------------------------------------------------- |
80 | echo -n "TEST: viewing stats by subsystem..." | 80 | echo -n "TEST: viewing stats by subsystem..." |
81 | 81 | ||
82 | if ! $exe $DEBUG -s subsystem > $base.out; then | 82 | if ! $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 |
86 | fi | 86 | fi |
87 | LINES=`cat $base.out | grep 42 | wc -l` | 87 | LINES=`cat $out | grep 42 | wc -l` |
88 | if test $LINES -ne 1; then | 88 | if 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 | # ---------------------------------------------------------------------------------- |
115 | echo -n "TEST: checking persistence..." | 115 | echo -n "TEST: checking persistence..." |
116 | 116 | ||
117 | if ! $exe $DEBUG > $base.out; then | 117 | if ! $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 |
121 | fi | 121 | fi |
122 | LINES=`cat $base.out | grep 40 | wc -l` | 122 | LINES=`cat $out | grep 40 | wc -l` |
123 | if test $LINES -ne 1; then | 123 | if 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 | # ---------------------------------------------------------------------------------- |
152 | echo -n "TEST: checking removed persistence..." | 152 | echo -n "TEST: checking removed persistence..." |
153 | 153 | ||
154 | if ! $exe $DEBUG > $base.out; then | 154 | if ! $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 |
158 | fi | 158 | fi |
159 | LINES=`cat $base.out | grep 40 | wc -l` | 159 | LINES=`cat $out | grep 40 | wc -l` |
160 | if test $LINES -ne 0; then | 160 | if 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 |
170 | sleep 1 | 170 | sleep 1 |
171 | echo "DONE" | 171 | echo "DONE" |
172 | rm -f $base.out | 172 | rm -f $out |
173 | rm -rf /tmp/test-gnunetd-statistics/ | 173 | rm -rf /tmp/test-gnunetd-statistics/ |