args-bufsize-udp.pl revision 1.2
1# Stop syslogd. 2# The client writes 8 message with 8192 to a localhost IPv6 UDP socket. 3# Continue syslogd. 4# The syslogd writes it into a file and through a pipe. 5# The syslogd passes it via TCP to the loghost. 6# The server receives the message on its TCP socket. 7# Find the message in client, file, syslogd, server log. 8# Check that 8 long UDP messages can be processed at once. 9 10use strict; 11use warnings; 12use Socket; 13use constant MAXLINE => 8192; 14 15our %args = ( 16 client => { 17 connect => { domain => AF_INET6, addr => "::1", port => 514 }, 18 func => sub { 19 my $self = shift; 20 ${$self->{syslogd}}->kill_syslogd('STOP'); 21 write_lines($self, 8, MAXLINE); 22 IO::Handle::flush(\*STDOUT); 23 ${$self->{syslogd}}->kill_syslogd('CONT'); 24 ${$self->{server}}->loggrep(get_charlog(), 8) 25 or die ref($self), " server did not receive all messages"; 26 write_shutdown($self); 27 }, 28 loggrep => { get_charlog() => 8 }, 29 }, 30 syslogd => { 31 options => ["-un"], 32 loghost => '@tcp://localhost:$connectport', 33 loggrep => { 34 qr/[gs]etsockopt bufsize/ => 0, 35 get_charlog() => 8, 36 }, 37 }, 38 server => { 39 listen => { domain => AF_UNSPEC, proto => "tcp", addr => "localhost" }, 40 loggrep => { get_charlog() => 8 }, 41 }, 42 pipe => { 43 nocheck => 1, 44 }, 45 file => { 46 loggrep => { get_charlog() => 8 }, 47 }, 48); 49 501; 51