winbindd_cm: Pass cm_open_connection the need_rw_dc flag
[Samba.git] / ctdb / tests / cunit / sock_daemon_test_001.sh
blob72e5532a3321e3d01d9dc930b2c6bd45f31627b4
1 #!/bin/sh
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
5 pidfile="${TEST_VAR_DIR}/sock_daemon_test.pid.$$"
6 sockpath="${TEST_VAR_DIR}/sock_daemon_test.sock.$$"
8 remove_files ()
10 rm -f "$pidfile"
11 rm -f "$sockpath"
14 test_cleanup remove_files
16 result_filter ()
18 _pid="[0-9][0-9]*"
19 sed -e "s|pid=${_pid}|pid=PID|" \
20 -e "s|PID ${_pid}|PID PID|" \
21 -e "s|\[${_pid}\]|[PID]|"
25 ok <<EOF
26 test1[PID]: listening on $sockpath
27 EOF
28 unit_test sock_daemon_test "$pidfile" "$sockpath" 1
30 ok <<EOF
31 test2[PID]: listening on $sockpath
32 test2[PID]: daemon started, pid=PID
33 test2[PID]: Received signal 1
34 test2[PID]: Received signal 10
35 test2[PID]: Received signal 15
36 test2[PID]: Shutting down
37 EOF
38 unit_test sock_daemon_test "$pidfile" "$sockpath" 2
40 ok <<EOF
41 test3[PID]: listening on $sockpath
42 test3[PID]: daemon started, pid=PID
43 test3[PID]: PID PID gone away, exiting
44 test3[PID]: Shutting down
45 EOF
46 unit_test sock_daemon_test "$pidfile" "$sockpath" 3
48 ok <<EOF
49 test4[PID]: daemon started, pid=PID
50 test4[PID]: Shutting down
51 EOF
52 unit_test sock_daemon_test "$pidfile" "$sockpath" 4
54 ok <<EOF
55 test5[PID]: listening on $sockpath
56 test5[PID]: daemon started, pid=PID
57 test5[PID]: Received signal 15
58 test5[PID]: Shutting down
59 EOF
60 unit_test sock_daemon_test "$pidfile" "$sockpath" 5
62 ok <<EOF
63 test6[PID]: listening on $sockpath
64 test6[PID]: daemon started, pid=PID
65 test6[PID]: Shutting down
66 EOF
67 unit_test sock_daemon_test "$pidfile" "$sockpath" 6