diff options
author | 2017-02-27 21:56:09 +0000 | |
---|---|---|
committer | 2017-02-27 21:56:09 +0000 | |
commit | bcf43f1c3314bd0c6f2445bfd3001515b6cfb393 (patch) | |
tree | ecdc1d24969bcbe9445112c445e6c18bc1de02a5 | |
parent | Remove support for pkg.conf in light of the consolidation towards (diff) | |
download | wireguard-openbsd-bcf43f1c3314bd0c6f2445bfd3001515b6cfb393.tar.xz wireguard-openbsd-bcf43f1c3314bd0c6f2445bfd3001515b6cfb393.zip |
Do not turn on pf in a regression test, require that it has been
enabled before. Better skip the test than create unexpected side
effects.
-rw-r--r-- | regress/sys/net/pflow/Makefile | 11 | ||||
-rw-r--r-- | regress/sys/net/pflow/flow.pl | 8 |
2 files changed, 11 insertions, 8 deletions
diff --git a/regress/sys/net/pflow/Makefile b/regress/sys/net/pflow/Makefile index 5b12c4f50fc..115d764eecd 100644 --- a/regress/sys/net/pflow/Makefile +++ b/regress/sys/net/pflow/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.5 2016/10/26 14:06:33 bluhm Exp $ +# $OpenBSD: Makefile,v 1.6 2017/02/27 21:56:09 bluhm Exp $ # # template_v10 # ---------------- @@ -31,6 +31,15 @@ REGRESS_TARGETS=template_v10 flow_10_4 flow_10_6 ifconfig PROG= gen_traffic LDADD= -levent +.if ! (make(clean) || make(cleandir) || make(obj)) +PF_ENABLED != pfctl -si | grep '^Status: Enabled ' || true +.endif +.if empty(PF_ENABLED) +regress: + @echo enable pf on localhost to run pflog test + @echo SKIPPED +.endif + template_v10: perl -I ${.CURDIR} ${.CURDIR}/template.pl 10 \ | diff -up ${.CURDIR}/template.v10 /dev/stdin diff --git a/regress/sys/net/pflow/flow.pl b/regress/sys/net/pflow/flow.pl index b05719d026c..e6b2524e289 100644 --- a/regress/sys/net/pflow/flow.pl +++ b/regress/sys/net/pflow/flow.pl @@ -1,5 +1,5 @@ #! /usr/bin/perl -# $OpenBSD: flow.pl,v 1.4 2017/01/16 07:04:50 florian Exp $ +# $OpenBSD: flow.pl,v 1.5 2017/02/27 21:56:09 bluhm Exp $ # Copyright (c) 2013 Florian Obser <florian@openbsd.org> # @@ -151,12 +151,6 @@ open($prog, '|pfctl -f -') or die $!; print $prog gen_pf_conf(get_ifs()); close($prog) or die $!; -open($prog, 'pfctl -si|') or die $!; -$line = <$prog>; -close($prog); - -system('pfctl', '-q', '-e') if ($line!~/^Status: Enabled/); - if (`ifconfig pflow0 2>&1` ne "pflow0: no such interface\n") { system('ifconfig', 'pflow0', 'destroy'); } |