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/^_syslogd .* internet/ => 3, 27 qr/ internet6? stream tcp \w+ (127.0.0.1|\[::1\]):6514$/ => 1, 28 }, 29 ktrace => { 30 qr{NAMI "/etc/ssl/private/localhost.key"} => 1, 31 qr{NAMI "/etc/ssl/localhost.crt"} => 1, 32 }, 33 loggrep => { 34 qr{Keyfile /etc/ssl/private/localhost.key} => 1, 35 qr{Certfile /etc/ssl/localhost.crt} => 1, 36 qr/syslogd\[\d+\]: tls logger .* accepted/ => 1, 37 qr/syslogd\[\d+\]: tls logger .* connection close/ => 1, 38 }, 39 }, 40 file => { 41 loggrep => { 42 qr/ localhost /. get_testgrep() => 1, 43 }, 44 }, 45); 46 471; 48