xref: /openbsd-src/regress/usr.sbin/syslogd/args-client-tcp.pl (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1# The syslogd listens on 127.0.0.1 TCP socket.
2# The client writes a message to Sys::Syslog TCP method.
3# The syslogd writes it into a file and through a pipe.
4# The syslogd passes it via UDP to the loghost.
5# The server receives the message on its UDP socket.
6# Find the message in client, file, pipe, syslogd, server log.
7# Check that the file log contains the hostname and message.
8
9use strict;
10use warnings;
11
12our %args = (
13    client => {
14	logsock => { type => "tcp", host => "127.0.0.1", port => 514 },
15    },
16    syslogd => {
17	options => ["-T", "127.0.0.1:514"],
18	fstat => {
19	    qr/^root .* internet/ => 0,
20	    qr/^_syslogd .* internet/ => 3,
21	    qr/ internet6? stream tcp \w+ (127.0.0.1|\[::1\]):514$/ => 1,
22	},
23	loggrep => {
24	    qr/syslogd: tcp logger .* accepted/ => 1,
25	    qr/syslogd: tcp logger .* connection close/ => 1,
26	},
27    },
28    file => {
29	loggrep => qr/ localhost syslogd-regress\[\d+\]: /. get_testgrep(),
30    },
31);
32
331;
34