commit 6bf570a75d250d07bad754f5d240b48d860feabf parent c6f93342a70eac33b8f0de53877fbd8a6a3230f9 Author: Marcello Stanisci <stanisci.m@gmail.com> Date: Mon, 3 Jun 2019 21:59:18 +0200 Avoid making the big file in memory. Diffstat:
| M | src/test/test_twister.sh | | | 16 | ++++++++++------ |
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git 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