1*64a7403cSbluhm# The client writes a messages to /dev/log and an alternative log socket. 2*64a7403cSbluhm# The syslogd listens on /var/run/log but not on /dev/log. 3*64a7403cSbluhm# The syslogd writes it into a file and through a pipe. 4*64a7403cSbluhm# The syslogd passes it via UDP to the loghost. 5*64a7403cSbluhm# The server receives the message on its UDP socket. 6*64a7403cSbluhm# Find the message in client, file, pipe, syslogd, server log. 7*64a7403cSbluhm# Check that only the meassge to the alternative log socket is logged. 8*64a7403cSbluhm 9*64a7403cSbluhmuse strict; 10*64a7403cSbluhmuse warnings; 11*64a7403cSbluhm 12*64a7403cSbluhmour %args = ( 13*64a7403cSbluhm client => { 14*64a7403cSbluhm func => sub { 15*64a7403cSbluhm my $self = shift; 16*64a7403cSbluhm eval { write_unix($self, "/dev/log") }; 17*64a7403cSbluhm $@ =~ m,connect to /dev/log unix socket failed, 18*64a7403cSbluhm or die ref($self), " connect to /dev/log succeeded"; 19*64a7403cSbluhm write_unix($self, "/var/run/log"); 20*64a7403cSbluhm ${$self->{syslogd}}->loggrep(get_testgrep(), 2) 21*64a7403cSbluhm or die ref($self), " syslogd did not receive message"; 22*64a7403cSbluhm write_shutdown($self); 23*64a7403cSbluhm }, 24*64a7403cSbluhm }, 25*64a7403cSbluhm syslogd => { 26*64a7403cSbluhm options => ["-p", "/var/run/log"], 27*64a7403cSbluhm }, 28*64a7403cSbluhm file => { 29*64a7403cSbluhm loggrep => { 30*64a7403cSbluhm "id /dev/log unix socket" => 0, 31*64a7403cSbluhm "id /var/run/log unix socket" => 1, 32*64a7403cSbluhm }, 33*64a7403cSbluhm }, 34*64a7403cSbluhm); 35*64a7403cSbluhm 36*64a7403cSbluhm1; 37