args-client-tls-close.pl revision 1.3
1# The syslogd listens on 127.0.0.1 TLS socket. 2# The client connects and closes the connection to syslogd. 3# The syslogd writes the error into a file and through a pipe. 4# Find the error message in file, syslogd log. 5# Check that syslogd writes a log message about the client close. 6 7use strict; 8use warnings; 9use Socket; 10 11our %args = ( 12 client => { 13 connect => { domain => AF_INET, proto => "tls", addr => "127.0.0.1", 14 port => 6514 }, 15 func => sub { 16 my $self = shift; 17 shutdown(\*STDOUT, 1) 18 or die "shutdown write failed: $!"; 19 ${$self->{syslogd}}->loggrep("tls logger .* connection close", 5) 20 or die "no connection close in syslogd.log"; 21 }, 22 loggrep => { 23 qr/connect sock: 127.0.0.1 \d+/ => 1, 24 }, 25 }, 26 syslogd => { 27 options => ["-S", "127.0.0.1:6514"], 28 loggrep => { 29 qr/syslogd\[\d+\]: tls logger .* accepted/ => 1, 30 qr/syslogd\[\d+\]: tls logger .* connection close/ => 1, 31 }, 32 }, 33 server => { 34 func => sub { 35 my $self = shift; 36 ${$self->{syslogd}}->loggrep("tls logger .* connection close", 5) 37 or die "no connection close in syslogd.log"; 38 }, 39 loggrep => {}, 40 }, 41 file => { 42 loggrep => { 43 qr/syslogd\[\d+\]: tls logger .* connection close/ => 1, 44 }, 45 }, 46 pipe => { nocheck => 1 }, 47 tty => { nocheck => 1 }, 48); 49 501; 51