1# The client writes long messages to UDP socket.
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 lines in server have 1180 bytes line length.
7# Check that lines in file have 8192 bytes message length after the header.
8
9use strict;
10use warnings;
11use Socket;
12use constant MAX_UDPMSG => 1180;
13
14our %args = (
15    client => {
16	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
17	func => sub {
18	    my $self = shift;
19	    write_lengths($self, 8190..8193,9000);
20	    write_log($self);
21	},
22    },
23    syslogd => {
24	options => ["-u"],
25	loggrep => {
26	    get_charlog() => 5,
27	},
28    },
29    server => {
30	# >>> <13>Jan 31 00:10:11 0123456789ABC...lmn
31	loggrep => {
32	    get_charlog() => 5,
33	    qr/^>>> .{19} /.generate_chars(MAX_UDPMSG-20).qr/$/ => 5,
34	},
35    },
36    file => {
37	# Jan 31 00:12:39 localhost 0123456789ABC...567
38	loggrep => {
39	    get_charlog() => 5,
40	    qr/^.{25} .{8190}$/ => 1,
41	    qr/^.{25} .{8191}$/ => 1,
42	    qr/^.{25} .{8192}$/ => 3,
43	},
44    },
45);
46
471;
48