From 957ba0a7e0b82c5fd052fbb3c55ada1e5c9246b6 Mon Sep 17 00:00:00 2001 From: anton Date: Mon, 5 Feb 2018 18:28:15 +0000 Subject: [PATCH] Pass env(1) to ${SUDO}, not the other way around. Solves an issue when running the tests as a non-root and doas is not configured to preserve the OBJDIR variable. While here, ensure OBJDIR is defined and fix typos. ok bluhm@ --- regress/usr.sbin/ifstated/Makefile | 6 +++--- regress/usr.sbin/ifstated/ifstated | 6 ++++-- regress/usr.sbin/ifstated/statemachine | 7 +++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/regress/usr.sbin/ifstated/Makefile b/regress/usr.sbin/ifstated/Makefile index 92d98534645..3759eea623f 100644 --- a/regress/usr.sbin/ifstated/Makefile +++ b/regress/usr.sbin/ifstated/Makefile @@ -1,12 +1,12 @@ -# $OpenBSD: Makefile,v 1.2 2017/08/12 21:41:16 rob Exp $ +# $OpenBSD: Makefile,v 1.3 2018/02/05 18:28:15 anton Exp $ # Regress tests for ifstated REGRESS_TARGETS = run-regress-statemachine run-regress-ifstated run-regress-statemachine: - env OBJDIR=${.OBJDIR} ${SUDO} sh ${.CURDIR}/statemachine + ${SUDO} env OBJDIR=${.OBJDIR} sh ${.CURDIR}/statemachine run-regress-ifstated: - env OBJDIR=${.OBJDIR} ${SUDO} sh ${.CURDIR}/ifstated + ${SUDO} env OBJDIR=${.OBJDIR} sh ${.CURDIR}/ifstated .include diff --git a/regress/usr.sbin/ifstated/ifstated b/regress/usr.sbin/ifstated/ifstated index 7fba45ececb..6965110be58 100644 --- a/regress/usr.sbin/ifstated/ifstated +++ b/regress/usr.sbin/ifstated/ifstated @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: ifstated,v 1.7 2017/08/30 16:14:52 rob Exp $ +# $OpenBSD: ifstated,v 1.8 2018/02/05 18:28:15 anton Exp $ #/* # * Copyright (c) Rob Pierce # * @@ -19,9 +19,11 @@ # Basic ifstated regression script to test interface changes. +# Ensure OBJDIR is defined +: ${OBJDIR?} || exit 1 export OBJDIR -# Golbal variables +# Global variables VHIDA=252 VHIDB=253 PREFIX=172.16.0 diff --git a/regress/usr.sbin/ifstated/statemachine b/regress/usr.sbin/ifstated/statemachine index fe7b9c8a72a..e185cd19280 100644 --- a/regress/usr.sbin/ifstated/statemachine +++ b/regress/usr.sbin/ifstated/statemachine @@ -1,6 +1,6 @@ #!/bin/sh # -# $OpenBSD: statemachine,v 1.5 2017/08/28 22:05:44 rob Exp $ +# $OpenBSD: statemachine,v 1.6 2018/02/05 18:28:15 anton Exp $ #/* # * Copyright (c) Rob Pierce # * @@ -23,9 +23,12 @@ # NOTE: Increase LSLEEP as required when adding additional test states. # +# Ensure OBJDIR is defined +: ${OBJDIR?} || exit 1 + export OBJDIR -# Golbal variables +# Global variables FILE1="truth1.test" FILE2="truth2.test" EVERY=2 -- 2.20.1