xref: /openbsd-src/regress/usr.sbin/syslogd/args-client-tcp4.pl (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1# The syslogd listens on 127.0.0.1 TCP socket.
2# The client writes a message into a 127.0.0.1 TCP socket.
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;
11use Socket;
12
13our %args = (
14    client => {
15	connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
16	    port => 514 },
17	loggrep => {
18	    qr/connect sock: 127.0.0.1 \d+/ => 1,
19	    get_testgrep() => 1,
20	},
21    },
22    syslogd => {
23	options => ["-T", "127.0.0.1:514"],
24	fstat => {
25	    qr/^root .* internet/ => 0,
26	    qr/^_syslogd .* internet/ => 3,
27	    qr/ internet stream tcp \w+ 127.0.0.1:514$/ => 1,
28	},
29    },
30    file => {
31	loggrep => qr/ localhost /. get_testgrep(),
32    },
33);
34
351;
36