args-length-vis.pl revision 1.2
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 log.
6# Check that lines with visual encoding at the end are truncated.
7
8use strict;
9use warnings;
10use Socket;
11
12our %args = (
13    client => {
14	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
15	func => \&write_length,
16	lengths => [ 8186..8195,9000 ],
17	tail => "foo\200",
18    },
19    syslogd => {
20	options => ["-u"],
21	loggrep => {
22	    get_charlog() => 11,
23	}
24    },
25    file => {
26	# Jan 31 00:12:39 localhost 0123456789ABC...567
27	loggrep => {
28	    get_charlog() => 11,
29	    qr/^.{25} .{8182}foo\\M\^\@$/ => 1,
30	    qr/^.{25} .{8183}foo\\M\^\@$/ => 1,
31	    qr/^.{25} .{8184}foo\\M\^\@$/ => 1,
32	    qr/^.{25} .{8185}foo\\M\^\@$/ => 1,
33	    qr/^.{25} .{8186}foo\\M\^$/ => 1,
34	    qr/^.{25} .{8187}foo\\M$/ => 1,
35	    qr/^.{25} .{8188}foo\\$/ => 1,
36	    qr/^.{25} .{8189}foo$/ => 1,
37	    qr/^.{25} .{8190}fo$/ => 1,
38	    qr/^.{25} .{8191}f$/ => 1,
39	    qr/^.{25} .{8192}$/ => 8,
40	},
41    },
42);
43
441;
45