1# The syslogd binds UDP socket on 127.0.0.1 and port.
2# The client writes a message into a 127.0.0.1 UDP 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 localhost name.
8# Check that fstat contains a bound UDP socket.
9
10use strict;
11use warnings;
12use Socket;
13require 'funcs.pl';
14
15my $port = find_ports(domain => AF_INET, addr => "127.0.0.1");
16
17our %args = (
18    client => {
19	connect => { domain => AF_INET, addr => "127.0.0.1", port => $port },
20    },
21    syslogd => {
22	options => ["-U", "127.0.0.1:$port"],
23	fstat => {
24	    qr/^root .* internet/ => 0,
25	    qr/^_syslogd .* internet/ => 3,
26	    qr/ internet dgram udp 127.0.0.1:$port$/ => 1,
27	},
28    },
29    file => {
30	loggrep => qr/ localhost /. get_testgrep(),
31    },
32);
33
341;
35