summaryrefslogtreecommitdiff
path: root/regress/sbin/pfctl/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sbin/pfctl/Makefile')
-rw-r--r--regress/sbin/pfctl/Makefile83
1 files changed, 43 insertions, 40 deletions
diff --git a/regress/sbin/pfctl/Makefile b/regress/sbin/pfctl/Makefile
index d42bb446e68..adc236cc8b7 100644
--- a/regress/sbin/pfctl/Makefile
+++ b/regress/sbin/pfctl/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.227 2017/08/11 22:30:38 benno Exp $
+# $OpenBSD: Makefile,v 1.228 2017/11/24 22:53:55 bluhm Exp $
# TARGETS
# pf: feed pfNN.in through pfctl and check whether the output matches pfNN.ok
@@ -6,7 +6,7 @@
# pfail: invalid rulesets pfctl must reject; pfailNN.in and pfailNN.ok
# pfsetup: set up lo1 and perform more tests
# pfr: table tests
-# pfsimple: just check whether pfctl accepts a given ruleset, not checking output
+# pfsimple: check whether pfctl accepts a given ruleset, not checking output
# pfload: load ruleset into anchor regress and verify pfctl -vvsr
# pfoptimize: as pfload, with -o flag to pfctl
# pfopt: as target pf, but supply extra command line options
@@ -31,6 +31,8 @@ PFCHKSUM=1 2 3
PFCMD=1
PFCMDFAIL=1
+PFCTL ?= /sbin/pfctl
+
MAKEOBJDIRPREFIX=
SHELL=/bin/sh
@@ -62,15 +64,15 @@ PFAIL_TARGETS+=pfail${n}
PFAIL_UPDATES+=pfail${n}-update
pfail${n}:
- pfctl -o none -nv -f - < ${.CURDIR}/pfail${n}.in 2>&1 | \
+ ${PFCTL} -o none -nv -f - < ${.CURDIR}/pfail${n}.in 2>&1 | \
diff -u ${.CURDIR}/pfail${n}.ok /dev/stdin
pfail${n}-update:
- if pfctl -o none -nv -f - < ${.CURDIR}/pfail${n}.in > \
+ if ${PFCTL} -o none -nv -f - < ${.CURDIR}/pfail${n}.in > \
${.CURDIR}/pfail${n}.ok 2>&1; then \
true; \
fi;
-
+
.endfor
pfail: ${PFAIL_TARGETS}
@@ -83,15 +85,15 @@ PF_TARGETS+=pf${n}
PF_UPDATES+=pf${n}-update
pf${n}:
- pfctl -o none -nv -f - < ${.CURDIR}/pf${n}.in | \
+ ${PFCTL} -o none -nv -f - < ${.CURDIR}/pf${n}.in | \
diff -u ${.CURDIR}/pf${n}.ok /dev/stdin
pf${n}-update:
- pfctl -o none -nv -f - < ${.CURDIR}/pf${n}.in > ${.CURDIR}/pf${n}.ok
+ ${PFCTL} -o none -nv -f - < ${.CURDIR}/pf${n}.in > ${.CURDIR}/pf${n}.ok
SELFPF_TARGETS+=selfpf${n}
selfpf${n}:
- pfctl -o none -nv -f - < ${.CURDIR}/pf${n}.ok | \
+ ${PFCTL} -o none -nv -f - < ${.CURDIR}/pf${n}.ok | \
diff -u ${.CURDIR}/pf${n}.ok /dev/stdin
.endfor
@@ -113,7 +115,7 @@ pf-include-setup:
PFSIMPLE_TARGETS+=pfsimple${n}
pfsimple${n}:
- pfctl -o none -nf - < ${.CURDIR}/pfsimple${n}.in
+ ${PFCTL} -o none -nf - < ${.CURDIR}/pfsimple${n}.in
.endfor
@@ -125,18 +127,18 @@ PFLOAD_TARGETS+=pfload${n}
PFLOAD_UPDATES+=pfload${n}-update
pfload${n}:
- ${SUDO} pfctl -o none -a regress -f - < ${.CURDIR}/pf${n}.in
- (${SUDO} pfctl -o none -a 'regress/*' -gvvsr | \
+ ${SUDO} ${PFCTL} -o none -a regress -f - < ${.CURDIR}/pf${n}.in
+ (${SUDO} ${PFCTL} -o none -a 'regress/*' -gvvsr | \
sed -e 's/__automatic_[0-9a-f]*_/__automatic_/g' ) | \
diff -u ${.CURDIR}/pf${n}.loaded /dev/stdin
- ${SUDO} pfctl -o none -a regress -Fr >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -a regress -Fr >/dev/null 2>&1
pfload${n}-update:
- ${SUDO} pfctl -o none -a regress -f - < ${.CURDIR}/pf${n}.in
- (${SUDO} pfctl -o none -a 'regress/*' -gvvsr | \
+ ${SUDO} ${PFCTL} -o none -a regress -f - < ${.CURDIR}/pf${n}.in
+ (${SUDO} ${PFCTL} -o none -a 'regress/*' -gvvsr | \
sed -e 's/__automatic_[0-9a-f]*_/__automatic_/g' ) \
> ${.CURDIR}/pf${n}.loaded
- ${SUDO} pfctl -o none -a regress -Fr >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -a regress -Fr >/dev/null 2>&1
.endfor
@@ -151,18 +153,18 @@ PFOPTIMIZE_TARGETS+=pfoptimize${n}
PFOPTIMIZE_UPDATES+=pfoptimize${n}-update
pfoptimize${n}:
- ${SUDO} pfctl -obasic -a regress -f - < ${.CURDIR}/pf${n}.in
- (${SUDO} pfctl -o none -a regress -gvvsr | \
+ ${SUDO} ${PFCTL} -obasic -a regress -f - < ${.CURDIR}/pf${n}.in
+ (${SUDO} ${PFCTL} -o none -a regress -gvvsr | \
sed -e 's/__automatic_[0-9a-f]*_/__automatic_/g') | \
diff -u ${.CURDIR}/pf${n}.optimized /dev/stdin
- ${SUDO} pfctl -o none -a regress -Fr >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -a regress -Fr >/dev/null 2>&1
pfoptimize${n}-update:
- ${SUDO} pfctl -obasic -a regress -f - < ${.CURDIR}/pf${n}.in
- (${SUDO} pfctl -o none -a regress -gvvsr | \
+ ${SUDO} ${PFCTL} -obasic -a regress -f - < ${.CURDIR}/pf${n}.in
+ (${SUDO} ${PFCTL} -o none -a regress -gvvsr | \
sed -e 's/__automatic_[0-9a-f]*_/__automatic_/g' ) \
> ${.CURDIR}/pf${n}.optimized
- ${SUDO} pfctl -o none -a regress -Fr >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -a regress -Fr >/dev/null 2>&1
.endfor
@@ -197,7 +199,7 @@ PFI_UPDATES+=pfi${n}-update
pfi${n}:
xargs ${SUDO} /bin/ksh ${.CURDIR}/if2ip <${.CURDIR}/pfi${n}.in | \
- diff -u ${.CURDIR}/pfi${n}.ok /dev/stdin
+ diff -u ${.CURDIR}/pfi${n}.ok /dev/stdin
pfi${n}-update:
xargs ${SUDO} /bin/ksh ${.CURDIR}/if2ip <${.CURDIR}/pfi${n}.in \
@@ -216,12 +218,12 @@ PFOPT_TARGETS+=pfopt${n}
PFOPT_UPDATES+=pfopt${n}-update
pfopt${n}:
- pfctl -o none -nv -f - `cat ${.CURDIR}/pfopt${n}.opts` \
+ ${PFCTL} -o none -nv -f - `cat ${.CURDIR}/pfopt${n}.opts` \
< ${.CURDIR}/pfopt${n}.in | \
diff -u ${.CURDIR}/pfopt${n}.ok /dev/stdin
pfopt${n}-update:
- pfctl -o none -nv -f - `cat ${.CURDIR}/pfopt${n}.opts` \
+ ${PFCTL} -o none -nv -f - `cat ${.CURDIR}/pfopt${n}.opts` \
< ${.CURDIR}/pfopt${n}.in > ${.CURDIR}/pfopt${n}.ok
.endfor
@@ -236,11 +238,11 @@ PFCMD_TARGETS+=pfcmd${n}
PFCMD_UPDATES+=pfcmd${n}-update
pfcmd${n}:
- ${SUDO} pfctl `cat ${.CURDIR}/pfcmd${n}.opts` \
+ ${SUDO} ${PFCTL} `cat ${.CURDIR}/pfcmd${n}.opts` \
-f ${.CURDIR}/pfcmd${n}.in
pfcmd${n}-update:
- ${SUDO} pfctl -f - `cat ${.CURDIR}/pfcmd${n}.opts` \
+ ${SUDO} ${PFCTL} -f - `cat ${.CURDIR}/pfcmd${n}.opts` \
< ${.CURDIR}/pfcmd${n}.in > ${.CURDIR}/pfcmd${n}.ok
.endfor
@@ -258,12 +260,12 @@ PFCMDFAIL_TARGETS+=pfcmdfail${n}
PFCMDFAIL_UPDATES+=pfcmdfail${n}-update
pfcmdfail${n}:
- ${SUDO} pfctl `cat ${.CURDIR}/pfcmdfail${n}.opts` \
+ ${SUDO} ${PFCTL} `cat ${.CURDIR}/pfcmdfail${n}.opts` \
-f - < ${.CURDIR}/pfcmdfail${n}.in 2>&1 | \
- diff -u ${.CURDIR}/pfcmdfail${n}.ok /dev/stdin
+ diff -u ${.CURDIR}/pfcmdfail${n}.ok /dev/stdin
pfcmdfail${n}-update:
- if ${SUDO} pfctl `cat ${.CURDIR}/pfcmdfail${n}.opts` \
+ if ${SUDO} ${PFCTL} `cat ${.CURDIR}/pfcmdfail${n}.opts` \
-f - < ${.CURDIR}/pfcmdfail${n}.in > \
${.CURDIR}/pfcmdfail${n}.ok 2>&1; then \
true; \
@@ -285,13 +287,13 @@ PFSETUP_UPDATES+=pfsetup${n}-update
pfsetup${n}:
${SUDO} ${SHELL} ${.CURDIR}/pfsetup${n}.setup
- pfctl -o none -nv -f - < ${.CURDIR}/pfsetup${n}.in | \
+ ${PFCTL} -o none -nv -f - < ${.CURDIR}/pfsetup${n}.in | \
diff -u ${.CURDIR}/pfsetup${n}.ok /dev/stdin
${SUDO} ${SHELL} ${.CURDIR}/pfsetup${n}.clean
pfsetup${n}-update:
${SUDO} ${SHELL} ${.CURDIR}/pfsetup${n}.setup
- pfctl -o none -nv -f - < ${.CURDIR}/pfsetup${n}.in \
+ ${PFCTL} -o none -nv -f - < ${.CURDIR}/pfsetup${n}.in \
> ${.CURDIR}/pfsetup${n}.ok
${SUDO} ${SHELL} ${.CURDIR}/pfsetup${n}.clean
@@ -308,17 +310,18 @@ PFCHKSUM_TARGETS+=pfchksum${n}
PFCHKSUM_UPDATES+=pfchksum${n}-update
pfchksum${n}:
- ${SUDO} pfctl -o none -Fa >/dev/null 2>&1
- ${SUDO} pfctl -o none -f - < ${.CURDIR}/pfchksum${n}.in
- ${SUDO} pfctl -o none -vsi | grep '^Checksum:' | \
- diff -u ${.CURDIR}/pfchksum${n}.ok /dev/stdin
- ${SUDO} pfctl -o none -Fa >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -Fa >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -f - < ${.CURDIR}/pfchksum${n}.in
+ ${SUDO} ${PFCTL} -o none -vsi | grep '^Checksum:' | \
+ diff -u ${.CURDIR}/pfchksum${n}.ok /dev/stdin
+ ${SUDO} ${PFCTL} -o none -Fa >/dev/null 2>&1
pfchksum${n}-update:
- ${SUDO} pfctl -o none -Fa >/dev/null 2>&1
- ${SUDO} pfctl -o none -f - < ${.CURDIR}/pfchksum${n}.in
- ${SUDO} pfctl -o none -vsi | grep '^Checksum:' > ${.CURDIR}/pfchksum${n}.ok
- ${SUDO} pfctl -o none -Fa >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -Fa >/dev/null 2>&1
+ ${SUDO} ${PFCTL} -o none -f - < ${.CURDIR}/pfchksum${n}.in
+ ${SUDO} ${PFCTL} -o none -vsi | grep '^Checksum:' \
+ > ${.CURDIR}/pfchksum${n}.ok
+ ${SUDO} ${PFCTL} -o none -Fa >/dev/null 2>&1
.endfor