summaryrefslogtreecommitdiff
path: root/src/tests/test-switch.wrapper
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-07-02 12:38:33 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-07-02 12:38:33 +0000
commit3cb4106b13aa883f3b704aa4026b78fd36db3756 (patch)
tree7909fa214055aa344a71b515c8781c03db32ab79 /src/tests/test-switch.wrapper
parent42c3adc8841167026bb8409cb5e4390a32bff49a (diff)
downloadnsss-3cb4106b13aa883f3b704aa4026b78fd36db3756.tar.xz
Add test framework, fix some bugs
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