1
0
mirror of https://github.com/peterbourgon/runsvinit.git synced 2024-12-30 15:17:04 +00:00
runsvinit/zombietest
2015-10-07 15:39:45 +02:00
..
build Working test 2015-09-28 22:30:44 +02:00
Dockerfile Working test 2015-09-28 22:30:44 +02:00
Makefile Review feedback 2015-10-07 15:39:45 +02:00
README.md Working test 2015-09-28 22:30:44 +02:00
run-zombie Working test 2015-09-28 22:30:44 +02:00
test.bash Review feedback 2015-10-07 15:39:45 +02:00

zombietest

This directory contains an integration test to prove runsvinit is actually reaping zombies. make builds and executes the test as follows:

  1. We produce a linux/amd64 runsvinit binary by setting GOOS/GOARCH and invoking the Go compiler. Requires Go 1.5, or Go 1.4 built with the appropriate cross-compile options.

  2. The build/zombie.c program spawns five zombies and exits. We compile it for linux/amd64 via a zombietest-build container. We do this so make works from a Mac. This requires a working Docker installation.

  3. Once we have linux/amd64 runsvinit and zombie binaries, we produce a zombietest container via the Dockerfile. That container contains a single runit service, /etc/service/zombie, which supervises the zombie binary. We provide no default ENTRYPOINT, so we can supply it at runtime.

  4. Once the zombietest container is built, we invoke the test.bash script. That launches a version of the container with runsvinit set to NOT reap zombies, and after 1 second, verifies that zombies exist. Then, it launches a version of the container with runsvinit set to reap zombies, and after 1 second, verifies that no zombies exist.