1# The syslogd has a non existing log file in its config. 2# The client waits for syslogd startup and sends sighup. 3# The client writes a message to Sys::Syslog native method. 4# The syslogd writes it into a file and through a pipe and to tty. 5# The syslogd passes it via UDP to the loghost. 6# The server receives the message on its UDP socket. 7# Find the message in client, file, pipe, console, user, syslogd, server log. 8# Check that only the error message is twice in the console log. 9 10use strict; 11use warnings; 12 13our %args = ( 14 client => { 15 func => sub { 16 my $self = shift; 17 ${$self->{syslogd}}->loggrep("syslogd: started", 5) 18 or die ref($self), " no 'syslogd: started' in log"; 19 ${$self->{syslogd}}->kill_syslogd('HUP'); 20 ${$self->{syslogd}}->loggrep("syslogd: restarted", 5) 21 or die ref($self), " no 'syslogd: restarted' in log"; 22 write_log($self); 23 }, 24 }, 25 syslogd => { 26 conf => "*.*\t\$objdir/file-noexist.log\n", 27 loggrep => { 28 qr{syslogd\[\d+\]: priv_open_log ".*/file-noexist.log": }. 29 qr{No such file or directory} => 2, 30 qr/syslogd: started/ => 1, 31 qr/syslogd: restarted/ => 1, 32 }, 33 noconsole => 1, # do not write /dev/console in config file 34 }, 35 console => { 36 loggrep => { 37 qr{".*/file-noexist.log": No such file or directory} => 2, 38 qr/syslogd\[\d+\]: start/ => 0, 39 qr/syslogd\[\d+\]: restart/ => 0, 40 get_testgrep() => 0, 41 }, 42 }, 43 file => { 44 loggrep => { 45 qr{".*/file-noexist.log": No such file or directory} => 0, 46 qr/syslogd\[\d+\]: start/ => 1, 47 qr/syslogd\[\d+\]: restart/ => 1, 48 get_testgrep() => 1, 49 }, 50 }, 51); 52 531; 54