ctdb-server: Use find_public_ip_vnn() in a couple of extra places
[samba4-gss.git] / ctdb / tests / UNIT / cunit / sock_daemon_test_001.sh
blob6f360f76d4b993fbc72f8959ffd2cf138c7465a1
1 #!/bin/sh
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
5 pidfile="${CTDB_TEST_TMP_DIR}/sock_daemon_test.pid.$$"
6 sockpath="${CTDB_TEST_TMP_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|"
24 ok <<EOF
25 daemon started, pid=PID
26 startup failed, ret=1
27 daemon started, pid=PID
28 startup failed, ret=2
29 daemon started, pid=PID
30 startup completed successfully
31 listening on $sockpath
32 Shutting down
33 EOF
34 unit_test sock_daemon_test "$pidfile" "$sockpath" 1
36 ok <<EOF
37 daemon started, pid=PID
38 startup completed successfully
39 listening on $sockpath
40 Received signal $(sigcode SIGUSR1)
41 reconfigure failed, ret=1
42 Received signal $(sigcode SIGUSR1)
43 reconfigure completed successfully
44 Received signal 1
45 reopen logs, ret=1
46 Received signal 1
47 reopen logs completed successfully
48 Received signal $(sigcode SIGTERM)
49 Shutting down
50 daemon started, pid=PID
51 startup completed successfully
52 listening on $sockpath
53 Received signal $(sigcode SIGUSR1)
54 reconfigure failed, ret=2
55 Received signal $(sigcode SIGUSR1)
56 reconfigure completed successfully
57 Received signal 1
58 reopen logs failed, ret=2
59 Received signal 1
60 reopen logs completed successfully
61 Received signal $(sigcode SIGTERM)
62 Shutting down
63 EOF
64 unit_test sock_daemon_test "$pidfile" "$sockpath" 2
66 ok <<EOF
67 daemon started, pid=PID
68 listening on $sockpath
69 PID PID gone away, exiting
70 Shutting down
71 EOF
72 unit_test sock_daemon_test "$pidfile" "$sockpath" 3
74 ok <<EOF
75 daemon started, pid=PID
76 Shutting down
77 EOF
78 unit_test sock_daemon_test "$pidfile" "$sockpath" 4
80 ok <<EOF
81 daemon started, pid=PID
82 listening on $sockpath
83 Received signal $(sigcode SIGTERM)
84 Shutting down
85 EOF
86 unit_test sock_daemon_test "$pidfile" "$sockpath" 5
88 ok <<EOF
89 daemon started, pid=PID
90 listening on $sockpath
91 Shutting down
92 EOF
93 unit_test sock_daemon_test "$pidfile" "$sockpath" 6
95 ok <<EOF
96 daemon started, pid=PID
97 startup completed successfully
98 Received signal $(sigcode SIGTERM)
99 Shutting down
101 unit_test sock_daemon_test "$pidfile" "$sockpath" 7
103 ok <<EOF
104 daemon started, pid=PID
105 startup completed successfully
106 Received signal $(sigcode SIGTERM)
107 Shutting down
108 daemon started, pid=PID
109 startup completed successfully
110 Received signal $(sigcode SIGTERM)
111 Shutting down
113 unit_test sock_daemon_test "$pidfile" "$sockpath" 8
115 ok <<EOF
116 daemon started, pid=PID
117 startup completed successfully
118 Received signal $(sigcode SIGTERM)
119 Shutting down
120 daemon started, pid=PID
121 startup completed successfully
122 Received signal $(sigcode SIGTERM)
123 Shutting down
125 unit_test sock_daemon_test "$pidfile" "$sockpath" 9
127 ok <<EOF
128 daemon started, pid=PID
129 listening on $sockpath
130 daemon started, pid=PID
131 listening on $sockpath
132 Received signal $(sigcode SIGTERM)
133 Shutting down
135 unit_test sock_daemon_test "$pidfile" "$sockpath" 10