unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
blob d6c73ab7aab74cf9ee7db7338c9d5bbea7c54808 980 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 
#!/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 | count_lines )"
}

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 | count_lines )"
}

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

t_done

debug log:

solving d6c73ab ...
found d6c73ab in https://yhbt.net/unicorn.git/

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).