diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-08-20 20:52:15 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-08-20 20:52:15 +0000 |
commit | 1b4a57a4896c5679fa685859e91023ac9ae211cb (patch) | |
tree | c4b76deb6ea58cebb3a2e2c0a5cf6bfa8a212e14 /regress/usr.sbin/syslogd/args-sendsyslog.pl | |
parent | cccbc9159117fab4fadcfa53efe484ef47e4623f (diff) |
Run syslogd regressions tests. As only one syslogd can run per
machine, each test kills any syslogd first. At the end the system's
syslogd gets restarted.
The test framework runs a client, and a server, and a syslogd. The
messages are passed via the log socket or via UDP from the client
to syslogd. From there UDP transport is used to reach the server.
All processes write log files where the message has to show up.
The test arguments are kept in the args-*.pl files.
The content of a log file, the data sent to a pipe process and what
the server received are checked. The invocation of the sendsyslog(2)
syscall is checked with ktrace, the open file descriptors of syslogd
are checked with fstat.
Diffstat (limited to 'regress/usr.sbin/syslogd/args-sendsyslog.pl')
-rw-r--r-- | regress/usr.sbin/syslogd/args-sendsyslog.pl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/regress/usr.sbin/syslogd/args-sendsyslog.pl b/regress/usr.sbin/syslogd/args-sendsyslog.pl new file mode 100644 index 00000000000..b29b25ac91f --- /dev/null +++ b/regress/usr.sbin/syslogd/args-sendsyslog.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. +# Create a ktrace dump of the client and check that sendsyslog(2) +# has been used. + +use strict; +use warnings; + +our %args = ( + client => { + ktrace => 1, + kdump => { + qr/CALL sendsyslog/ => 2, + qr/GIO fd -1 wrote \d+ bytes/ => 2, + qr/RET sendsyslog 0/ => 2, + }, + }, +); + +1; |