from scapy.layers.inet6 import IPv6, Ether, IP, UDP
from scapy.all import fragment, RandShort
from framework import VppTestCase, VppTestRunner
-from vpp_ip_route import VppIpRoute, VppRoutePath, DpoProto
+from vpp_ip import DpoProto
+from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable
from socket import AF_INET, AF_INET6, inet_pton
import StringIO
for p in rx:
self.validate(p[1], p4_reply)
+ err = self.statistics.get_counter(
+ '/err/ipip4-input/packets decapsulated')
+ self.assertEqual(err, 10)
+
# IPv4 tunnel to IPv6
p_ip6 = IPv6(src="1:2:3::4", dst=self.pg0.remote_ip6)
p6 = (p_ether / IP(src=self.pg1.remote_ip4,
for p in rx:
self.validate(p[1], p6_reply)
+ err = self.statistics.get_counter(
+ '/err/ipip4-input/packets decapsulated')
+ self.assertEqual(err, 20)
+
#
# Fragmentation / Reassembly and Re-fragmentation
#
for p in rx:
self.validate(p[1], p4_reply)
+ err = self.statistics.get_counter(
+ '/err/ipip4-input/packets decapsulated')
+ self.assertEqual(err, 1020)
+
f = []
r = []
for i in range(1, 90):
sw_if_index = rv.sw_if_index
self.vapi.ipip_del_tunnel(sw_if_index)
+ def test_ipip_vrf_create(self):
+ """ ipip create / delete interface VRF test """
+
+ t = VppIpTable(self, 20)
+ t.add_vpp_config()
+ rv = self.vapi.ipip_add_tunnel(
+ src_address=inet_pton(AF_INET, '1.2.3.4'),
+ dst_address=inet_pton(AF_INET, '2.3.4.5'), is_ipv6=0,
+ table_id=20)
+ sw_if_index = rv.sw_if_index
+ self.vapi.ipip_del_tunnel(sw_if_index)
+
def payload(self, len):
return 'x' * len