args-length-vis.pl revision 1.1
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
12my $msg = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
13
14our %args = (
15    client => {
16	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
17	func => \&write_length,
18	lengths => [ 8186..8195,9000 ],
19	tail => "foo\200",
20    },
21    syslogd => {
22	options => ["-u"],
23	loggrep => {
24	    $msg => 11,
25	}
26    },
27    file => {
28	# Jan 31 00:12:39 localhost 0123456789ABC...567
29	loggrep => {
30	    $msg => 11,
31	    qr/^.{25} .{8182}foo\\M\^\@$/ => 1,
32	    qr/^.{25} .{8183}foo\\M\^\@$/ => 1,
33	    qr/^.{25} .{8184}foo\\M\^\@$/ => 1,
34	    qr/^.{25} .{8185}foo\\M\^\@$/ => 1,
35	    qr/^.{25} .{8186}foo\\M\^$/ => 1,
36	    qr/^.{25} .{8187}foo\\M$/ => 1,
37	    qr/^.{25} .{8188}foo\\$/ => 1,
38	    qr/^.{25} .{8189}foo$/ => 1,
39	    qr/^.{25} .{8190}fo$/ => 1,
40	    qr/^.{25} .{8191}f$/ => 1,
41	    qr/^.{25} .{8192}$/ => 8,
42	},
43    },
44);
45
461;
47