args-server-tls-error.pl revision 1.1
1# The TLS server aborts the connection to syslogd.
2# The client writes a message to Sys::Syslog native method.
3# The syslogd writes it into a file and through a pipe.
4# The syslogd passes it via IPv4 TLS to an explicit loghost.
5# The server receives the message on its TLS socket.
6# Find the message in client, pipe, syslogd log.
7# Check that syslogd writes a log message about the server error.
8
9use strict;
10use warnings;
11use Socket;
12
13our %args = (
14    client => {
15	func => sub {
16	    my $self = shift;
17	    ${$self->{syslogd}}->loggrep("loghost .* connection error", 5)
18		or die "no connection error in syslogd.log";
19	    write_log($self, @_);
20	},
21    },
22    syslogd => {
23	loghost => '@tls://127.0.0.1:$connectport',
24	loggrep => {
25	    qr/Logging to FORWTLS \@tls:\/\/127.0.0.1:\d+/ => '>=4',
26	    get_testlog() => 1,
27	    qr/syslogd: loghost .* connection error/ => 2,
28	},
29    },
30    server => {
31	listen => { domain => AF_INET, proto => "tls", addr => "127.0.0.1" },
32	func => sub {
33	    my $self = shift;
34	    setsockopt(STDOUT, SOL_SOCKET, SO_LINGER, pack('ii', 1, 0))
35		or die "set socket linger failed: $!";
36	},
37	loggrep => {},
38    },
39    file => {
40	loggrep => {
41	    qr/syslogd: loghost .* connection error: read failed \(5\)/ => 1,
42	},
43    },
44);
45
461;
47