xref: /openbsd-src/regress/usr.sbin/syslogd/args-memory-overflow.pl (revision 5b859c19fe53bbea08f5c342e0a4470e99f883e1)
1# The client writes message to overflow the memory buffer method.
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# Syslogc checks the memory logs.
6# Check that memory buffer has overflow flag.
7
8use strict;
9use warnings;
10
11our %args = (
12    client => {
13	func => sub {
14	    my $self = shift;
15	    foreach (1..4) {
16		write_message($self, $_ x 1024);
17	    }
18	    write_log($self);
19	},
20    },
21    syslogd => {
22	memory => 1,
23	loggrep => {
24	    qr/Accepting control connection/ => 5,
25	    qr/ctlcmd 1/ => 1,  # read
26	    qr/ctlcmd 2/ => 1,  # read clear
27	    qr/ctlcmd 4/ => 3,  # list
28	},
29    },
30    syslogc => [ {
31	options => ["-q"],
32	loggrep => qr/^memory\* /,
33    }, {
34	options => ["memory"],
35	down => get_downlog(),
36	loggrep => {},
37    }, {
38	options => ["-q"],
39	loggrep => qr/^memory\* /,
40    }, {
41	options => ["-c", "memory"],
42	down => get_downlog(),
43	loggrep => {},
44    }, {
45	options => ["-q"],
46	loggrep => qr/^memory /,
47    } ],
48);
49
501;
51