10c5e6325Sbluhm# Stop syslogd.
20c5e6325Sbluhm# The client writes 8 message with 8192 to a localhost IPv6 UDP socket.
30c5e6325Sbluhm# Continue syslogd.
40c5e6325Sbluhm# The syslogd writes it into a file and through a pipe.
50c5e6325Sbluhm# The syslogd passes it via TCP to the loghost.
60c5e6325Sbluhm# The server receives the message on its TCP socket.
70c5e6325Sbluhm# Find the message in client, file, syslogd, server log.
80c5e6325Sbluhm# Check that 8 long UDP messages can be processed at once.
90c5e6325Sbluhm
100c5e6325Sbluhmuse strict;
110c5e6325Sbluhmuse warnings;
120c5e6325Sbluhmuse Socket;
130c5e6325Sbluhmuse constant MAXLINE => 8192;
140c5e6325Sbluhm
150c5e6325Sbluhmour %args = (
160c5e6325Sbluhm    client => {
170c5e6325Sbluhm	connect => { domain => AF_INET6, addr => "::1", port => 514 },
180c5e6325Sbluhm	func => sub {
190c5e6325Sbluhm	    my $self = shift;
200c5e6325Sbluhm	    ${$self->{syslogd}}->kill_syslogd('STOP');
210c5e6325Sbluhm	    write_lines($self, 8, MAXLINE);
220c5e6325Sbluhm	    IO::Handle::flush(\*STDOUT);
230c5e6325Sbluhm	    ${$self->{syslogd}}->kill_syslogd('CONT');
24070cd568Sbluhm	    ${$self->{server}}->loggrep(get_charlog(), 8)
25070cd568Sbluhm		or die ref($self), " server did not receive all messages";
260c5e6325Sbluhm	    write_shutdown($self);
270c5e6325Sbluhm	},
280c5e6325Sbluhm	loggrep => { get_charlog() => 8 },
290c5e6325Sbluhm    },
300c5e6325Sbluhm    syslogd => {
310c5e6325Sbluhm	options => ["-un"],
320c5e6325Sbluhm	loghost => '@tcp://localhost:$connectport',
330c5e6325Sbluhm	loggrep => {
340c5e6325Sbluhm	    qr/[gs]etsockopt bufsize/ => 0,
350c5e6325Sbluhm	    get_charlog() => 8,
360c5e6325Sbluhm	},
370c5e6325Sbluhm    },
380c5e6325Sbluhm    server => {
390c5e6325Sbluhm	listen => { domain => AF_UNSPEC, proto => "tcp", addr => "localhost" },
400c5e6325Sbluhm	loggrep => { get_charlog() => 8 },
410c5e6325Sbluhm    },
420c5e6325Sbluhm    file => {
430c5e6325Sbluhm	loggrep => { get_charlog() => 8 },
440c5e6325Sbluhm    },
45*7b30e940Sbluhm    pipe => { nocheck => 1 },
46*7b30e940Sbluhm    tty => { nocheck => 1 },
470c5e6325Sbluhm);
480c5e6325Sbluhm
490c5e6325Sbluhm1;
50