summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-11-07 10:15:08 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-11-07 10:15:08 +0000
commitf1b11c5f5bcae09db9fd657ec1500a4110241b2d (patch)
treef349e124b0c2837ec5eee1012727f256e80e6001 /regress
parent476ce25c1ebe7e350b4ef203fd426c5efb830fe3 (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.pl34
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;