summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/syslogd/Server.pm
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-12-28 14:08:02 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-12-28 14:08:02 +0000
commitfd4617a7c6b3d073626f344e37ed32776cb0348e (patch)
treebed53c2bcf044f55e21fee52241b310cec8970a2 /regress/usr.sbin/syslogd/Server.pm
parent5074eadcbe2952ea5dc8377efdaa2d8568d057e0 (diff)
Add regression tests where OpenBSD syslogd is sending messages to
rsyslogd from ports. If the rsyslog package is installed, rsyslogd is used as drain to test interoperability. This will be especially useful for syslog via TCP and TLS.
Diffstat (limited to 'regress/usr.sbin/syslogd/Server.pm')
-rw-r--r--regress/usr.sbin/syslogd/Server.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/regress/usr.sbin/syslogd/Server.pm b/regress/usr.sbin/syslogd/Server.pm
index 8bcdf73d630..818e694eba1 100644
--- a/regress/usr.sbin/syslogd/Server.pm
+++ b/regress/usr.sbin/syslogd/Server.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Server.pm,v 1.2 2014/08/25 17:55:27 bluhm Exp $
+# $OpenBSD: Server.pm,v 1.3 2014/12/28 14:08:01 bluhm Exp $
# Copyright (c) 2010-2014 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -33,13 +33,13 @@ sub new {
$args{logfile} ||= "server.log";
$args{up} ||= "Accepted";
my $self = Proc::new($class, %args);
- $self->{listenprotocol} ||= "udp";
+ $self->{listenproto} ||= "udp";
defined($self->{listendomain})
or croak "$class listen domain not given";
$SSL_ERROR = "";
- my $iosocket = $self->{listenprotocol} eq "tls" ?
+ my $iosocket = $self->{listenproto} eq "tls" ?
"IO::Socket::SSL" : "IO::Socket::INET6";
- my $proto = $self->{listenprotocol};
+ my $proto = $self->{listenproto};
$proto = "tcp" if $proto eq "tls";
my $ls = $iosocket->new(
Proto => $proto,
@@ -51,7 +51,7 @@ sub new {
SSL_cert_file => "server-cert.pem",
SSL_verify_mode => SSL_VERIFY_NONE,
) or die ref($self), " $iosocket socket listen failed: $!,$SSL_ERROR";
- if ($self->{listenprotocol} eq "tcp") {
+ if ($self->{listenproto} eq "tcp") {
listen($ls, 1)
or die ref($self), " socket failed: $!";
}
@@ -68,7 +68,7 @@ sub child {
my $iosocket = $self->{ssl} ? "IO::Socket::SSL" : "IO::Socket::INET6";
my $as = $self->{ls};
- if ($self->{listenprotocol} ne "udp") {
+ if ($self->{listenproto} ne "udp") {
$as = $self->{ls}->accept()
or die ref($self), " $iosocket socket accept failed: $!";
print STDERR "accept sock: ",$as->sockhost()," ",