aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_gre.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2016-12-18 15:49:54 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-19 21:33:42 +0000
commit65cc8c0dbf04f2418200e682caeae9c1e7396e10 (patch)
tree2ab9014753fd24cd197a3c52d7fb00cc2959315b /test/test_gre.py
parent72d0916b82901496bed2f0cebf0cfc9968d239d4 (diff)
make test: filter IPv6 RAs out by default
Most of the test cases are not interested in IPv6 Router Alerts, so change the default behaviour of get_capture to filter out these packets with the possibility of turning the filtering off, for test cases which are interested in the RAs. Change-Id: I0b5ee685f82c49cd32c6d6a4638eb3493d2988fc Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/test_gre.py')
-rw-r--r--test/test_gre.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/test/test_gre.py b/test/test_gre.py
index 59d03e9307e..f00e4467910 100644
--- a/test/test_gre.py
+++ b/test/test_gre.py
@@ -12,7 +12,7 @@ from vpp_papi_provider import L2_VTR_OP
from scapy.packet import Raw
from scapy.layers.l2 import Ether, Dot1Q, GRE
from scapy.layers.inet import IP, UDP
-from scapy.layers.inet6 import ICMPv6ND_RA, IPv6
+from scapy.layers.inet6 import IPv6
from scapy.volatile import RandMAC, RandIP
from util import ppp, ppc
@@ -129,18 +129,9 @@ class TestGRE(VppTestCase):
pkts.append(p)
return pkts
- def verify_filter(self, capture, sent):
- if not len(capture) == len(sent):
- # filter out any IPv6 RAs from the capture
- for p in capture:
- if (p.haslayer(ICMPv6ND_RA)):
- capture.remove(p)
- return capture
-
def verify_tunneled_4o4(self, src_if, capture, sent,
tunnel_src, tunnel_dst):
- capture = self.verify_filter(capture, sent)
self.assertEqual(len(capture), len(sent))
for i in range(len(capture)):
@@ -169,7 +160,6 @@ class TestGRE(VppTestCase):
def verify_tunneled_l2o4(self, src_if, capture, sent,
tunnel_src, tunnel_dst):
- capture = self.verify_filter(capture, sent)
self.assertEqual(len(capture), len(sent))
for i in range(len(capture)):
@@ -203,7 +193,6 @@ class TestGRE(VppTestCase):
def verify_tunneled_vlano4(self, src_if, capture, sent,
tunnel_src, tunnel_dst, vlan):
try:
- capture = self.verify_filter(capture, sent)
self.assertEqual(len(capture), len(sent))
except:
ppc("Unexpected packets captured:", capture)
@@ -242,7 +231,6 @@ class TestGRE(VppTestCase):
raise
def verify_decapped_4o4(self, src_if, capture, sent):
- capture = self.verify_filter(capture, sent)
self.assertEqual(len(capture), len(sent))
for i in range(len(capture)):
@@ -266,7 +254,6 @@ class TestGRE(VppTestCase):
raise
def verify_decapped_6o4(self, src_if, capture, sent):
- capture = self.verify_filter(capture, sent)
self.assertEqual(len(capture), len(sent))
for i in range(len(capture)):