From bac91923ed46c6125dcd6df09a7f5801ad21ea61 Mon Sep 17 00:00:00 2001 From: craff Date: Tue, 17 Jan 2023 21:41:42 -1000 Subject: [PATCH] foo_50 is now produces with /dev/random and added a small doc and diff in stress.sh --- tests/dl-out.expect | 8 ++++---- tests/download_chunked.sh | 2 +- tests/dune | 2 +- tests/stress.sh | 5 ++++- tests/upload-out.expect | 2 +- tests/upload_chunked.sh | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/dl-out.expect b/tests/dl-out.expect index 80cda193..3ce00ace 100644 --- a/tests/dl-out.expect +++ b/tests/dl-out.expect @@ -1,5 +1,5 @@ serve directory . on http://127.0.0.1:8088 - 0 0 52428800 data21 - 0 0 52428800 data22 - 0 0 52428800 data23 - 0 0 157286400 total + 52428800 data21 + 52428800 data22 + 52428800 data23 +157286400 total diff --git a/tests/download_chunked.sh b/tests/download_chunked.sh index 5ee1e1b2..f7c65472 100755 --- a/tests/download_chunked.sh +++ b/tests/download_chunked.sh @@ -20,4 +20,4 @@ curl -N "http://localhost:${PORT}/foo_50" -o data23 \ -H 'Tranfer-encoding: chunked' --max-time 10 kill $PID -wc data21 data22 data23 +wc -c data21 data22 data23 diff --git a/tests/dune b/tests/dune index 25cc3826..b152cc52 100644 --- a/tests/dune +++ b/tests/dune @@ -39,7 +39,7 @@ (targets foo_50) (enabled_if (= %{system} "linux")) (action - (bash "dd if=/dev/zero of=%{targets} bs=1M count=50"))) + (bash "dd if=/dev/random of=%{targets} bs=1M count=50"))) (rule (targets upload-out) diff --git a/tests/stress.sh b/tests/stress.sh index bc5dc57f..a9a6476e 100755 --- a/tests/stress.sh +++ b/tests/stress.sh @@ -1,5 +1,8 @@ #!/bin/bash +# usage: source stress.sh path/http_of_dir.exe nb +# it will run np parallel curl to fetch file $url below + SERVER=$1 nb=$2 @@ -12,7 +15,7 @@ sleep_time=0 for (( c=1; c<=$nb; c++ )); do f=$(mktemp) - (curl -s $url > $f; stat -c %s $f; rm $f) & + (curl -s $url > $f; stat -c %s $f; diff foo_50 $f; rm $f) & PIDS[$c]=$! sleep $sleep_time diff --git a/tests/upload-out.expect b/tests/upload-out.expect index 7c5ca0cc..87637de1 100644 --- a/tests/upload-out.expect +++ b/tests/upload-out.expect @@ -1,2 +1,2 @@ serve directory . on http://127.0.0.1:8087 -upload successful 0 0 52428800 data +upload successful52428800 data diff --git a/tests/upload_chunked.sh b/tests/upload_chunked.sh index 5afebaca..58979895 100755 --- a/tests/upload_chunked.sh +++ b/tests/upload_chunked.sh @@ -14,4 +14,4 @@ cat foo_50 | curl -N -X PUT http://localhost:$PORT/data --data-binary @- \ -H 'Transfer-Encoding: chunked' --max-time 10 kill $PID -wc data +wc -c data