summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2015-09-09 10:59:26 +0000
committerbluhm <bluhm@openbsd.org>2015-09-09 10:59:26 +0000
commit067685f1ac0ffa9b29a3952ea639e7e55d326f51 (patch)
treee0e93e5f5ec7ef0127c94dfaf583defffed73b93
parentFix English in comment. OK dlg@ (diff)
downloadwireguard-openbsd-067685f1ac0ffa9b29a3952ea639e7e55d326f51.tar.xz
wireguard-openbsd-067685f1ac0ffa9b29a3952ea639e7e55d326f51.zip
Add args-bufsize-native.pl that checks wether libc syslog(3) can
handle 8192 bytes messages. Rename the sendsyslog(2) tests consistently.
-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