summaryrefslogtreecommitdiff
path: root/regress/sys/net
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2013-11-03 14:03:36 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2013-11-03 14:03:36 +0000
commit1812f7c454b9a125b1067adc00c7b97e2795592b (patch)
tree1c9360e4a9fdd04329a994d9b4334ecb08660f17 /regress/sys/net
parentf0fe3da6c6f05ebe7419337806d95c17fc7996d8 (diff)
Grep pf state table on remote machine to find state reuse problems.
Diffstat (limited to 'regress/sys/net')
-rw-r--r--regress/sys/net/pf_divert/Makefile22
-rw-r--r--regress/sys/net/pf_divert/Proc.pm4
2 files changed, 22 insertions, 4 deletions
diff --git a/regress/sys/net/pf_divert/Makefile b/regress/sys/net/pf_divert/Makefile
index e649b53f168..997fbce00bb 100644
--- a/regress/sys/net/pf_divert/Makefile
+++ b/regress/sys/net/pf_divert/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.6 2013/11/03 00:32:36 bluhm Exp $
+# $OpenBSD: Makefile,v 1.7 2013/11/03 14:03:35 bluhm Exp $
# The following ports must be installed for the regression tests:
# p5-IO-Socket-INET6 object interface for AF_INET and AF_INET6 domain sockets
@@ -109,13 +109,31 @@ run-regress-${inet}-${a:R}: ${a}
run-regress-${inet}-reuse-${proto}:
@echo
@echo $@
- time ${SUDO} SUDO=${SUDO} ktrace -i perl ${PERLINC} ${PERLPATH}remote.pl ${inet} ${LOCAL_${addr}} ${FAKE_${addr}} ${REMOTE_SSH} ${PERLPATH}args-${proto}-reply.pl
+ time ${SUDO} SUDO=${SUDO} perl ${PERLINC} ${PERLPATH}remote.pl ${inet} ${LOCAL_${addr}} ${FAKE_${addr}} ${REMOTE_SSH} ${PERLPATH}args-${proto}-reply.pl
sed -n '/^connect peer:/s/.* //p' client.log >client.port
sed -n '/^connect sock:/s/.* //p' client.log >server.port
.if "tcp" == ${proto}
${SUDO} tcpdrop ${LOCAL_${addr}} `cat client.port` ${FAKE_${addr}} `cat server.port`
.endif
time ${SUDO} SUDO=${SUDO} perl ${PERLINC} ${PERLPATH}remote.pl ${inet} ${LOCAL_${addr}} ${FAKE_${addr}} ${REMOTE_SSH} `cat client.port` `cat server.port` ${PERLPATH}args-${proto}-to.pl
+.if "rip" == ${proto}
+ if ssh ${REMOTE_SSH} ${SUDO} pfctl -ss | \
+ grep 'all 254 ${FAKE_${addr}} .. ${LOCAL_${addr}} '; \
+ then false; \
+ fi
+.else
+.if "inet" == ${inet}
+ if ssh ${REMOTE_SSH} ${SUDO} pfctl -ss | \
+ grep 'all ${proto} ${FAKE_${addr}}:'`cat server.port`' .. ${LOCAL_${addr}}:'`cat client.port`' '; \
+ then false; \
+ fi
+.else
+ if ssh ${REMOTE_SSH} ${SUDO} pfctl -ss | \
+ grep 'all ${proto} ${FAKE_${addr}}\['`cat server.port`\]' .. ${LOCAL_${addr}}\['`cat client.port`'\] '; \
+ then false; \
+ fi
+.endif
+.endif
.endfor
.endfor
diff --git a/regress/sys/net/pf_divert/Proc.pm b/regress/sys/net/pf_divert/Proc.pm
index e5c02759c14..8f08c763de0 100644
--- a/regress/sys/net/pf_divert/Proc.pm
+++ b/regress/sys/net/pf_divert/Proc.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Proc.pm,v 1.1 2013/06/03 05:06:38 bluhm Exp $
+# $OpenBSD: Proc.pm,v 1.2 2013/11/03 14:03:35 bluhm Exp $
# Copyright (c) 2010-2013 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -150,7 +150,7 @@ sub up {
sub down {
my $self = shift;
- my $timeout = shift || 30;
+ my $timeout = shift || 20;
$self->loggrep(qr/$self->{down}/, $timeout)
or croak ref($self), " no $self->{down} in $self->{logfile} ".
"after $timeout seconds";