1# The client writes a message to Sys::Syslog native method.
2# The syslogd writes it into a file and through a pipe.
3# The syslogd passes it via UDP to localhost.
4# The server receives the message on its UDP socket.
5# Check that localhost gets resolved to local IPv4 or IPv6 address.
6
7use strict;
8use warnings;
9use Socket;
10
11our %args = (
12    client => {
13	connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
14	loggrep => {
15	    qr/connect sock: (127.0.0.1|::1) \d+/ => 1,
16	    get_testlog() => 1,
17	},
18    },
19    syslogd => {
20	loghost => '@localhost:$connectport',
21	options => ["-u"],
22	loggrep => {
23	    qr/ from localhost, msg /.get_testlog() => 1,
24	},
25    },
26    server => {
27	listen => { domain => AF_UNSPEC, addr => "localhost" },
28	loggrep => {
29	    qr/listen sock: (127.0.0.1|::1) \d+/ => 1,
30	    get_testlog() => 1,
31	},
32    },
33);
34
351;
36