Latest commit 02a0727 Jun 9, 2015 Eric Wong ensure body is closed during hijack
Middlewares such as Rack::Lock (used by Rails) break badly unless
the response body is closed on hijack, so we will close it to follow
the lead of other popular Rack servers.

While it's unclear if there's anybody using rack.hijack with unicorn,
we'll try to emulate the behavior of other servers as much as
possible.

ref: ngauthier/tubesock#10
..
Failed to load latest commit information.
bin tests: remove utee Feb 4, 2013
.gitignore remove SSL tests Feb 19, 2014
GNUmakefile dev: remove isolate dependency Aug 17, 2014
README doc: update support status for Ruby versions Feb 6, 2015
broken-app.ru add broken app test from Rainbows! Jun 17, 2011
detach.ru shutdown client socket for apps which fork in background Apr 13, 2012
env.ru tests: import basic TAP library from Rainbows! Feb 18, 2010
fails-rack-lint.ru Make -N/--no-default-middleware option work Jun 7, 2013
heartbeat-timeout.ru add heartbeat timeout test from Rainbows! Jun 16, 2011
hijack.ru ensure body is closed during hijack Jun 10, 2015
listener_names.ru bind listeners after loading for preload_app users Aug 2, 2012
my-tap-lib.sh my-tap-lib: fix race condition in verbose mode Jun 10, 2010
oob_gc.ru tests: limit oobgc check to accepted sockets Oct 25, 2013
oob_gc_path.ru tests: limit oobgc check to accepted sockets Oct 25, 2013
pid.ru SIGHUP deals w/ dual master pid path scenario Jul 13, 2010
preread_input.ru add PrereadInput middleware to get around TeeInput Oct 9, 2010
rack-input-tests.ru tee_input: fix accounting error on corked requests Dec 8, 2010
t0000-http-basic.sh tests: "wc -l" portability for *BSDs Feb 4, 2013
t0001-reload-bad-config.sh error logging is more consistent Jun 17, 2011
t0002-config-conflict.sh Unicorn::builder to wrap our Rack::Builder usage Feb 19, 2010
t0002-parser-error.sh t/t0002-parser-error.sh: relax test for rack 1.6.0 Dec 21, 2014
t0003-working_directory.sh remove nasty ugly hacks at startup Aug 30, 2010
t0004-heartbeat-timeout.sh tests: "wc -l" portability for *BSDs Feb 4, 2013
t0004-working_directory_broken.sh add test for erroring out when config.ru is bad Jun 11, 2010
t0005-working_directory_app.rb.sh support for Rack hijack in request and response Jan 22, 2013
t0006-reopen-logs.sh tests: "wc -c" portability for *BSDs Feb 4, 2013
t0006.ru workaround rbx not reopening logs to stderr/stdout Jun 15, 2010
t0007-working_directory_no_embed_cli.sh tests: extra working_directory integration cases Jun 17, 2010
t0008-back_out_of_upgrade.sh SIGHUP deals w/ dual master pid path scenario Jul 13, 2010
t0009-broken-app.sh add broken app test from Rainbows! Jun 17, 2011
t0009-winch_ttin.sh SIGTTIN works after SIGWINCH Jul 16, 2010
t0010-reap-logging.sh log ERROR messages if workers exit with failure Aug 7, 2010
t0011-active-unix-socket.sh tests: set executable bit on integration shell scripts Apr 17, 2012
t0012-reload-empty-config.sh t0012: fix race condition in reload Oct 28, 2010
t0013-rewindable-input-false.sh configurator: enable "rewindable_input" directive Nov 10, 2010
t0013.ru add missing test files Nov 17, 2010
t0014-rewindable-input-true.sh configurator: enable "rewindable_input" directive Nov 10, 2010
t0014.ru add missing test files Nov 17, 2010
t0015-configurator-internals.sh configurator: ensure examples in FAQ still work Dec 8, 2010
t0018-write-on-close.sh close client socket after closing response body Jan 6, 2011
t0019-max_header_len.sh tests: "wc -c" portability for *BSDs Feb 4, 2013
t0020-at_exit-handler.sh tests: set executable bit on integration shell scripts Apr 17, 2012
t0021-process_detach.sh shutdown client socket for apps which fork in background Apr 13, 2012
t0022-listener_names-preload_app.sh bind listeners after loading for preload_app users Aug 2, 2012
t0100-rack-input-tests.sh tests: "wc -l" portability for *BSDs Feb 4, 2013
t0116-client_body_buffer_size.sh allow client_buffer_body_size to be tuned Dec 9, 2010
t0116.ru allow client_buffer_body_size to be tuned Dec 9, 2010
t0200-rack-hijack.sh ensure body is closed during hijack Jun 10, 2015
t0300-no-default-middleware.sh t0300: kill off stray processes in test Nov 8, 2013
t9000-preread-input.sh tests: "wc -l" portability for *BSDs Feb 4, 2013
t9001-oob_gc.sh oob_gc: reimplement to fix breakage and add tests Apr 29, 2011
t9002-oob_gc-path.sh tests: set executable bit on integration shell scripts Apr 17, 2012
test-lib.sh tests: "wc -l" portability for *BSDs Feb 4, 2013
write-on-close.ru close client socket after closing response body Jan 6, 2011

README

= Unicorn integration test suite

These are all integration tests that start the server on random, unused
TCP ports or Unix domain sockets.  They're all designed to run
concurrently with other tests to minimize test time, but tests may be
run independently as well.

We write our tests in Bourne shell because that's what we're
comfortable writing integration tests with.

== Requirements

* {Ruby 1.9.3+}[https://www.ruby-lang.org/] (duh!)
* {GNU make}[http://www.gnu.org/software/make/]
* {socat}[http://www.dest-unreach.org/socat/]
* {curl}[http://curl.haxx.se/]
* standard UNIX shell utilities (Bourne sh, awk, sed, grep, ...)

We do not use bashisms or any non-portable, non-POSIX constructs
in our shell code.  We use the "pipefail" option if available and
mainly test with {ksh}[http://kornshell.com/], but occasionally
with {dash}[http://gondor.apana.org.au/~herbert/dash/] and
{bash}[http://www.gnu.org/software/bash/], too.

== Running Tests

To run the entire test suite with 8 tests running at once:

  make -j8

To run one individual test:

  make t0000-simple-http.sh

You may also increase verbosity by setting the "V" variable for
GNU make.  To disable trapping of stdout/stderr:

  make V=1

To enable the "set -x" option in shell scripts to trace execution

  make V=2