summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd/args-client-tcp-octet-badframe.pl
diff options
context:
space:
mode:
Diffstat (limited to 'regress/usr.sbin/syslogd/args-client-tcp-octet-badframe.pl')
-rw-r--r--regress/usr.sbin/syslogd/args-client-tcp-octet-badframe.pl42
1 files changed, 42 insertions, 0 deletions
diff --git a/regress/usr.sbin/syslogd/args-client-tcp-octet-badframe.pl b/regress/usr.sbin/syslogd/args-client-tcp-octet-badframe.pl
new file mode 100644
index 00000000000..313dcf3c75c
--- /dev/null
+++ b/regress/usr.sbin/syslogd/args-client-tcp-octet-badframe.pl
@@ -0,0 +1,42 @@
+# The syslogd listens on 127.0.0.1 TCP socket.
+# The client writes octet counting messages with invalid framing.
+# 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 file, syslogd, server log.
+# Check that an invalid octet counting is handled as non transparent framing.
+
+use strict;
+use warnings;
+
+our %args = (
+ client => {
+ connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
+ port => 514 },
+ func => sub {
+ my $self = shift;
+ local $| = 1;
+ print "000002 ab\n";
+ print STDERR "<<< 000002 ab\n";
+ print "2bc\n";
+ print STDERR "<<< 00002bc\n";
+ write_log($self);
+ },
+ },
+ syslogd => {
+ options => ["-T", "127.0.0.1:514"],
+ loggrep => {
+ qr/non transparent framing/ => 3,
+ qr/octet counting/ => 0,
+ },
+ },
+ file => {
+ loggrep => {
+ qr/localhost 000002 ab$/ => 1,
+ qr/localhost 2bc$/ => 1,
+ get_testgrep() => 1,
+ },
+ },
+);
+
+1;