Sha256: 11f5b9d821af41a7f8e121052d300ec4f152d859aedcb7a8ac9a8e4b419099de

Contents?: true

Size: 956 Bytes

Versions: 1

Compression:

Stored size: 956 Bytes

Contents

#!/bin/sh
nr_client=${nr_client-25}
nr=${nr-50}

. ./test-lib.sh
require_rev
test -r random_blob || die "random_blob required, run with 'make $0'"

eval $(unused_listen)
rtmpfiles unicorn_config curl_out curl_err r_err r_out pid

cat > $unicorn_config <<EOF
listen "$listen"
pid "$pid"
stderr_path "$r_err"
stdout_path "$r_out"
Rainbows! do
  use :Rev
  worker_connections $nr
end
EOF

echo pid=$pid
rainbows -D sha1.ru -c $unicorn_config
wait_for_pid $pid

start=$(date +%s)
for i in $(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev/null)
do
	(
		curl -sSf -T- http://$listen/$i \
		  < random_blob >> $curl_out 2>> $curl_err
	) &
done
wait
echo elapsed=$(( $(date +%s) - $start ))

kill $(cat $pid)
test $nr_client -eq $(wc -l < $curl_out)
test 1 -eq $(sort < $curl_out | uniq | wc -l)
blob_sha1=$( expr "$(sha1sum < random_blob)" : '\([a-f0-9]\+\)')
echo blob_sha1=$blob_sha1
test x"$blob_sha1" = x"$(sort < $curl_out | uniq)"
! grep Error $r_err

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rainbows-0.2.0 t/t4100-rev-rack-input.sh