xref: /openbsd-src/regress/usr.sbin/syslogd/args-memory-overflow-cont.pl (revision 6954f9bae03bdcbcc160f18219eea2b368c82bbc)
1aa580fcbSbluhm# Syslogc reads the memory logs continously.
2aa580fcbSbluhm# The client writes message to overflow the memory buffer method.
3aa580fcbSbluhm# The syslogd writes it into a file and through a pipe.
4aa580fcbSbluhm# The syslogd passes it via UDP to the loghost.
5aa580fcbSbluhm# The server receives the message on its UDP socket.
6aa580fcbSbluhm# Check that syslogc logs lost lines.
7aa580fcbSbluhm
8aa580fcbSbluhmuse strict;
9aa580fcbSbluhmuse warnings;
10aa580fcbSbluhm
11aa580fcbSbluhmour %args = (
12aa580fcbSbluhm    client => {
13aa580fcbSbluhm	func => sub {
14aa580fcbSbluhm	    my $self = shift;
15*6954f9baSbluhm	    write_lines($self, 300, 2000);
16aa580fcbSbluhm	    write_log($self);
17aa580fcbSbluhm	},
18aa580fcbSbluhm    },
19aa580fcbSbluhm    syslogd => {
20aa580fcbSbluhm	memory => 1,
21aa580fcbSbluhm	loggrep => {
22aa580fcbSbluhm	    qr/Accepting control connection/ => 1,
23aa580fcbSbluhm	    qr/ctlcmd 6/ => 1,  # read cont
24aa580fcbSbluhm	},
25aa580fcbSbluhm    },
26aa580fcbSbluhm    syslogc => [ {
27aa580fcbSbluhm	early => 1,
28aa580fcbSbluhm	stop => 1,
29aa580fcbSbluhm	options => ["-f", "memory"],
30aa580fcbSbluhm	down => qr/Lines were dropped!/,
31aa580fcbSbluhm	loggrep => {},
32aa580fcbSbluhm    } ],
33aa580fcbSbluhm);
34aa580fcbSbluhm
35aa580fcbSbluhm1;
36