summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd/args-sendsyslog-console.pl
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-01-07 12:38:57 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-01-07 12:38:57 +0000
commit58d7aff838c31632534e99e95c1d6a8ee319c36a (patch)
treeeebe025bb561855964b98ebb74f480aa353718ff /regress/usr.sbin/syslogd/args-sendsyslog-console.pl
parent70e6ba105704866af96e13d201952b9d0a859e99 (diff)
When syslogd is not running, check that no syslog priority or dropped
message is logged to the console by the kernel.
Diffstat (limited to 'regress/usr.sbin/syslogd/args-sendsyslog-console.pl')
-rw-r--r--regress/usr.sbin/syslogd/args-sendsyslog-console.pl29
1 files changed, 26 insertions, 3 deletions
diff --git a/regress/usr.sbin/syslogd/args-sendsyslog-console.pl b/regress/usr.sbin/syslogd/args-sendsyslog-console.pl
index 4af091dbb41..a9421260ea4 100644
--- a/regress/usr.sbin/syslogd/args-sendsyslog-console.pl
+++ b/regress/usr.sbin/syslogd/args-sendsyslog-console.pl
@@ -2,6 +2,7 @@
# The client writes a message with sendsyslog2 LOG_CONS flag.
# Find the message in console log.
# Create a ktrace dump of the client and check for sendsyslog2.
+# Check that no syslog priority or dropped message is logged to console.
use strict;
use warnings;
@@ -16,20 +17,42 @@ our %args = (
my $self = shift;
${$self->{syslogd}}->kill_syslogd('TERM');
${$self->{syslogd}}->down();
+ sendsyslog2("<123>".get_testlog(), LOG_CONS)
+ and die ref($self), " sendsyslog2 succeeded";
sendsyslog2(get_testlog(), LOG_CONS)
and die ref($self), " sendsyslog2 succeeded";
+ foreach (qw(< <1 <12 <123 <1234)) {
+ sendsyslog2($_, LOG_CONS)
+ and die ref($self), " sendsyslog2 succeeded";
+ sendsyslog2("$_>", LOG_CONS)
+ and die ref($self), " sendsyslog2 succeeded";
+ sendsyslog2("$_>foo", LOG_CONS)
+ and die ref($self), " sendsyslog2 succeeded";
+ }
+ write_shutdown($self);
},
ktrace => {
- qr/CALL sendsyslog2\(/ => 1,
- qr/RET sendsyslog2 -1 errno $errno / => 1,
+ qr/CALL sendsyslog2\(/ => 18,
+ qr/GIO fd -1 wrote /.length(get_testlog()).qr/ bytes/ => 2,
+ qr/RET sendsyslog2 -1 errno $errno / => 18,
},
loggrep => {},
},
- syslogd => { loggrep => {} },
+ syslogd => {
+ conffile => "/dev/null",
+ loggrep => {},
+ },
server => { noserver => 1 },
file => { nocheck => 1 },
pipe => { nocheck => 1 },
user => { nocheck => 1 },
+ console => {
+ loggrep => {
+ get_testgrep() => 2,
+ qr/<\d+>/ => 0,
+ qr/dropped \d+ message/ => 0,
+ },
+ },
);
1;