Sha256: efdf12211d7acf82137ce5a2decc757f12882d1b9f509ebdf77cbe072535825f

Contents?: true

Size: 968 Bytes

Versions: 45

Compression:

Stored size: 968 Bytes

Contents

#!/bin/sh
. ./test-lib.sh
t_plan 9 "PrereadInput middleware tests"

t_begin "setup and start" && {
	random_blob_sha1=$(rsha1 < random_blob)
	unicorn_setup
	unicorn  -D -c $unicorn_config preread_input.ru
	unicorn_wait_start
}

t_begin "single identity request" && {
	curl -sSf -T random_blob http://$listen/ > $tmp
}

t_begin "sha1 matches" && {
	test x"$(cat $tmp)" = x"$random_blob_sha1"
}

t_begin "single chunked request" && {
	curl -sSf -T- < random_blob http://$listen/ > $tmp
}

t_begin "sha1 matches" && {
	test x"$(cat $tmp)" = x"$random_blob_sha1"
}

t_begin "app only dispatched twice" && {
	test 2 -eq "$(grep 'app dispatch:' < $r_err | wc -l )"
}

t_begin "aborted chunked request" && {
	rm -f $tmp
	curl -sSf -T- < $fifo http://$listen/ > $tmp &
	curl_pid=$!
	kill -9 $curl_pid
	wait
}

t_begin "app only dispatched twice" && {
	test 2 -eq "$(grep 'app dispatch:' < $r_err | wc -l )"
}

t_begin "killing succeeds" && {
	kill -QUIT $unicorn_pid
}

t_done

Version data entries

45 entries across 45 versions & 4 rubygems

Version Path
boourns-unicorn-4.4.9 t/t9000-preread-input.sh
unicorn-4.6.0pre1 t/t9000-preread-input.sh
unicorn-4.5.0 t/t9000-preread-input.sh
unicorn-4.5.0pre1 t/t9000-preread-input.sh
boourns-unicorn-4.4.8 t/t9000-preread-input.sh
boourns-unicorn-4.4.6 t/t9000-preread-input.sh
boourns-unicorn-4.4.5 t/t9000-preread-input.sh
boourns-unicorn-4.4.4 t/t9000-preread-input.sh
boourns-unicorn-4.4.3 t/t9000-preread-input.sh
boourns-unicorn-4.4.2 t/t9000-preread-input.sh
boourns-unicorn-4.4.1 t/t9000-preread-input.sh
unicorn-4.4.0 t/t9000-preread-input.sh
preplay_unicorn-4.3.1.2.gc450 t/t9000-preread-input.sh
unicorn-lb-patch-4.3.1.13.gb7d9 t/t9000-preread-input.sh
unicorn-lb-patch-4.3.1.11.g21b8.dirty t/t9000-preread-input.sh
unicorn-4.3.1 t/t9000-preread-input.sh
unicorn-4.3.0.2.g4551 t/t9000-preread-input.sh
unicorn-4.3.0 t/t9000-preread-input.sh
unicorn-4.2.1 t/t9000-preread-input.sh
unicorn-4.2.0 t/t9000-preread-input.sh