fix loops in sharness tests to fail the test if the inner command fails
This was hiding errors. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Dec 12, 2017 at 16:27 UTC
4d7231d655efb8adcb2f1831d21e2e046f8caabf
3 files changed
+31
-6
test/sharness/t0082-repo-gc-auto.sh
+1
-1
@@ -65,7 +65,7 @@ test_gc() {
65
test_expect_success "periodic auto gc stress test" '
66
for i in $(test_seq 1 20)
67
do
68
- test_gc
68
+ test_gc || return 1
69
done
70
'
71
test/sharness/t0110-gateway.sh
+29
-4
@@ -139,11 +139,36 @@ test_expect_success "refs IPFS directory file through readonly API succeeds" '
139
test_curl_gateway_api "refs?arg=$HASH2/test"
140
'
141
142
-test_expect_success "test gateway api is sanitized" '
143
- for cmd in "add" "block/put" "bootstrap" "config" "dht" "diag" "dns" "get" "id" "mount" "name/publish" "object/put" "object/new" "object/patch" "pin" "ping" "refs/local" "repo" "resolve" "stats" "swarm" "file" "update" "version" "bitswap"; do
142
+for cmd in add \
143
+ block/put \
144
+ bootstrap \
145
+ config \
146
+ dht \
147
+ diag \
148
+ dns \
149
+ get \
150
+ id \
151
+ mount \
152
+ name/publish \
153
+ object/put \
154
+ object/new \
155
+ object/patch \
156
+ pin \
157
+ ping \
158
+ refs/local \
159
+ repo \
160
+ resolve \
161
+ stats \
162
+ swarm \
163
+ file \
164
+ update \
165
+ version \
166
+ bitswap
167
+do
168
+ test_expect_success "test gateway api is sanitized" '
169
test_curl_resp_http_code "http://127.0.0.1:$port/api/v0/$cmd" "HTTP/1.1 404 Not Found"
145
- done
146
-'
170
+ '
171
+done
172
173
test_expect_success "create raw-leaves node" '
174
echo "This is RAW!" > rfile &&
test/sharness/t0250-files-api.sh
+1
-1
@@ -58,7 +58,7 @@ test_sharding() {
58
printf "" > list_exp_raw
59
for i in `seq 100`
60
do
61
- echo $i | ipfs files write --create /foo/file$i
61
+ echo $i | ipfs files write --create /foo/file$i || return 1
62
echo file$i >> list_exp_raw
63
done
64
'