summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-10-20 19:16:06 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-10-20 19:16:06 +0000
commit27e8f53356587536bcf8f6b9b12921de1c4537fd (patch)
tree844999da73c4469bb5ffd514da5565d9e321abb1 /regress/sys
parent672d34348cde28e23d0821b66f0d2de77a8c4586 (diff)
By removing all the sleeps I created a race in the pf tests. The
packet was sent and its reply received before the sniffer was up and running. So sleep a second after starting the sniffer thread but before sending the packet. With pf_forward 0m51.54s, pf_fragment 1m33.59s, pf_state 0m03.64s the test are still faster than with forking.
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/net/pf_forward/ping6_mtu.py1
-rw-r--r--regress/sys/net/pf_fragment/frag.py1
-rw-r--r--regress/sys/net/pf_fragment/frag6.py1
-rw-r--r--regress/sys/net/pf_fragment/frag6_cutnew.py1
-rw-r--r--regress/sys/net/pf_fragment/frag6_cutold.py1
-rw-r--r--regress/sys/net/pf_fragment/frag6_dropnew.py1
-rw-r--r--regress/sys/net/pf_fragment/frag6_dropold.py1
-rw-r--r--regress/sys/net/pf_fragment/frag6_ext.py1
-rw-r--r--regress/sys/net/pf_fragment/frag_cutnew.py1
-rw-r--r--regress/sys/net/pf_fragment/frag_cutold.py1
-rw-r--r--regress/sys/net/pf_fragment/frag_dropnew.py1
-rw-r--r--regress/sys/net/pf_fragment/frag_dropold.py1
-rw-r--r--regress/sys/net/pf_fragment/ping6_mtu_1300.py1
-rw-r--r--regress/sys/net/pf_state/challenge_ack.py4
14 files changed, 15 insertions, 2 deletions
diff --git a/regress/sys/net/pf_forward/ping6_mtu.py b/regress/sys/net/pf_forward/ping6_mtu.py
index 0d9a8d433cd..c6f1b93f842 100644
--- a/regress/sys/net/pf_forward/ping6_mtu.py
+++ b/regress/sys/net/pf_forward/ping6_mtu.py
@@ -34,6 +34,7 @@ eth=Ether(src=SRC_MAC, dst=PF_MAC)/ip
sniffer = Sniff1();
sniffer.filter = "ip6 and dst %s and icmp6" % srcaddr
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag.py b/regress/sys/net/pf_fragment/frag.py
index c66b8160e9d..ff93cabddd9 100644
--- a/regress/sys/net/pf_fragment/frag.py
+++ b/regress/sys/net/pf_fragment/frag.py
@@ -31,6 +31,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt1)
sniffer = Sniff1();
sniffer.filter = "ip and src %s and dst %s and icmp" % (dstaddr, SRC_OUT)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag6.py b/regress/sys/net/pf_fragment/frag6.py
index 81259afd3bb..e24c4fe5f71 100644
--- a/regress/sys/net/pf_fragment/frag6.py
+++ b/regress/sys/net/pf_fragment/frag6.py
@@ -31,6 +31,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt1)
sniffer = Sniff1();
sniffer.filter = "ip6 and src %s and dst %s and icmp6" % (dstaddr, SRC_OUT6)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag6_cutnew.py b/regress/sys/net/pf_fragment/frag6_cutnew.py
index d0b4dc9f331..5127ed827f9 100644
--- a/regress/sys/net/pf_fragment/frag6_cutnew.py
+++ b/regress/sys/net/pf_fragment/frag6_cutnew.py
@@ -37,6 +37,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt1)
sniffer = Sniff1();
sniffer.filter = "ip6 and src %s and dst %s and icmp6" % (dstaddr, SRC_OUT6)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag6_cutold.py b/regress/sys/net/pf_fragment/frag6_cutold.py
index 5822b2369fc..ae72575b3af 100644
--- a/regress/sys/net/pf_fragment/frag6_cutold.py
+++ b/regress/sys/net/pf_fragment/frag6_cutold.py
@@ -37,6 +37,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt0)
sniffer = Sniff1();
sniffer.filter = "ip6 and src %s and dst %s and icmp6" % (dstaddr, SRC_OUT6)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag6_dropnew.py b/regress/sys/net/pf_fragment/frag6_dropnew.py
index 37164707d10..e3078d94263 100644
--- a/regress/sys/net/pf_fragment/frag6_dropnew.py
+++ b/regress/sys/net/pf_fragment/frag6_dropnew.py
@@ -41,6 +41,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt0)
sniffer = Sniff1();
sniffer.filter = "ip6 and src %s and dst %s and icmp6" % (dstaddr, SRC_OUT6)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag6_dropold.py b/regress/sys/net/pf_fragment/frag6_dropold.py
index f2e847adec5..152c980c7c9 100644
--- a/regress/sys/net/pf_fragment/frag6_dropold.py
+++ b/regress/sys/net/pf_fragment/frag6_dropold.py
@@ -41,6 +41,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt2)
sniffer = Sniff1();
sniffer.filter = "ip6 and src %s and dst %s and icmp6" % (dstaddr, SRC_OUT6)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag6_ext.py b/regress/sys/net/pf_fragment/frag6_ext.py
index 21f1d1cf1f5..62abc2a350d 100644
--- a/regress/sys/net/pf_fragment/frag6_ext.py
+++ b/regress/sys/net/pf_fragment/frag6_ext.py
@@ -31,6 +31,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt1)
sniffer = Sniff1();
sniffer.filter = "ip6 and src %s and dst %s and icmp6" % (dstaddr, SRC_OUT6)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag_cutnew.py b/regress/sys/net/pf_fragment/frag_cutnew.py
index 3a36dd9e42c..fbbceecd019 100644
--- a/regress/sys/net/pf_fragment/frag_cutnew.py
+++ b/regress/sys/net/pf_fragment/frag_cutnew.py
@@ -40,6 +40,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt1)
sniffer = Sniff1();
sniffer.filter = "ip and src %s and dst %s and icmp" % (dstaddr, SRC_OUT)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag_cutold.py b/regress/sys/net/pf_fragment/frag_cutold.py
index c43ba45dac3..9dcfecde6ea 100644
--- a/regress/sys/net/pf_fragment/frag_cutold.py
+++ b/regress/sys/net/pf_fragment/frag_cutold.py
@@ -41,6 +41,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt0)
sniffer = Sniff1();
sniffer.filter = "ip and src %s and dst %s and icmp" % (dstaddr, SRC_OUT)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag_dropnew.py b/regress/sys/net/pf_fragment/frag_dropnew.py
index f26743f69b6..f7466fbf0cf 100644
--- a/regress/sys/net/pf_fragment/frag_dropnew.py
+++ b/regress/sys/net/pf_fragment/frag_dropnew.py
@@ -45,6 +45,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt0)
sniffer = Sniff1();
sniffer.filter = "ip and src %s and dst %s and icmp" % (dstaddr, SRC_OUT)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/frag_dropold.py b/regress/sys/net/pf_fragment/frag_dropold.py
index cbe17d162fe..fd03b09f117 100644
--- a/regress/sys/net/pf_fragment/frag_dropold.py
+++ b/regress/sys/net/pf_fragment/frag_dropold.py
@@ -45,6 +45,7 @@ eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt2)
sniffer = Sniff1();
sniffer.filter = "ip and src %s and dst %s and icmp" % (dstaddr, SRC_OUT)
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_fragment/ping6_mtu_1300.py b/regress/sys/net/pf_fragment/ping6_mtu_1300.py
index 1a038224a59..a6550686cfe 100644
--- a/regress/sys/net/pf_fragment/ping6_mtu_1300.py
+++ b/regress/sys/net/pf_fragment/ping6_mtu_1300.py
@@ -28,6 +28,7 @@ eth=Ether(src=SRC_MAC, dst=PF_MAC)/ip
sniffer = Sniff1();
sniffer.filter = "ip6 and dst %s and icmp6" % SRC_OUT6
sniffer.start()
+time.sleep(1)
sendp(eth, iface=SRC_IF)
sniffer.join(timeout=5)
a = sniffer.packet
diff --git a/regress/sys/net/pf_state/challenge_ack.py b/regress/sys/net/pf_state/challenge_ack.py
index 4140686f907..322385fb23f 100644
--- a/regress/sys/net/pf_state/challenge_ack.py
+++ b/regress/sys/net/pf_state/challenge_ack.py
@@ -40,12 +40,12 @@ print "Connection is established, send bogus SYN, expect challenge ACK"
bogus_syn=TCP(sport=fake_port, dport='echo', seq=1000000, flags='S',
window=(2**16)-1)
sniffer = Sniff1();
-sniffer.filter= "src %s and tcp port echo and dst %s and tcp port %u " \
+sniffer.filter = "src %s and tcp port echo and dst %s and tcp port %u " \
"and tcp[tcpflags] = tcp-ack" % (REMOTE_ADDR, FAKE_NET_ADDR, fake_port)
sniffer.start()
+time.sleep(1)
send(ip/bogus_syn, iface=LOCAL_IF)
sniffer.join(timeout=7)
-
challenge_ack = sniffer.packet
if challenge_ack is None: