diff options
author | Klement Sekera <ksekera@cisco.com> | 2019-10-01 13:00:22 +0000 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-10-09 12:53:44 +0000 |
commit | 7b2e9fb1a8f389fa7b88fcbaf3356cbdae254250 (patch) | |
tree | 2ef293fd777c7260f3f3fdbc7315a460c5ce35aa /src/plugins/map/test | |
parent | d5262831a3379afc77cab9a16067765585dd5175 (diff) |
map: use ip6-full-reassembly instead of own code
Remove map's implementation of reassembly and use common
ip6-full-reassembly functionality. This makes it easier to maintain by
removing duplicate code/functionality.
Type: refactor
Change-Id: I430e888b704e28c100a9ce075d1460cb529e4676
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src/plugins/map/test')
-rw-r--r-- | src/plugins/map/test/test_map.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/plugins/map/test/test_map.py b/src/plugins/map/test/test_map.py index 368cf51092d..5549d9f0751 100644 --- a/src/plugins/map/test/test_map.py +++ b/src/plugins/map/test/test_map.py @@ -7,7 +7,7 @@ from ipaddress import IPv6Network, IPv4Network from framework import VppTestCase, VppTestRunner from vpp_ip import DpoProto from vpp_ip_route import VppIpRoute, VppRoutePath -from util import fragment_rfc791 +from util import fragment_rfc791, fragment_rfc8200 import scapy.compat from scapy.layers.l2 import Ether, Raw @@ -232,6 +232,29 @@ class TestMAP(VppTestCase): self.assertEqual(r[IP].src, p[IP].src) self.assertEqual(r[IP].dst, p[IP].dst) + # Verify that fragments pass even if ipv6 layer is fragmented + stream = (IPv6(dst='3000::1', src=map_translated_addr) / x + for x in frags) + + v6_stream = [ + Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) / x + for i in range(len(frags)) + for x in fragment_rfc8200( + IPv6(dst='3000::1', src=map_translated_addr) / frags[i], + i, 200)] + + self.pg1.add_stream(v6_stream) + + self.pg_enable_capture(self.pg_interfaces) + self.pg_start() + + rx = self.pg0.get_capture(len(frags)) + + for r in rx: + self.assertFalse(r.haslayer(IPv6)) + self.assertEqual(r[IP].src, p[IP].src) + self.assertEqual(r[IP].dst, p[IP].dst) + # # Pre-resolve. No API for this!! # |