commit e083f61c5fb04d93236bb1d6208f8c0422387556
Author: Jim Meyering <meyering(a)redhat.com>
Date: Thu Mar 8 09:41:31 2012 +0100
tests: minor clean up for the parallel abuse test
* t/exercise (iwhd_pid): Don't omit the newline after http code
in the initial bucket-creating loop. Theoretically this could
have caused a false-positive failure, if one query had failed
with say ?20, and the next with 1??, then their concatenation
would match the "201" that we grep for.
Also, use the curl_w function, rather than open-coding it (without
newline) and compensating for lack of a newline with a following "echo".
t/exercise | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/t/exercise b/t/exercise
index 73a669e..5ef4586 100755
--- a/t/exercise
+++ b/t/exercise
@@ -52,7 +52,7 @@ create_many()
# Create many buckets in parallel, though we'll use only
# the first $nb of them in the following loop.
- seq 2000 | parallel -j 200% curl -s --write-out '%{http_code}' -XPUT \
+ seq 2000 | parallel -j 200% curl -s --write-out '%{http_code}\n' -XPUT \
http://localhost:$port/b-{} > http-code || fail=1
grep -q 201 http-code || fail=1
@@ -79,9 +79,7 @@ create_many()
# Query for objects with A=V in the first bucket:
i=1
b=http://localhost:$port/b-$i
- curl --write-out '%{http_code}' -H 'Accept: */json' \
- -d '$A=="V"' $b/_query > q.json || fail=1
- echo >> q.json
+ curl_w -H 'Accept: */json' -d '$A=="V"' $b/_query > q.json
|| fail=1
# Require a 200 HTTP return code:
test "$(tail -1 q.json)" = 200 || fail=1