diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-09-04 15:57:14 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-09-04 15:57:14 +0000 |
commit | 4de2bb9a0551ef0503cd0472921e64f3a45abb95 (patch) | |
tree | 2b096d30d0c5eb2b04e7862a9b7dec3202fb5017 | |
parent | 4626e458534dec90f9d623a638b1c678eb886956 (diff) |
Check that messages from sendsyslog(2) or unix domain sockets contain
the short host name.
-rw-r--r-- | regress/usr.sbin/syslogd/args-client-native.pl | 23 | ||||
-rw-r--r-- | regress/usr.sbin/syslogd/args-client-unix.pl | 7 |
2 files changed, 28 insertions, 2 deletions
diff --git a/regress/usr.sbin/syslogd/args-client-native.pl b/regress/usr.sbin/syslogd/args-client-native.pl new file mode 100644 index 00000000000..62045adf3e9 --- /dev/null +++ b/regress/usr.sbin/syslogd/args-client-native.pl @@ -0,0 +1,23 @@ +# The client writes a message to Sys::Syslog native method. +# The syslogd writes it into a file and through a pipe. +# The syslogd passes it via UDP to the loghost. +# The server receives the message on its UDP socket. +# Find the message in client, file, pipe, syslogd, server log. +# Check that the file log contains the hostname and message. + +use strict; +use warnings; +use Sys::Hostname; + +(my $host = hostname()) =~ s/\..*//; # short name + +our %args = ( + client => { + logsock => { type => "native" }, + }, + file => { + loggrep => qr/ $host syslogd-regress\[\d+\]: /. get_log(), + }, +); + +1; diff --git a/regress/usr.sbin/syslogd/args-client-unix.pl b/regress/usr.sbin/syslogd/args-client-unix.pl index 6906ffc4619..c9fcec554ea 100644 --- a/regress/usr.sbin/syslogd/args-client-unix.pl +++ b/regress/usr.sbin/syslogd/args-client-unix.pl @@ -3,17 +3,20 @@ # The syslogd passes it via UDP to the loghost. # The server receives the message on its UDP socket. # Find the message in client, file, pipe, syslogd, server log. -# Check that the file log contains the message. +# Check that the file log contains the hostname and message. use strict; use warnings; +use Sys::Hostname; + +(my $host = hostname()) =~ s/\..*//; # short name our %args = ( client => { logsock => { type => "unix" }, }, file => { - loggrep => qr/ syslogd-regress\[\d+\]: /. get_log(), + loggrep => qr/ $host syslogd-regress\[\d+\]: /. get_log(), }, ); |