diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-02-12 23:16:03 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2015-02-12 23:16:03 +0000 |
commit | 4e53b6db78449cfa95862d3293d8c2d733a52cb8 (patch) | |
tree | e435a521b96f537df13bc62cf33b036514f58fba /regress/usr.sbin/syslogd | |
parent | 74f1abc60252004975fc7ed4a64077ab35f64f3b (diff) |
Make syslogd tests more reliable. Increase the allowed range of
lost log messages. Improve the synchronisation of client and server.
Diffstat (limited to 'regress/usr.sbin/syslogd')
-rw-r--r-- | regress/usr.sbin/syslogd/args-dropped-sighup-tcp.pl | 6 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-dropped-sighup-tls.pl | 5 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-dropped-sigterm-tcp.pl | 6 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-dropped-sigterm-tls.pl | 5 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-dropped-tcp.pl | 14 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-dropped-tls.pl | 15 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-sync-tcp.pl | 4 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-sync-tls.pl | 4 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/funcs.pl | 4 |
9 files changed, 35 insertions, 28 deletions
diff --git a/regress/usr.sbin/syslogd/args-dropped-sighup-tcp.pl b/regress/usr.sbin/syslogd/args-dropped-sighup-tcp.pl index 16a7ad30888..072201325f4 100644 --- a/regress/usr.sbin/syslogd/args-dropped-sighup-tcp.pl +++ b/regress/usr.sbin/syslogd/args-dropped-sighup-tcp.pl @@ -41,8 +41,8 @@ our %args = ( $self->{redo}--; return; } - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; ${$self->{syslogd}}->kill_syslogd('HUP'); ${$self->{syslogd}}->loggrep("syslogd: restarted", 5) or die ref($self), " no 'syslogd: restarted' between logs"; @@ -56,7 +56,7 @@ our %args = ( get_thirdlog() => 0, qr/syslogd: start/ => 1, qr/syslogd: restart/ => 1, - get_charlog() => 43, + get_charlog() => '~43', qr/syslogd: dropped 2[56][0-9] messages to remote loghost/ => 1, }, }, diff --git a/regress/usr.sbin/syslogd/args-dropped-sighup-tls.pl b/regress/usr.sbin/syslogd/args-dropped-sighup-tls.pl index 08e6e50998e..cbcd8c12a60 100644 --- a/regress/usr.sbin/syslogd/args-dropped-sighup-tls.pl +++ b/regress/usr.sbin/syslogd/args-dropped-sighup-tls.pl @@ -30,6 +30,7 @@ our %args = ( get_between2loggrep(), get_charlog() => 300, qr/ \(dropped\)/ => '~16', + qr/SSL3_WRITE_PENDING/ => 0, }, }, server => { @@ -41,8 +42,8 @@ our %args = ( $self->{redo}--; return; } - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; ${$self->{syslogd}}->kill_syslogd('HUP'); ${$self->{syslogd}}->loggrep("syslogd: restarted", 5) or die ref($self), " no 'syslogd: restarted' between logs"; diff --git a/regress/usr.sbin/syslogd/args-dropped-sigterm-tcp.pl b/regress/usr.sbin/syslogd/args-dropped-sigterm-tcp.pl index 3bd107874cb..2ae915c5045 100644 --- a/regress/usr.sbin/syslogd/args-dropped-sigterm-tcp.pl +++ b/regress/usr.sbin/syslogd/args-dropped-sigterm-tcp.pl @@ -36,8 +36,8 @@ our %args = ( redo => 0, func => sub { my $self = shift; - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; ${$self->{syslogd}}->kill_syslogd('TERM'); ${$self->{syslogd}}->loggrep("syslogd: exiting", 5) or die ref($self), " no 'syslogd: exiting' between logs"; @@ -50,7 +50,7 @@ our %args = ( get_thirdlog() => 0, get_testlog() => 0, qr/syslogd: start/ => 1, - get_charlog() => 42, + get_charlog() => '~42', }, }, pipe => { diff --git a/regress/usr.sbin/syslogd/args-dropped-sigterm-tls.pl b/regress/usr.sbin/syslogd/args-dropped-sigterm-tls.pl index 190cd7efb12..52486f2c9ee 100644 --- a/regress/usr.sbin/syslogd/args-dropped-sigterm-tls.pl +++ b/regress/usr.sbin/syslogd/args-dropped-sigterm-tls.pl @@ -29,6 +29,7 @@ our %args = ( loggrep => { get_charlog() => 300, qr/ \(dropped\)/ => '~19', + qr/SSL3_WRITE_PENDING/ => 0, }, }, server => { @@ -36,8 +37,8 @@ our %args = ( redo => 0, func => sub { my $self = shift; - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; ${$self->{syslogd}}->kill_syslogd('TERM'); ${$self->{syslogd}}->loggrep("syslogd: exiting", 5) or die ref($self), " no 'syslogd: exiting' between logs"; diff --git a/regress/usr.sbin/syslogd/args-dropped-tcp.pl b/regress/usr.sbin/syslogd/args-dropped-tcp.pl index 89998236b41..c392611ce63 100644 --- a/regress/usr.sbin/syslogd/args-dropped-tcp.pl +++ b/regress/usr.sbin/syslogd/args-dropped-tcp.pl @@ -22,6 +22,8 @@ our %args = ( write_message($self, get_thirdlog()); ${$self->{server}}->loggrep(get_secondlog(), 5) or die ref($self), " server did not receive second log"; + ${$self->{syslogd}}->loggrep(qr/dropped \d+ messages/, 5) + or die ref($self), " syslogd did not write dropped message"; })}, }, syslogd => { @@ -29,23 +31,23 @@ our %args = ( loggrep => { get_between2loggrep(), get_charlog() => 300, - qr/ \(dropped\)/ => 14, + qr/ \(dropped\)/ => '~14', }, }, server => { listen => { domain => AF_UNSPEC, proto => "tcp", addr => "localhost" }, func => sub { my $self = shift; - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; read_log($self); }, loggrep => { get_between2loggrep(), get_secondlog() => 1, get_thirdlog() => 0, - get_charlog() => 287, - qr/syslogd: dropped 14 messages to loghost "\@tcp:.*"/ => 1, + get_charlog() => '~287', + qr/syslogd: dropped 1[0-9] messages to loghost "\@tcp:.*"/ => 1, }, }, file => { @@ -54,7 +56,7 @@ our %args = ( get_secondlog() => 1, get_thirdlog() => 1, get_charlog() => 300, - qr/syslogd: dropped 14 messages to loghost "\@tcp:.*"/ => 1, + qr/syslogd: dropped 1[0-9] messages to loghost "\@tcp:.*"/ => 1, }, }, ); diff --git a/regress/usr.sbin/syslogd/args-dropped-tls.pl b/regress/usr.sbin/syslogd/args-dropped-tls.pl index ffe36b7d709..3400ff8df07 100644 --- a/regress/usr.sbin/syslogd/args-dropped-tls.pl +++ b/regress/usr.sbin/syslogd/args-dropped-tls.pl @@ -22,6 +22,8 @@ our %args = ( write_message($self, get_thirdlog()); ${$self->{server}}->loggrep(get_secondlog(), 5) or die ref($self), " server did not receive second log"; + ${$self->{syslogd}}->loggrep(qr/dropped \d+ messages/, 5) + or die ref($self), " syslogd did not write dropped message"; })}, }, syslogd => { @@ -29,23 +31,24 @@ our %args = ( loggrep => { get_between2loggrep(), get_charlog() => 300, - qr/ \(dropped\)/ => 16, + qr/ \(dropped\)/ => '~16', + qr/SSL3_WRITE_PENDING/ => 0, }, }, server => { listen => { domain => AF_UNSPEC, proto => "tls", addr => "localhost" }, func => sub { my $self = shift; - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; read_log($self); }, loggrep => { get_between2loggrep(), get_secondlog() => 1, get_thirdlog() => 0, - get_charlog() => 285, - qr/syslogd: dropped 16 messages to loghost "\@tls:.*"/ => 1, + get_charlog() => '~285', + qr/syslogd: dropped 1[0-9] messages to loghost "\@tls:.*"/ => 1, }, }, file => { @@ -54,7 +57,7 @@ our %args = ( get_secondlog() => 1, get_thirdlog() => 1, get_charlog() => 300, - qr/syslogd: dropped 16 messages to loghost "\@tls:.*"/ => 1, + qr/syslogd: dropped 1[0-9] messages to loghost "\@tls:.*"/ => 1, }, }, ); diff --git a/regress/usr.sbin/syslogd/args-sync-tcp.pl b/regress/usr.sbin/syslogd/args-sync-tcp.pl index 3194ca64ce8..0908c844d10 100644 --- a/regress/usr.sbin/syslogd/args-sync-tcp.pl +++ b/regress/usr.sbin/syslogd/args-sync-tcp.pl @@ -44,8 +44,8 @@ our %args = ( $self->{redo}--; return; } - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; shutdown(\*STDOUT, 1) or die "shutdown write failed: $!"; $self->{redo}++; diff --git a/regress/usr.sbin/syslogd/args-sync-tls.pl b/regress/usr.sbin/syslogd/args-sync-tls.pl index 91fd387e9ce..e88b3e09126 100644 --- a/regress/usr.sbin/syslogd/args-sync-tls.pl +++ b/regress/usr.sbin/syslogd/args-sync-tls.pl @@ -44,8 +44,8 @@ our %args = ( $self->{redo}--; return; } - ${$self->{client}}->loggrep(get_thirdlog(), 20) - or die ref($self), " client did not send third log"; + ${$self->{syslogd}}->loggrep(get_thirdlog(), 20) + or die ref($self), " syslogd did not receive third log"; shutdown(\*STDOUT, 1) or die "shutdown write failed: $!"; $self->{redo}++; diff --git a/regress/usr.sbin/syslogd/funcs.pl b/regress/usr.sbin/syslogd/funcs.pl index c71abfe33fa..4f71b5277d8 100644 --- a/regress/usr.sbin/syslogd/funcs.pl +++ b/regress/usr.sbin/syslogd/funcs.pl @@ -1,4 +1,4 @@ -# $OpenBSD: funcs.pl,v 1.17 2015/02/11 21:51:13 bluhm Exp $ +# $OpenBSD: funcs.pl,v 1.18 2015/02/12 23:16:02 bluhm Exp $ # Copyright (c) 2010-2015 Alexander Bluhm <bluhm@openbsd.org> # @@ -269,7 +269,7 @@ sub compare($$) { } elsif (/^<=(\d+)/) { return $_[0] <= $1; } elsif (/^~(\d+)/) { - return $1 * 0.9 <= $_[0] && $_[0] <= $1 * 1.1; + return $1 * 0.8 <= $_[0] && $_[0] <= $1 * 1.2; } die "bad compare operator: $_"; } |