summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd/args-length-tcp.pl
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2015-02-02 17:40:25 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2015-02-02 17:40:25 +0000
commit4b8b16b4be4e66511b85e52727b15d272f0994cc (patch)
treec27cc85683ca20234793b270fdf88d033bfeade8 /regress/usr.sbin/syslogd/args-length-tcp.pl
parentd377a9827043b19c64298b0242402240a4456408 (diff)
Test that long syslog messages are truncated correctly.
Diffstat (limited to 'regress/usr.sbin/syslogd/args-length-tcp.pl')
-rw-r--r--regress/usr.sbin/syslogd/args-length-tcp.pl39
1 files changed, 39 insertions, 0 deletions
diff --git a/regress/usr.sbin/syslogd/args-length-tcp.pl b/regress/usr.sbin/syslogd/args-length-tcp.pl
new file mode 100644
index 00000000000..b935805678d
--- /dev/null
+++ b/regress/usr.sbin/syslogd/args-length-tcp.pl
@@ -0,0 +1,39 @@
+# The client writes long messages to UDP socket.
+# The syslogd writes it into a file and through a pipe.
+# The syslogd passes it via TCP to the loghost.
+# The server receives the message on its TCP socket.
+# Find the message in client, file, pipe, syslogd, server log.
+# Check that lines in server have 8192 bytes message length.
+
+use strict;
+use warnings;
+use Socket;
+
+my $msg = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+our %args = (
+ client => {
+ connect => { domain => AF_UNSPEC, addr => "localhost", port => 514 },
+ func => \&write_length,
+ lengths => [ 8190..8193,9000 ],
+ },
+ syslogd => {
+ loghost => '@tcp://localhost:$connectport',
+ options => ["-u"],
+ loggrep => {
+ $msg => 5,
+ }
+ },
+ server => {
+ listen => { domain => AF_UNSPEC, proto => "tcp", addr => "localhost" },
+ # >>> <13>Jan 31 00:10:11 0123456789ABC...567
+ loggrep => {
+ $msg => 5,
+ qr/^>>> .{19} .{8190}$/ => 1,
+ qr/^>>> .{19} .{8191}$/ => 1,
+ qr/^>>> .{19} .{8192}$/ => 3,
+ },
+ },
+);
+
+1;