summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd/args-length-vis.pl
blob: c3f03c2b18b90204f874c3e3303778973953a67f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 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 log.
# Check that lines with visual encoding at the end are truncated.

use strict;
use warnings;
use Socket;

our %args = (
    client => {
	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
	func => sub {
	    my $self = shift;
	    write_lengths($self, [8186..8195,9000], "foo\200"),
	    write_log($self);
	},
    },
    syslogd => {
	options => ["-u"],
	loggrep => {
	    get_charlog() => 11,
	},
    },
    file => {
	# Jan 31 00:12:39 localhost 0123456789ABC...567
	loggrep => {
	    get_charlog() => 11,
	    qr/^.{25} .{8182}foo\\M\^\@$/ => 1,
	    qr/^.{25} .{8183}foo\\M\^\@$/ => 1,
	    qr/^.{25} .{8184}foo\\M\^\@$/ => 1,
	    qr/^.{25} .{8185}foo\\M\^\@$/ => 1,
	    qr/^.{25} .{8186}foo\\M\^$/ => 1,
	    qr/^.{25} .{8187}foo\\M$/ => 1,
	    qr/^.{25} .{8188}foo\\$/ => 1,
	    qr/^.{25} .{8189}foo$/ => 1,
	    qr/^.{25} .{8190}fo$/ => 1,
	    qr/^.{25} .{8191}f$/ => 1,
	    qr/^.{25} .{8192}$/ => 8,
	},
    },
);

1;