summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2019-09-10 22:35:08 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2019-09-10 22:35:08 +0000
commitd2363b9f3a5b62d5f3a1413e5438a0693b0d73ec (patch)
treeac4641f837501c2162163c38d6789e1e607c7b2f /regress
parent162583f35a8d97c489204ae3c156d36723739551 (diff)
If rsyslogd is not installed, explicitly skip these syslogd
compatibility tests. Fix some races and increase the timeout for rsyslog tests.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.sbin/syslogd/Makefile12
-rw-r--r--regress/usr.sbin/syslogd/RSyslogd.pm14
-rw-r--r--regress/usr.sbin/syslogd/funcs.pl6
3 files changed, 21 insertions, 11 deletions
diff --git a/regress/usr.sbin/syslogd/Makefile b/regress/usr.sbin/syslogd/Makefile
index 75732799d54..9d3d7f4827a 100644
--- a/regress/usr.sbin/syslogd/Makefile
+++ b/regress/usr.sbin/syslogd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.26 2019/07/12 19:31:29 bluhm Exp $
+# $OpenBSD: Makefile,v 1.27 2019/09/10 22:35:07 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
@@ -31,14 +31,12 @@ PROGS = ttylog
PERLS = Client.pm Proc.pm RSyslogd.pm Server.pm \
Syslogc.pm Syslogd.pm funcs.pl syslogd.pl
ARGS != cd ${.CURDIR} && ls args-*.pl
-.if exists (/usr/local/sbin/rsyslogd)
-TARGETS ?= ${ARGS}
-.else
-TARGETS ?= ${ARGS:Nargs-rsyslog*}
+REGRESS_TARGETS = ${ARGS:S/^/run-/}
+.if ! exists(/usr/local/sbin/rsyslogd)
+SKIP_REGRESS_TARGETS = ${REGRESS_TARGETS:Mrun-args-rsyslog*}
.endif
-REGRESS_TARGETS = ${TARGETS:S/^/run-/}
LDFLAGS += -lutil
-CLEANFILES += *.log *.log.? *.conf ktrace.out stamp-*
+CLEANFILES += *.log *.log.? *.conf ktrace.out stamp-* *.pid
CLEANFILES += *.out *.sock *.ktrace *.fstat ttylog *.ph */*.ph
CLEANFILES += *.pem *.req *.key *.crt *.srl empty toobig diskimage
diff --git a/regress/usr.sbin/syslogd/RSyslogd.pm b/regress/usr.sbin/syslogd/RSyslogd.pm
index c2407c7fd2d..0e870f27f39 100644
--- a/regress/usr.sbin/syslogd/RSyslogd.pm
+++ b/regress/usr.sbin/syslogd/RSyslogd.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: RSyslogd.pm,v 1.6 2018/10/06 11:56:26 bluhm Exp $
+# $OpenBSD: RSyslogd.pm,v 1.7 2019/09/10 22:35:07 bluhm Exp $
# Copyright (c) 2010-2014 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -115,6 +115,18 @@ sub new {
sub child {
my $self = shift;
+ my @sudo = $ENV{SUDO} ? $ENV{SUDO} : "env";
+
+ my @pkill = (@sudo, "pkill", "-KILL", "-x", "rsyslogd");
+ my @pgrep = ("pgrep", "-x", "rsyslogd");
+ system(@pkill) && $? != 256
+ and die ref($self), " system '@pkill' failed: $?";
+ while ($? == 0) {
+ print STDERR "rsyslogd still running\n";
+ system(@pgrep) && $? != 256
+ and die ref($self), " system '@pgrep' failed: $?";
+ }
+ print STDERR "rsyslogd not running\n";
my @cmd = ("rsyslogd", "-dn", "-f", $self->{conffile},
"-i", $self->{pidfile});
diff --git a/regress/usr.sbin/syslogd/funcs.pl b/regress/usr.sbin/syslogd/funcs.pl
index 26a1dba3f87..ac517e585f3 100644
--- a/regress/usr.sbin/syslogd/funcs.pl
+++ b/regress/usr.sbin/syslogd/funcs.pl
@@ -1,4 +1,4 @@
-# $OpenBSD: funcs.pl,v 1.35 2018/05/22 15:01:16 bluhm Exp $
+# $OpenBSD: funcs.pl,v 1.36 2019/09/10 22:35:07 bluhm Exp $
# Copyright (c) 2010-2015 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -64,7 +64,7 @@ sub write_log {
write_message($self, $testlog);
IO::Handle::flush(\*STDOUT);
- ${$self->{syslogd}}->loggrep($testlog, 2);
+ ${$self->{syslogd}}->loggrep($testlog, 4);
write_shutdown($self);
}
@@ -76,7 +76,7 @@ sub write_between2logs {
$func->($self, @_);
write_message($self, $testlog);
IO::Handle::flush(\*STDOUT);
- ${$self->{syslogd}}->loggrep($testlog, 2);
+ ${$self->{syslogd}}->loggrep($testlog, 4);
write_shutdown($self);
}