summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-08-23 21:20:06 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-08-23 21:20:06 +0000
commit2c0c58d93cc9d56a938b2ac03c713bfeaf050edb (patch)
treeaea591935d1dc74903ac01f6dcefe94618f900cc /regress/usr.sbin/syslogd
parent9cf9759be93c6f693b71b5e76ca026ac525b4c29 (diff)
Some syslogd tests failed to report errors. Make these tests more
strict and adapt the check patterns.
Diffstat (limited to 'regress/usr.sbin/syslogd')
-rw-r--r--regress/usr.sbin/syslogd/Makefile18
-rw-r--r--regress/usr.sbin/syslogd/args-client-tls4.pl2
-rw-r--r--regress/usr.sbin/syslogd/args-client-tls6.pl2
-rw-r--r--regress/usr.sbin/syslogd/args-tls-cert-empty.pl12
-rw-r--r--regress/usr.sbin/syslogd/args-tls-cert-noexist.pl6
-rw-r--r--regress/usr.sbin/syslogd/args-tls-key-empty.pl12
-rw-r--r--regress/usr.sbin/syslogd/args-tls-key-noexist.pl9
7 files changed, 38 insertions, 23 deletions
diff --git a/regress/usr.sbin/syslogd/Makefile b/regress/usr.sbin/syslogd/Makefile
index e7bd19558e0..5c00b3e5753 100644
--- a/regress/usr.sbin/syslogd/Makefile
+++ b/regress/usr.sbin/syslogd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.15 2016/07/12 09:57:20 bluhm Exp $
+# $OpenBSD: Makefile,v 1.16 2016/08/23 21:20:05 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
@@ -36,7 +36,7 @@ REGRESS_TARGETS = ${TARGETS:S/^/run-regress-/}
LDFLAGS += -lutil
CLEANFILES += *.log *.log.? *.conf ktrace.out stamp-*
CLEANFILES += *.out *.sock *.ktrace *.fstat ttylog
-CLEANFILES += *.pem *.req *.crt *.key *.srl empty toobig
+CLEANFILES += *.pem *.req *.key *.crt *.srl empty toobig
.MAIN: all
@@ -74,12 +74,16 @@ run-regress-$a: $a
127.0.0.1.crt:
openssl req -batch -new -subj /L=OpenBSD/O=syslogd-regress/OU=syslogd/CN=127.0.0.1/ -nodes -newkey rsa -keyout 127.0.0.1.key -x509 -out $@
- ${SUDO} cp 127.0.0.1.crt /etc/ssl/
- ${SUDO} cp 127.0.0.1.key /etc/ssl/private/
- ${SUDO} cp 127.0.0.1.crt /etc/ssl/localhost.crt
- ${SUDO} cp 127.0.0.1.key /etc/ssl/private/localhost.key
- ${SUDO} cp 127.0.0.1.crt /etc/ssl/::1.crt
+ ${SUDO} rm -f /etc/ssl/private/127.0.0.1:6514.key
+ ${SUDO} rm -f /etc/ssl/127.0.0.1:6514.crt
+ ${SUDO} rm -f /etc/ssl/private/127.0.0.1.key
+ ${SUDO} rm -f /etc/ssl/127.0.0.1.crt
+ ${SUDO} cp 127.0.0.1.key /etc/ssl/private/127.0.0.1.key
+ ${SUDO} cp 127.0.0.1.crt /etc/ssl/127.0.0.1.crt
${SUDO} cp 127.0.0.1.key /etc/ssl/private/::1.key
+ ${SUDO} cp 127.0.0.1.crt /etc/ssl/::1.crt
+ ${SUDO} cp 127.0.0.1.key /etc/ssl/private/localhost.key
+ ${SUDO} cp 127.0.0.1.crt /etc/ssl/localhost.crt
ca.crt fake-ca.crt:
openssl req -batch -new -subj /L=OpenBSD/O=syslogd-regress/OU=ca/CN=root/ -nodes -newkey rsa -keyout ${@:R}.key -x509 -out $@
diff --git a/regress/usr.sbin/syslogd/args-client-tls4.pl b/regress/usr.sbin/syslogd/args-client-tls4.pl
index 3ff39dd0e6c..7168749eb57 100644
--- a/regress/usr.sbin/syslogd/args-client-tls4.pl
+++ b/regress/usr.sbin/syslogd/args-client-tls4.pl
@@ -28,8 +28,8 @@ our %args = (
},
ktrace => {
qr{NAMI "/etc/ssl/private/127.0.0.1:6514.key"} => 1,
- qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 1,
qr{NAMI "/etc/ssl/127.0.0.1:6514.crt"} => 0,
+ qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 1,
qr{NAMI "/etc/ssl/127.0.0.1.crt"} => 1,
},
loggrep => {
diff --git a/regress/usr.sbin/syslogd/args-client-tls6.pl b/regress/usr.sbin/syslogd/args-client-tls6.pl
index 4296f62ce78..e26b061d43e 100644
--- a/regress/usr.sbin/syslogd/args-client-tls6.pl
+++ b/regress/usr.sbin/syslogd/args-client-tls6.pl
@@ -28,8 +28,8 @@ our %args = (
},
ktrace => {
qr{NAMI "/etc/ssl/private/\[::1\]:6514.key"} => 1,
- qr{NAMI "/etc/ssl/private/::1.key"} => 1,
qr{NAMI "/etc/ssl/\[::1\]:6514.crt"} => 0,
+ qr{NAMI "/etc/ssl/private/::1.key"} => 1,
qr{NAMI "/etc/ssl/::1.crt"} => 1,
},
loggrep => {
diff --git a/regress/usr.sbin/syslogd/args-tls-cert-empty.pl b/regress/usr.sbin/syslogd/args-tls-cert-empty.pl
index c9b1aece0d2..703042bcdd5 100644
--- a/regress/usr.sbin/syslogd/args-tls-cert-empty.pl
+++ b/regress/usr.sbin/syslogd/args-tls-cert-empty.pl
@@ -6,12 +6,16 @@ use strict;
use warnings;
use Socket;
+my $key = "/etc/ssl/private/127.0.0.1:6514.key";
my $cert = "/etc/ssl/127.0.0.1:6514.crt";
my @sudo = $ENV{SUDO} ? $ENV{SUDO} : ();
-my @cmd = (@sudo, "cp", "--", "empty", $cert);
+my @cmd = (@sudo, "cp", "--", "127.0.0.1.key", $key);
+system(@cmd) and die "Command '@cmd' failed: $?";
+@cmd = (@sudo, "cp", "--", "empty", $cert);
system(@cmd) and die "Command '@cmd' failed: $?";
END {
- my @cmd = (@sudo, "rm", "-f", "--", $cert);
+ local $?;
+ my @cmd = (@sudo, "rm", "-f", "--", $key, $cert);
system(@cmd) and warn "Command '@cmd' failed: $?";
}
@@ -32,12 +36,12 @@ our %args = (
options => ["-S", "127.0.0.1:6514"],
ktrace => {
qr{NAMI "/etc/ssl/private/127.0.0.1:6514.key"} => 1,
- qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 1,
qr{NAMI "/etc/ssl/127.0.0.1:6514.crt"} => 1,
+ qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 0,
qr{NAMI "/etc/ssl/127.0.0.1.crt"} => 0,
},
loggrep => {
- qr{Keyfile /etc/ssl/private/127.0.0.1.key} => 1,
+ qr{Keyfile $key} => 1,
qr{Certfile $cert} => 1,
qr{syslogd: tls_configure server} => 2,
},
diff --git a/regress/usr.sbin/syslogd/args-tls-cert-noexist.pl b/regress/usr.sbin/syslogd/args-tls-cert-noexist.pl
index cc5f2e3d350..57b83afd227 100644
--- a/regress/usr.sbin/syslogd/args-tls-cert-noexist.pl
+++ b/regress/usr.sbin/syslogd/args-tls-cert-noexist.pl
@@ -11,6 +11,7 @@ my @sudo = $ENV{SUDO} ? $ENV{SUDO} : ();
my @cmd = (@sudo, "rm", "-f", "--", $cert);
system(@cmd) and die "Command '@cmd' failed: $?";
END {
+ local $?;
my @cmd = (@sudo, "cp", "--", "127.0.0.1.crt", $cert);
system(@cmd) and warn "Command '@cmd' failed: $?";
}
@@ -32,14 +33,15 @@ our %args = (
options => ["-S", "127.0.0.1:6514"],
ktrace => {
qr{NAMI "/etc/ssl/private/127.0.0.1:6514.key"} => 1,
+ qr{NAMI "/etc/ssl/127.0.0.1:6514.crt"} => 0,
qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 1,
- qr{NAMI "/etc/ssl/127.0.0.1:6514.crt"} => 1,
qr{NAMI "/etc/ssl/127.0.0.1.crt"} => 1,
},
loggrep => {
qr{Keyfile /etc/ssl/private/127.0.0.1.key} => 1,
qr{Certfile } => 0,
- qr{syslogd: open certfile: No such file or directory} => 2,
+ qr{syslogd: tls_config_set_key_file} => 2,
+ qr{syslogd: tls_config_set_cert_file} => 2,
qr{syslogd: tls_configure server} => 2,
},
},
diff --git a/regress/usr.sbin/syslogd/args-tls-key-empty.pl b/regress/usr.sbin/syslogd/args-tls-key-empty.pl
index be01b48199b..72530cf89ea 100644
--- a/regress/usr.sbin/syslogd/args-tls-key-empty.pl
+++ b/regress/usr.sbin/syslogd/args-tls-key-empty.pl
@@ -7,11 +7,15 @@ use warnings;
use Socket;
my $key = "/etc/ssl/private/127.0.0.1:6514.key";
+my $cert = "/etc/ssl/127.0.0.1:6514.crt";
my @sudo = $ENV{SUDO} ? $ENV{SUDO} : ();
my @cmd = (@sudo, "cp", "--", "empty", $key);
system(@cmd) and die "Command '@cmd' failed: $?";
+@cmd = (@sudo, "cp", "--", "127.0.0.1.crt", $cert);
+system(@cmd) and die "Command '@cmd' failed: $?";
END {
- my @cmd = (@sudo, "rm", "-f", "--", $key);
+ local $?;
+ my @cmd = (@sudo, "rm", "-f", "--", $key, $cert);
system(@cmd) and warn "Command '@cmd' failed: $?";
}
@@ -32,13 +36,13 @@ our %args = (
options => ["-S", "127.0.0.1:6514"],
ktrace => {
qr{NAMI "/etc/ssl/private/127.0.0.1:6514.key"} => 1,
- qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 0,
qr{NAMI "/etc/ssl/127.0.0.1:6514.crt"} => 1,
- qr{NAMI "/etc/ssl/127.0.0.1.crt"} => 1,
+ qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 0,
+ qr{NAMI "/etc/ssl/127.0.0.1.crt"} => 0,
},
loggrep => {
qr{Keyfile $key} => 1,
- qr{Certfile /etc/ssl/127.0.0.1.crt} => 1,
+ qr{Certfile $cert} => 1,
qr{syslogd: tls_configure server} => 2,
},
},
diff --git a/regress/usr.sbin/syslogd/args-tls-key-noexist.pl b/regress/usr.sbin/syslogd/args-tls-key-noexist.pl
index d94bccc0bb1..0b96cf94885 100644
--- a/regress/usr.sbin/syslogd/args-tls-key-noexist.pl
+++ b/regress/usr.sbin/syslogd/args-tls-key-noexist.pl
@@ -11,6 +11,7 @@ my @sudo = $ENV{SUDO} ? $ENV{SUDO} : ();
my @cmd = (@sudo, "rm", "-f", "--", $key);
system(@cmd) and die "Command '@cmd' failed: $?";
END {
+ local $?;
my @cmd = (@sudo, "cp", "--", "127.0.0.1.key", $key);
system(@cmd) and warn "Command '@cmd' failed: $?";
}
@@ -32,14 +33,14 @@ our %args = (
options => ["-S", "127.0.0.1:6514"],
ktrace => {
qr{NAMI "/etc/ssl/private/127.0.0.1:6514.key"} => 1,
+ qr{NAMI "/etc/ssl/127.0.0.1:6514.crt"} => 0,
qr{NAMI "/etc/ssl/private/127.0.0.1.key"} => 1,
- qr{NAMI "/etc/ssl/127.0.0.1:6514.crt"} => 1,
- qr{NAMI "/etc/ssl/127.0.0.1.crt"} => 1,
+ qr{NAMI "/etc/ssl/127.0.0.1.crt"} => 0,
},
loggrep => {
qr{Keyfile } => 0,
- qr{Certfile /etc/ssl/127.0.0.1.crt} => 1,
- qr{syslogd: open keyfile: No such file or directory} => 2,
+ qr{Certfile } => 0,
+ qr{syslogd: tls_config_set_key_file} => 4,
qr{syslogd: tls_configure server} => 2,
},
},