diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-01-05 18:48:32 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-01-05 18:48:32 +0000 |
commit | 3f07b5eaf75fc89b36aa74704ade3dc06902f864 (patch) | |
tree | 5368cdb360df1c49f6e25854ef9d50db2bf48347 /regress | |
parent | f31294d497da53f8934355c6804ea87c2a8d1ddb (diff) |
Make syslogd TCP tests more reliable. Increase timeouts, shutdown
write to trigger connection close, allow errors EPIPE or ECONNRESET.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.sbin/syslogd/args-server-tcp-close.pl | 12 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-server-tcp-error.pl | 10 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-server-tcp-sendback.pl | 2 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-sigterm.pl | 4 |
4 files changed, 19 insertions, 9 deletions
diff --git a/regress/usr.sbin/syslogd/args-server-tcp-close.pl b/regress/usr.sbin/syslogd/args-server-tcp-close.pl index aba01c7db2d..55b9bd0274d 100644 --- a/regress/usr.sbin/syslogd/args-server-tcp-close.pl +++ b/regress/usr.sbin/syslogd/args-server-tcp-close.pl @@ -14,8 +14,8 @@ our %args = ( client => { func => sub { my $self = shift; - ${$self->{syslogd}}->loggrep("loghost .* connection close", 2) - or die "connection close in syslogd.log"; + ${$self->{syslogd}}->loggrep("loghost .* connection close", 5) + or die "no connection close in syslogd.log"; write_log($self, @_); }, }, @@ -29,7 +29,13 @@ our %args = ( }, server => { listen => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1" }, - func => sub {}, + func => sub { + my $self = shift; + shutdown(\*STDOUT, 1) + or die "shutdown write failed: $!"; + ${$self->{syslogd}}->loggrep("loghost .* connection close", 5) + or die "no connection close in syslogd.log"; + }, loggrep => {}, }, file => { diff --git a/regress/usr.sbin/syslogd/args-server-tcp-error.pl b/regress/usr.sbin/syslogd/args-server-tcp-error.pl index a9f3d845f1e..955684ab960 100644 --- a/regress/usr.sbin/syslogd/args-server-tcp-error.pl +++ b/regress/usr.sbin/syslogd/args-server-tcp-error.pl @@ -9,13 +9,17 @@ use strict; use warnings; use Socket; +use Errno ':POSIX'; + +my @errors = (EPIPE,ECONNRESET); +my $errors = "(". join("|", map { $! = $_ } @errors). ")"; our %args = ( client => { func => sub { my $self = shift; - ${$self->{syslogd}}->loggrep("loghost .* connection error", 2) - or die "connection error in syslogd.log"; + ${$self->{syslogd}}->loggrep("loghost .* connection error", 5) + or die "no connection error in syslogd.log"; write_log($self, @_); }, }, @@ -38,7 +42,7 @@ our %args = ( }, file => { loggrep => { - qr/syslogd: loghost .* connection error: Connection reset by peer/ + qr/syslogd: loghost .* connection error: $errors/ => 1, }, }, diff --git a/regress/usr.sbin/syslogd/args-server-tcp-sendback.pl b/regress/usr.sbin/syslogd/args-server-tcp-sendback.pl index 2677c055e33..d2637fe50fe 100644 --- a/regress/usr.sbin/syslogd/args-server-tcp-sendback.pl +++ b/regress/usr.sbin/syslogd/args-server-tcp-sendback.pl @@ -16,7 +16,7 @@ our %args = ( client => { func => sub { my $self = shift; - ${$self->{syslogd}}->loggrep("loghost .* did send .* back", 2) + ${$self->{syslogd}}->loggrep("loghost .* did send .* back", 5) or die "no send back in syslogd.log"; write_log($self, @_); }, diff --git a/regress/usr.sbin/syslogd/args-sigterm.pl b/regress/usr.sbin/syslogd/args-sigterm.pl index 180274da833..f060afc245c 100644 --- a/regress/usr.sbin/syslogd/args-sigterm.pl +++ b/regress/usr.sbin/syslogd/args-sigterm.pl @@ -33,8 +33,8 @@ our %args = ( read_between2logs($self, sub { ${$self->{syslogd}}->kill_syslogd('TERM'); my $pattern = "syslogd: exiting on signal 15"; - ${$self->{syslogd}}->loggrep("syslogd: exiting on signal 15", - 5) or die ref($self), + ${$self->{syslogd}}->loggrep("syslogd: exiting on signal 15", 5) + or die ref($self), " no 'syslogd: exiting on signal 15' between logs"; print STDERR "Signal\n"; }); |