Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

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
latest commit 02a0727349
Eric Wong authored
..
Failed to load latest commit information.
bin
.gitignore remove SSL tests
GNUmakefile
README
broken-app.ru add broken app test from Rainbows!
detach.ru
env.ru tests: import basic TAP library from Rainbows!
fails-rack-lint.ru
heartbeat-timeout.ru add heartbeat timeout test from Rainbows!
hijack.ru ensure body is closed during hijack
listener_names.ru
my-tap-lib.sh my-tap-lib: fix race condition in verbose mode
oob_gc.ru tests: limit oobgc check to accepted sockets
oob_gc_path.ru
pid.ru
preread_input.ru
rack-input-tests.ru
t0000-http-basic.sh
t0001-reload-bad-config.sh
t0002-config-conflict.sh
t0002-parser-error.sh t/t0002-parser-error.sh: relax test for rack 1.6.0
t0003-working_directory.sh
t0004-heartbeat-timeout.sh
t0004-working_directory_broken.sh add test for erroring out when config.ru is bad
t0005-working_directory_app.rb.sh support for Rack hijack in request and response
t0006-reopen-logs.sh
t0006.ru
t0007-working_directory_no_embed_cli.sh tests: extra working_directory integration cases
t0008-back_out_of_upgrade.sh SIGHUP deals w/ dual master pid path scenario
t0009-broken-app.sh add broken app test from Rainbows!
t0009-winch_ttin.sh
t0010-reap-logging.sh log ERROR messages if workers exit with failure
t0011-active-unix-socket.sh tests: set executable bit on integration shell scripts
t0012-reload-empty-config.sh t0012: fix race condition in reload
t0013-rewindable-input-false.sh configurator: enable "rewindable_input" directive
t0013.ru
t0014-rewindable-input-true.sh
t0014.ru add missing test files
t0015-configurator-internals.sh
t0018-write-on-close.sh
t0019-max_header_len.sh
t0020-at_exit-handler.sh tests: set executable bit on integration shell scripts
t0021-process_detach.sh
t0022-listener_names-preload_app.sh bind listeners after loading for preload_app users
t0100-rack-input-tests.sh
t0116-client_body_buffer_size.sh
t0116.ru allow client_buffer_body_size to be tuned
t0200-rack-hijack.sh ensure body is closed during hijack
t0300-no-default-middleware.sh
t9000-preread-input.sh
t9001-oob_gc.sh
t9002-oob_gc-path.sh
test-lib.sh tests: "wc -l" portability for *BSDs
write-on-close.ru close client socket after closing response body

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
Something went wrong with that request. Please try again.