summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2024-02-20 21:10:27 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2024-02-20 21:10:27 +0000
commit7d95a8c315886d12ee312b4058bca9e29019a17d (patch)
treed0d6a71523c3ef3c398d97b548b9f28f876f1b72 /regress/sys
parentfa976be45c9fc60876bde168dc6b6406dbecfe3a (diff)
Use REMOTE_ADDR from environment to configure pf_policy test. This
name is compatible with regress tree. Also do not run commands during make obj and make clean.
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/net/pf_policy/Makefile34
1 files changed, 20 insertions, 14 deletions
diff --git a/regress/sys/net/pf_policy/Makefile b/regress/sys/net/pf_policy/Makefile
index 42a2677872b..49cae6dd8e5 100644
--- a/regress/sys/net/pf_policy/Makefile
+++ b/regress/sys/net/pf_policy/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.3 2023/01/11 08:11:07 sashan Exp $
+# $OpenBSD: Makefile,v 1.4 2024/02/20 21:10:26 bluhm Exp $
# Copyright (c) 2022 Alexandr Nedvedicky <sashan@openbsd.org>
#
@@ -16,10 +16,10 @@
#
#
-# PROBE_HOST use any remote host which is
+# REMOTE_ADDR use any remote host which is
# reachable for ping(8)
#
-PROBE_HOST ?= 10.188.210.50
+REMOTE_ADDR ?= 10.188.210.50
TESTS_PASS = absolute \
quick \
@@ -34,37 +34,43 @@ TESTS_BLOCK = list \
TESTS_ONCE = nesting-once \
once
-REGRESS_SETUP_ONCE = enable-pf
-enable-pf:
- ${SUDO} pfctl -e || true
+.include <bsd.own.mk>
-REACHABLE != ping -c 1 -w 1 ${PROBE_HOST} > /dev/null 2>&1 && echo yes || :
+.if ! (make(clean) || make(cleandir) || make(obj))
+
+REACHABLE != ping -c 1 -w 1 ${REMOTE_ADDR} > /dev/null 2>&1 && echo yes || :
.if empty(REACHABLE)
regress:
- @echo Cannot reach ${PROBE_HOST}
+ @echo Cannot reach ${REMOTE_ADDR}
@echo SKIPPED
.endif
+.endif
+
+REGRESS_SETUP_ONCE = enable-pf
+enable-pf:
+ ${SUDO} pfctl -e || true
+
REGRESS_TARGETS += check-probe-host
check-probe-host:
- ping -c 1 -w 1 ${PROBE_HOST}
+ ping -c 1 -w 1 ${REMOTE_ADDR}
.for rules in ${TESTS_PASS}
REGRESS_TARGETS += run-pass-${rules}
run-pass-${rules}:
${SUDO} pfctl -a "regress/*" -Fa
${SUDO} pfctl -a "regress" -f ${.CURDIR}/${rules}.conf
- ping -c 1 -w 1 ${PROBE_HOST}
+ ping -c 1 -w 1 ${REMOTE_ADDR}
.endfor
.for rules in ${TESTS_BLOCK}
REGRESS_TARGETS += run-block-${rules}
run-block-${rules}:
${SUDO} pfctl -a "regress/*" -Fa
- ping -c 1 -w 1 ${PROBE_HOST}
+ ping -c 1 -w 1 ${REMOTE_ADDR}
${SUDO} pfctl -a "regress" -f ${.CURDIR}/${rules}.conf
- ping -c 1 -w 1 ${PROBE_HOST} || true
+ ping -c 1 -w 1 ${REMOTE_ADDR} || true
.endfor
.for rules in ${TESTS_ONCE}
@@ -72,8 +78,8 @@ REGRESS_TARGETS += run-once-${rules}
run-once-${rules}:
${SUDO} pfctl -a "regress/*" -Fa
${SUDO} pfctl -a "regress" -f ${.CURDIR}/${rules}.conf
- ping -c 1 -w 1 ${PROBE_HOST}
- ping -c 1 -w 1 ${PROBE_HOST} || true
+ ping -c 1 -w 1 ${REMOTE_ADDR}
+ ping -c 1 -w 1 ${REMOTE_ADDR} || true
.endfor
REGRESS_CLEANUP += cleanup