1# The client writes 400 messages to Sys::Syslog native method. 2# The syslogd writes it into a file and through a pipe. 3# The syslogd passes it via TLS to the loghost. 4# The server blocks the message on its TLS socket. 5# The server waits until the client has written all messages. 6# The server receives the message on its TLS socket. 7# The client waits until the server as read the first message. 8# Find the message in client, file, pipe, syslogd, server log. 9# Check that the 400 messages are in syslogd and file log. 10# Check that the dropped message is in server and file log. 11 12use strict; 13use warnings; 14use Socket; 15 16our %args = ( 17 client => { 18 func => sub { write_between2logs(shift, sub { 19 my $self = shift; 20 write_message($self, get_secondlog()); 21 write_lines($self, 400, 1024); 22 write_message($self, get_thirdlog()); 23 ${$self->{server}}->loggrep(get_secondlog(), 5) 24 or die ref($self), " server did not receive second log"; 25 ${$self->{syslogd}}->loggrep(qr/: dropped \d+ messages? to/, 5) 26 or die ref($self), " syslogd did not write dropped message"; 27 })}, 28 }, 29 syslogd => { 30 loghost => '@tls://localhost:$connectport', 31 loggrep => { 32 get_between2loggrep(), 33 get_charlog() => 400, 34 qr/ \(dropped tcpbuf full\)/ => '~65', 35 qr/SSL3_WRITE_PENDING/ => 0, 36 }, 37 }, 38 server => { 39 listen => { domain => AF_UNSPEC, proto => "tls", addr => "localhost" }, 40 rcvbuf => 2**12, 41 func => sub { 42 my $self = shift; 43 ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) 44 or die ref($self), " syslogd did not receive third log"; 45 read_log($self); 46 }, 47 loggrep => { 48 get_between2loggrep(), 49 get_secondlog() => 1, 50 get_thirdlog() => 0, 51 get_charlog() => '~336', 52 qr/syslogd\[\d+\]: dropped [67][0-9] messages to loghost/ => 1, 53 }, 54 }, 55 file => { 56 loggrep => { 57 get_between2loggrep(), 58 get_secondlog() => 1, 59 get_thirdlog() => 1, 60 get_charlog() => 400, 61 qr/syslogd\[\d+\]: dropped [67][0-9] messages to loghost/ => 1, 62 }, 63 }, 64); 65 661; 67