1# The syslogd listens on 127.0.0.1 TCP socket. 2# The client writes a message to Sys::Syslog TCP method. 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; 11 12our %args = ( 13 client => { 14 logsock => { type => "tcp", host => "127.0.0.1", port => 514 }, 15 }, 16 syslogd => { 17 options => ["-T", "127.0.0.1:514"], 18 fstat => { 19 qr/^root .* internet/ => 0, 20 qr/ internet6? stream tcp \w+ (127.0.0.1|\[::1\]):514$/ => 1, 21 }, 22 loggrep => { 23 qr/syslogd\[\d+\]: tcp logger .* accepted/ => 1, 24 qr/syslogd\[\d+\]: tcp logger .* connection close/ => 1, 25 }, 26 }, 27 file => { 28 loggrep => qr/ localhost syslogd-regress\[\d+\]: /. get_testgrep(), 29 }, 30); 31 321; 33