1*15bf65a9Sbluhm# The syslogd listens on localhost TLS socket with client verification.
2*15bf65a9Sbluhm# The client connects with a client certificate and writes a message.
3*15bf65a9Sbluhm# The syslogd writes it into a file and through a pipe.
4*15bf65a9Sbluhm# The syslogd passes it via UDP to the loghost.
5*15bf65a9Sbluhm# The server receives the message on its UDP socket.
6*15bf65a9Sbluhm# Find the message in client, file, pipe, syslogd, server log.
7*15bf65a9Sbluhm# Check that the syslogd accepts client.
8*15bf65a9Sbluhm
9*15bf65a9Sbluhmuse strict;
10*15bf65a9Sbluhmuse warnings;
11*15bf65a9Sbluhmuse Socket;
12*15bf65a9Sbluhm
13*15bf65a9Sbluhmour %args = (
14*15bf65a9Sbluhm    client => {
15*15bf65a9Sbluhm	connect => { domain => AF_UNSPEC, proto => "tls", addr => "localhost",
16*15bf65a9Sbluhm	    port => 6514 },
17*15bf65a9Sbluhm	sslcert => "client.crt",
18*15bf65a9Sbluhm	sslkey => "client.key",
19*15bf65a9Sbluhm	loggrep => {
20*15bf65a9Sbluhm	    qr/connect sock: (127.0.0.1|::1) \d+/ => 1,
21*15bf65a9Sbluhm	    get_testgrep() => 1,
22*15bf65a9Sbluhm	},
23*15bf65a9Sbluhm    },
24*15bf65a9Sbluhm    syslogd => {
25*15bf65a9Sbluhm	options => ["-S", "localhost", "-K", "ca.crt"],
26*15bf65a9Sbluhm	ktrace => {
27*15bf65a9Sbluhm	    qr{NAMI  "ca.crt"} => 1,
28*15bf65a9Sbluhm	},
29*15bf65a9Sbluhm	loggrep => {
30*15bf65a9Sbluhm	    qr{Server CAfile ca.crt} => 1,
31*15bf65a9Sbluhm	    qr{tls logger .* accepted} => 1,
32*15bf65a9Sbluhm	},
33*15bf65a9Sbluhm    },
34*15bf65a9Sbluhm);
35*15bf65a9Sbluhm
36*15bf65a9Sbluhm1;
37