From 3cb4106b13aa883f3b704aa4026b78fd36db3756 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 2 Jul 2018 12:38:33 +0000 Subject: Add test framework, fix some bugs --- src/tests/test-switch.wrapper | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 src/tests/test-switch.wrapper (limited to 'src/tests/test-switch.wrapper') diff --git a/src/tests/test-switch.wrapper b/src/tests/test-switch.wrapper new file mode 100755 index 0000000..5117400 --- /dev/null +++ b/src/tests/test-switch.wrapper @@ -0,0 +1,21 @@ +#!/bin/sh -e + +S=./.test-switch-socket +F=./.test-switch-fifo + +pid=0 + +cleanup () { + kill $pid + rm -f $S +} + +mkfifo $F +head -n 1 < $F >/dev/null & +pid=$! +s6-ipcserver -1 -- $S ./nsssd-unix > $F & +wait $pid +pid=$! +rm -f $F +trap cleanup TERM INT EXIT +./test-switch -- cgit v1.3.1