summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-06-03 21:59:18 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2019-06-03 21:59:18 +0200
commit6bf570a75d250d07bad754f5d240b48d860feabf (patch)
tree627ce7a29b415b462a571d4f29ed455c3acc207d
parentc6f93342a70eac33b8f0de53877fbd8a6a3230f9 (diff)
downloadtwister-6bf570a75d250d07bad754f5d240b48d860feabf.tar.gz
twister-6bf570a75d250d07bad754f5d240b48d860feabf.tar.bz2
twister-6bf570a75d250d07bad754f5d240b48d860feabf.zip
Avoid making the big file in memory.
-rwxr-xr-xsrc/test/test_twister.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/test/test_twister.sh b/src/test/test_twister.sh
index 8ea34d1..77b0786 100755
--- a/src/test/test_twister.sh
+++ b/src/test/test_twister.sh
@@ -179,9 +179,13 @@ fi
echo "cumulative mods passed".
# Just upload a big blob; first with PUT then with POST.
-printf "{\"things\": \"%s\"}" \
- $(for i in $(seq 1 1000000000); do
- echo -n z; done) > BIGBLOB.json
+
+# printf "{\"things\": \"%s\"}" \
+# $(for i in $(seq 1 1000000000); do
+# echo -n z; done) > BIGBLOB.json
+
+dd if=/dev/urandom of=BIGBLOB count=2 bs=1MB
+printf "{\"things\": \"%s\"}" $(base64 BIGBLOB | tr -d '\n') > BIGBLOB.json
status_code=$(curl \
-s "${TWISTER_URL}BIGPUT" \
@@ -196,7 +200,7 @@ if ! test 200 = $status_code; then
echo "PUTting big blob failed (status == ${status_code})."
kill $web_server_pid
kill $twister_service_pid
- rm BIGBLOB.json
+ rm BIGBLOB*
exit 1
fi
echo "PUT big load passed".
@@ -214,13 +218,13 @@ if ! test 200 = $status_code; then
echo "POSTing big blob failed (status == ${status_code})."
kill $web_server_pid
kill $twister_service_pid
- rm BIGBLOB.json
+ rm BIGBLOB*
exit 1
fi
echo "POST big load passed".
-rm BIGBLOB.json
+rm BIGBLOB*
# shutdown twister and webserver
kill $web_server_pid