summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2015-09-09 10:59:27 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2015-09-09 10:59:27 +0000
commit5d96edddcce5fe96a47d882c1fecbc05683baad9 (patch)
tree4247f84ab68b9a5cfcde266db097e144a1c1776a /regress/usr.sbin/syslogd
parent321205e8398c3126e0e15dc437c7dc24fa32d125 (diff)
Add args-bufsize-native.pl that checks wether libc syslog(3) can
handle 8192 bytes messages. Rename the sendsyslog(2) tests consistently.
Diffstat (limited to 'regress/usr.sbin/syslogd')
-rw-r--r--regress/usr.sbin/syslogd/args-bufsize-native.pl48
-rw-r--r--regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl (renamed from regress/usr.sbin/syslogd/args-sendsyslog-error.pl)0
-rw-r--r--regress/usr.sbin/syslogd/args-sendsyslog-native.pl (renamed from regress/usr.sbin/syslogd/args-sendsyslog.pl)0
3 files changed, 48 insertions, 0 deletions
diff --git a/regress/usr.sbin/syslogd/args-bufsize-native.pl b/regress/usr.sbin/syslogd/args-bufsize-native.pl
new file mode 100644
index 00000000000..666c6f8362d
--- /dev/null
+++ b/regress/usr.sbin/syslogd/args-bufsize-native.pl
@@ -0,0 +1,48 @@
+# The client writes a long message to Sys::Syslog native method.
+# 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, syslogd, server log.
+# Check that 8192 bytes messages can be processed.
+
+use strict;
+use warnings;
+use Socket;
+use Sys::Hostname;
+use constant MAXLINE => 8192;
+
+(my $host = hostname()) =~ s/\..*//;
+# file entry is without <70> but with space and hostname
+my $filelen = MAXLINE - 4 + 1 + length($host);
+
+our %args = (
+ client => {
+ logsock => { type => "native" },
+ func => sub {
+ my $self = shift;
+ write_chars($self, MAXLINE);
+ write_shutdown($self);
+ },
+ loggrep => { get_charlog() => 1 },
+ },
+ syslogd => {
+ loghost => '@tcp://localhost:$connectport',
+ loggrep => {
+ qr/[gs]etsockopt bufsize/ => 0,
+ get_charlog() => 1,
+ },
+ },
+ server => {
+ listen => { domain => AF_UNSPEC, proto => "tcp", addr => "localhost" },
+ # syslog over TCP appends a \n
+ loggrep => { qr/^>>> 8193 .{8192}\n/ => 1 },
+ },
+ pipe => {
+ nocheck => 1,
+ },
+ file => {
+ loggrep => { qr/^.{$filelen}\n/ => 1 },
+ },
+);
+
+1;
diff --git a/regress/usr.sbin/syslogd/args-sendsyslog-error.pl b/regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl
index 978b0147489..978b0147489 100644
--- a/regress/usr.sbin/syslogd/args-sendsyslog-error.pl
+++ b/regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl
diff --git a/regress/usr.sbin/syslogd/args-sendsyslog.pl b/regress/usr.sbin/syslogd/args-sendsyslog-native.pl
index 18f716301ee..18f716301ee 100644
--- a/regress/usr.sbin/syslogd/args-sendsyslog.pl
+++ b/regress/usr.sbin/syslogd/args-sendsyslog-native.pl