1
0
mirror of https://github.com/peterbourgon/runsvinit.git synced 2024-12-16 14:57:04 +00:00
runsvinit/zombietest
2015-09-30 20:06:02 -05:00
..
build Working test 2015-09-28 22:30:44 +02:00
Dockerfile Working test 2015-09-28 22:30:44 +02:00
Makefile Call $(RM) does not include -- 2015-09-30 20:06:02 -05: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 Try Circle 2015-09-28 23:18:24 +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.