diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-03-09 15:16:29 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-03-09 15:16:29 +0000 |
commit | b1cb46127e786555930aff2223a523922e23acbf (patch) | |
tree | 9585d407af8c31fd75aba381639e0fe0a7c3cbe1 /regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl | |
parent | 459d4e795faae9e9a5825a299f7e5063446853a0 (diff) |
Kernel drops fewer messages in sendsyslog(2), adapt syslogd(8)
tests. Kernel stashes logs temporarily, test it. Fix some races
in existing tests.
Diffstat (limited to 'regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl')
-rw-r--r-- | regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl b/regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl index 40291e2ac9a..80af471a009 100644 --- a/regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl +++ b/regress/usr.sbin/syslogd/args-sendsyslog-dropped.pl @@ -10,20 +10,25 @@ use strict; use warnings; use Errno ':POSIX'; +use constant LOGSTASH_SIZE => 100; + my $errno = ENOTCONN; my $kerngrep = qr/sendsyslog: dropped \d+ messages?, error $errno, pid \d+$/; our %args = ( client => { early => 1, - func => sub { write_between2logs(shift, sub { + func => sub { my $self = shift; - ${$self->{syslogd}}->loggrep(qr/syslogd: started/, 5) - or die ref($self), " syslogd started not in syslogd.log"; + write_message($self, "stash $_") foreach (1..LOGSTASH_SIZE); + write_between2logs($self, sub { + my $self = shift; + ${$self->{syslogd}}->loggrep(qr/syslogd: started/, 5) + or die ref($self), " syslogd started not in syslogd.log"; })}, ktrace => { - qr/CALL sendsyslog\(/ => '>=2', - qr/RET sendsyslog -1 errno $errno / => '>=1', + qr/CALL sendsyslog\(/ => '>=103', + qr/RET sendsyslog -1 errno $errno / => 101, }, }, syslogd => { @@ -35,15 +40,19 @@ our %args = ( }, server => { loggrep => { + qr/syslogd\[\d+\]: start/ => 1, get_firstlog() => 0, $kerngrep => 1, + qr/syslogd\[\d+\]: running/ => 1, get_testgrep() => 1, }, }, file => { loggrep => { + qr/syslogd\[\d+\]: start/ => 1, get_firstlog() => 0, $kerngrep => 1, + qr/syslogd\[\d+\]: running/ => 1, get_testgrep() => 1, }, }, |