moby/libnetwork/wrapmake.sh
Jana Radhakrishnan ddfa448536 Allow tests to be interrupted
Currently when libnetwork tests are run inside a container
you cannot interrupt them in the middle by pressing ctrl-c
even though all the tests run in foreground. Fix this by running
tests by wrapping the make invocation inside the container
with a shell scripts which installs the SIGINT handler.
Without the handler the kernel does not deliver signals
to the process with PID 1(which in this case was make itself)
and hence make could never be interrupted. With this fix
we capture SIGINT in the shell script and re-raise it in the
the child process (which is make) and that makes the make
interruptible.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-01 21:48:09 -07:00

11 lines
101 B
Bash
Executable file

#!/usr/bin/env bash
set -e
function raise()
{
kill -$1 0
}
trap "raise SIGINT" SIGINT
make $1