1# The syslogd listens on localhost TLS socket.
2# The client writes a message into a localhost TLS 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_UNSPEC, proto => "tls", addr => "localhost",
16	    port => 6514 },
17	loggrep => {
18	    qr/connect sock: (127.0.0.1|::1) \d+/ => 1,
19	    get_testgrep() => 1,
20	},
21    },
22    syslogd => {
23	options => ["-S", "localhost"],
24	fstat => {
25	    qr/^root .* internet/ => 0,
26	    qr/ internet6? stream tcp \w+ (127.0.0.1|\[::1\]):6514$/ => 1,
27	},
28	ktrace => {
29	    qr{NAMI  "/etc/ssl/private/localhost.key"} => 1,
30	    qr{NAMI  "/etc/ssl/localhost.crt"} => 1,
31	},
32	loggrep => {
33	    qr{Keyfile /etc/ssl/private/localhost.key} => 1,
34	    qr{Certfile /etc/ssl/localhost.crt} => 1,
35	    qr/syslogd\[\d+\]: tls logger .* accepted/ => 1,
36	    qr/syslogd\[\d+\]: tls logger .* connection close/ => 1,
37	},
38    },
39    file => {
40	loggrep => {
41	    qr/ localhost /. get_testgrep() => 1,
42	},
43    },
44);
45
461;
47