# Test with default values, that is:
# The client writes a message to Sys::Syslog native method.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, server log.

use strict;
use warnings;

our %args = (
);

1;

# The client writes long messages to UDP socket.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, server log.
# Check that lines in file have 8192 bytes message length after the header.
# Check that lines in server have 8192 bytes line length.

use strict;
use warnings;
use Socket;

my $msg = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

our %args = (
    client => {
	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
	func => \&write_length,
	lengths => [ 8190..8193 ],
    },
    syslogd => {
	options => ["-u"],
	loggrep => {
	    $msg => 4,
	}
    },
    server => {
	# >>> <13>Jan 31 00:10:11 0123456789ABC...lmn
	loggrep => {
	    qr/^>>> .{8192}$/ => 4,
	},
    },
    file => {
	# Jan 31 00:12:39 localhost 0123456789ABC...567
	loggrep => {
	    qr/^.{8216}$/ => 1,
	    qr/^.{8217}$/ => 1,
	    qr/^.{8218}$/ => 2,
	},
    },
);

1;

Write multiple long lines and check message length.
Write multiple long lines and check message length.
