1 nr_client
=${nr_client-4}
3 test -r random_blob || die
"random_blob required, run with 'make $0'"
6 rtmpfiles unicorn_config curl_out curl_err r_err r_out pid
8 cat > $unicorn_config <<EOF
18 rainbows
-D sha1.ru
-c $unicorn_config
22 for i
in $
(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev
/null
)
25 curl
-sSf -T- http
://$listen/$i \
26 < random_blob
>> $curl_out 2>> $curl_err
30 echo elapsed
=$
(( $
(date +%s
) - $start ))
33 test $nr_client -eq $
(wc -l < $curl_out)
34 test 1 -eq $
(sort < $curl_out |
uniq |
wc -l)
35 blob_sha1
=$
( expr "$(sha1sum < random_blob)" : '\([a-f0-9]\+\)')
36 echo blob_sha1
=$blob_sha1
37 test x
"$blob_sha1" = x
"$(sort < $curl_out | uniq)"