summaryrefslogtreecommitdiff
path: root/src/tests/test-switch.wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test-switch.wrapper')
-rwxr-xr-xsrc/tests/test-switch.wrapper21
1 files changed, 21 insertions, 0 deletions
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