diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-11-07 10:15:08 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-11-07 10:15:08 +0000 |
commit | f1b11c5f5bcae09db9fd657ec1500a4110241b2d (patch) | |
tree | f349e124b0c2837ec5eee1012727f256e80e6001 /regress | |
parent | 476ce25c1ebe7e350b4ef203fd426c5efb830fe3 (diff) |
Test callback is called immediately after TLS handshake completion.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.sbin/syslogd/args-client-tls-handshake.pl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/regress/usr.sbin/syslogd/args-client-tls-handshake.pl b/regress/usr.sbin/syslogd/args-client-tls-handshake.pl new file mode 100644 index 00000000000..c1419396b60 --- /dev/null +++ b/regress/usr.sbin/syslogd/args-client-tls-handshake.pl @@ -0,0 +1,34 @@ +# The syslogd listens on localhost TLS socket. +# The client checks that syslogd logs complete handshake. +# The client writes a message into a localhost TLS socket. +# The syslogd writes it into a file and through a pipe. +# The syslogd passes it via UDP to the loghost. +# The server receives the message on its UDP socket. +# Find the message in client, file, pipe, syslogd, server log. +# Check completed tls handshake log before writing any log message. + +use strict; +use warnings; +use Socket; + +our %args = ( + client => { + connect => { domain => AF_UNSPEC, proto => "tls", addr => "localhost", + port => 6514 }, + func => sub { + my $self = shift; + ${$self->{syslogd}}->loggrep("Completed tls handshake", 5) + or die ref($self), " no completed tls handshake syslogd.log"; + write_log($self); + }, + }, + syslogd => { + options => ["-S", "localhost"], + loggrep => { + qr/Accepting tcp connection/ => 1, + qr/Completed tls handshake/ => 1, + }, + }, +); + +1; |