summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2017-02-27 21:56:10 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2017-02-27 21:56:10 +0000
commitb641e1fe4d2488fd957de3313519d160fee275a8 (patch)
treec5e5f2c495d3af88dad6886fec4ef7646c085a4b /regress/sys
parent701ac2fd5e3d6e6b6d738505eb1c6500a6baa27e (diff)
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.
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/net/pflow/Makefile11
-rw-r--r--regress/sys/net/pflow/flow.pl8
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');
}