summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd/args-socket.pl
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-08-20 20:52:15 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-08-20 20:52:15 +0000
commit1b4a57a4896c5679fa685859e91023ac9ae211cb (patch)
treec4b76deb6ea58cebb3a2e2c0a5cf6bfa8a212e14 /regress/usr.sbin/syslogd/args-socket.pl
parentcccbc9159117fab4fadcfa53efe484ef47e4623f (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-socket.pl')
-rw-r--r--regress/usr.sbin/syslogd/args-socket.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/regress/usr.sbin/syslogd/args-socket.pl b/regress/usr.sbin/syslogd/args-socket.pl
new file mode 100644
index 00000000000..9173a42069e
--- /dev/null
+++ b/regress/usr.sbin/syslogd/args-socket.pl
@@ -0,0 +1,27 @@
+# Test with default values, that is:
+# The client writes a message to a localhost IPv4 UDP socket.
+# 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 syslogd has one IPv4 socket in fstat output.
+
+use strict;
+use warnings;
+
+our %args = (
+ client => {
+ connect => { domain => AF_INET, addr => "127.0.0.1", port => 514 },
+ },
+ syslogd => {
+ fstat => 1,
+ options => ["-nu"],
+ },
+ fstat => {
+ loggrep => {
+ qr/ internet dgram udp \*:514$/ => 1,
+ },
+ },
+);
+
+1;