1# The client writes a message to Sys::Syslog native method.
2# The syslogd writes it into a file and through a pipe.
3# The syslogd passes it via UDP to the loghost.
4# The server receives the message on its UDP socket.
5# Find the message in client, file, pipe, syslogd, server log.
6# Check that a SIGTERM terminates the syslogd child process.
7
8use strict;
9use warnings;
10
11our %args = (
12    client => {
13	func => sub {
14	    my $self = shift;
15	    write_message($self, get_testlog());
16	    ${$self->{server}}->loggrep(qr/: exiting on signal/, 8)
17		or die ref($self), " no ': exiting on signal' server log";
18	},
19    },
20    syslogd => {
21	ktrace => {
22	    qr/syslogd  PSIG  SIGTERM caught handler/ => 1,
23	    qr/syslogd  RET   execve JUSTRETURN/ => 2,
24	},
25	loggrep => {
26	    qr/syslogd: exited/ => 1,
27	},
28    },
29    server => {
30	func => sub {
31	    my $self = shift;
32	    read_message($self, get_testgrep());
33	    ${$self->{syslogd}}->kill_syslogd('TERM');
34	    read_message($self, qr/: exiting on signal/);
35	},
36	down => qr/syslogd\[\d+\]: exiting on signal 15/,
37    },
38);
39
401;
41