From 4b4b0ef0a4a37726cc1d927025e4647b2521bc1f Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 28 Nov 2012 00:40:37 +0000 Subject: Set used environment variables explicitly in makefile and use them consistently in relayd regression test. --- regress/usr.sbin/relayd/Makefile | 6 +++--- regress/usr.sbin/relayd/Relayd.pm | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'regress') diff --git a/regress/usr.sbin/relayd/Makefile b/regress/usr.sbin/relayd/Makefile index d8eee4778ca..42ed296fa70 100644 --- a/regress/usr.sbin/relayd/Makefile +++ b/regress/usr.sbin/relayd/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2011/09/02 17:02:10 bluhm Exp $ +# $OpenBSD: Makefile,v 1.3 2012/11/28 00:40:36 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 @@ -26,8 +26,8 @@ PERLPATH = ${.CURDIR}/ .for a in ${ARGS} run-regress-$a: $a - time SUDO=${SUDO} perl ${PERLINC} ${PERLPATH}relayd.pl copy ${PERLPATH}$a - time SUDO=${SUDO} perl ${PERLINC} ${PERLPATH}relayd.pl splice ${PERLPATH}$a + time SUDO=${SUDO} KTRACE=${KTRACE} RELAYD=${RELAYD} perl ${PERLINC} ${PERLPATH}relayd.pl copy ${PERLPATH}$a + time SUDO=${SUDO} KTRACE=${KTRACE} RELAYD=${RELAYD} perl ${PERLINC} ${PERLPATH}relayd.pl splice ${PERLPATH}$a .endfor /etc/ssl/127.0.0.1.crt: diff --git a/regress/usr.sbin/relayd/Relayd.pm b/regress/usr.sbin/relayd/Relayd.pm index a0dae1a935b..2f0dd113d39 100644 --- a/regress/usr.sbin/relayd/Relayd.pm +++ b/regress/usr.sbin/relayd/Relayd.pm @@ -1,4 +1,4 @@ -# $OpenBSD: Relayd.pm,v 1.3 2012/11/02 17:44:49 bluhm Exp $ +# $OpenBSD: Relayd.pm,v 1.4 2012/11/28 00:40:36 bluhm Exp $ # Copyright (c) 2010-2012 Alexander Bluhm # @@ -90,7 +90,7 @@ sub up { sub down { my $self = shift; - my @sudo = $ENV{SUDO} || (); + my @sudo = $ENV{SUDO} ? $ENV{SUDO} : (); my @cmd = (@sudo, '/bin/kill', $self->{pid}); system(@cmd); return Proc::down($self, @_); @@ -99,9 +99,9 @@ sub down { sub child { my $self = shift; print STDERR $self->{up}, "\n"; - my @sudo = $ENV{SUDO} || (); - my @ktrace = $ENV{KTRACE} ? qw(ktrace -i) : (); - my $relayd = $ENV{RELAYD} || "relayd"; + my @sudo = $ENV{SUDO} ? $ENV{SUDO} : (); + my @ktrace = $ENV{KTRACE} ? ($ENV{KTRACE}, "-i") : (); + my $relayd = $ENV{RELAYD} ? $ENV{RELAYD} : "relayd"; my @cmd = (@sudo, @ktrace, $relayd, '-dvv', '-f', $self->{conffile}); print STDERR "execute: @cmd\n"; exec @cmd; -- cgit v1.2.3