summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-08-29 21:55:56 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-08-29 21:55:56 +0000
commit74d09608521a86cbc9e0687f061eb5fcdf02fe50 (patch)
tree2c739521d3d5814339acb12f696eccd1a2f2c685
parentcf6e48c4bb6bbfcdbf8906a0127b0ce48b22d2b7 (diff)
Prepare for testing libevent in syslogd. Pass the EVENT_NO...
environment variables over sudo into syslogd. Run the tests with the select(2) and poll(2) and kqueue(2) backend. Call "make libevent" for these tests.
-rw-r--r--regress/usr.sbin/syslogd/Makefile10
-rw-r--r--regress/usr.sbin/syslogd/README4
-rw-r--r--regress/usr.sbin/syslogd/Syslogd.pm10
3 files changed, 20 insertions, 4 deletions
diff --git a/regress/usr.sbin/syslogd/Makefile b/regress/usr.sbin/syslogd/Makefile
index 11ea2154a88..e6321443204 100644
--- a/regress/usr.sbin/syslogd/Makefile
+++ b/regress/usr.sbin/syslogd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2014/08/20 20:52:14 bluhm Exp $
+# $OpenBSD: Makefile,v 1.2 2014/08/29 21:55:55 bluhm Exp $
# The following ports must be installed for the regression tests:
# p5-IO-Socket-INET6 object interface for AF_INET and AF_INET6 domain sockets
@@ -73,7 +73,7 @@ ${REGRESS_TARGETS:M*ssl*} ${REGRESS_TARGETS:M*https*}: 127.0.0.1.crt
# make perl syntax check for all args files
-.PHONY: syntax
+.PHONY: syntax libevent
syntax: stamp-syntax
@@ -83,4 +83,10 @@ stamp-syntax: ${ARGS}
.endfor
@date >$@
+# run the tests with all variants of libevent backend
+libevent:
+ cd ${.CURDIR} && EVENT_NOKQUEUE=1 EVENT_NOPOLL=1 ${MAKE} regress
+ cd ${.CURDIR} && EVENT_NOKQUEUE=1 EVENT_NOSELECT=1 ${MAKE} regress
+ cd ${.CURDIR} && EVENT_NOPOLL=1 EVENT_NOSELECT=1 ${MAKE} regress
+
.include <bsd.regress.mk>
diff --git a/regress/usr.sbin/syslogd/README b/regress/usr.sbin/syslogd/README
index 4d8234855a5..61092a27432 100644
--- a/regress/usr.sbin/syslogd/README
+++ b/regress/usr.sbin/syslogd/README
@@ -10,6 +10,10 @@ 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.
+When invoked with "make libevent", all tests are executed three
+times. They pass the EVENT_NO... environment variables over sudo
+into syslogd. This way the select(2) and poll(2) and kqueue(2)
+backend is tested.
SUDO=sudo
As syslogd needs root privileges either run the tests as root or
diff --git a/regress/usr.sbin/syslogd/Syslogd.pm b/regress/usr.sbin/syslogd/Syslogd.pm
index e528074f5f9..0ab7f2a4ea5 100644
--- a/regress/usr.sbin/syslogd/Syslogd.pm
+++ b/regress/usr.sbin/syslogd/Syslogd.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Syslogd.pm,v 1.1 2014/08/20 20:52:14 bluhm Exp $
+# $OpenBSD: Syslogd.pm,v 1.2 2014/08/29 21:55:55 bluhm Exp $
# Copyright (c) 2010-2014 Alexander Bluhm <bluhm@openbsd.org>
# Copyright (c) 2014 Florian Riehm <mail@friehm.de>
@@ -89,9 +89,15 @@ sub child {
}
print STDERR "syslogd not running\n";
+ my @libevent;
+ foreach (qw(EVENT_NOKQUEUE EVENT_NOPOLL EVENT_NOSELECT)) {
+ push @libevent, "$_=$ENV{$_}" if $ENV{$_};
+ }
+ push @libevent, "EVENT_SHOW_METHOD=1" if @libevent;
my @ktrace = $ENV{KTRACE} ? ($ENV{KTRACE}, "-i") : ();
my $syslogd = $ENV{SYSLOGD} ? $ENV{SYSLOGD} : "syslogd";
- my @cmd = (@sudo, @ktrace, $syslogd, "-d", "-f", $self->{conffile});
+ my @cmd = (@sudo, @libevent, @ktrace, $syslogd, "-d",
+ "-f", $self->{conffile});
push @cmd, @{$self->{options}} if $self->{options};
print STDERR "execute: @cmd\n";
exec @cmd;