X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_gre.py;h=858d9436384e32d25b1cf7bee8a4c92807fc169a;hb=4b2946a884c1ffbce022c8121c6889ff39f242e1;hp=e73ba2f99a626d2ba96b2fee0691f6c1944ff116;hpb=e5b94dded0dfd7258d5fd0f4ef897d9ccb48715b;p=vpp.git diff --git a/test/test_gre.py b/test/test_gre.py index e73ba2f99a6..858d9436384 100644 --- a/test/test_gre.py +++ b/test/test_gre.py @@ -12,7 +12,7 @@ from scapy.volatile import RandMAC, RandIP from framework import VppTestCase, VppTestRunner from vpp_sub_interface import L2_VTR_OP, VppDot1QSubint from vpp_gre_interface import VppGreInterface -from vpp_nhrp import VppNhrp +from vpp_teib import VppTeib from vpp_ip import DpoProto from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable, FibPathProto from util import ppp, ppc @@ -48,7 +48,7 @@ class TestGREInputNodes(VppTestCase): self.pg_start() # no tunnel created, gre-input not registered err = self.statistics.get_counter( - '/err/ip4-input/unknown ip protocol')[0] + '/err/ip4-local/unknown ip protocol')[0] self.assertEqual(err, 1) err_count = err @@ -60,7 +60,7 @@ class TestGREInputNodes(VppTestCase): self.pg_start() # tunnel created, gre-input registered err = self.statistics.get_counter( - '/err/ip4-input/unknown ip protocol')[0] + '/err/ip4-local/unknown ip protocol')[0] # expect no new errors self.assertEqual(err, err_count) @@ -244,6 +244,7 @@ class TestGRE(VppTestCase): self.assertEqual(rx_ip.src, tunnel_src) self.assertEqual(rx_ip.dst, tunnel_dst) self.assertEqual(rx_ip.tos, tos) + self.assertEqual(rx_ip.len, len(rx_ip)) rx_gre = rx[GRE] rx_ip = rx_gre[IP] @@ -278,6 +279,9 @@ class TestGRE(VppTestCase): self.assertEqual(rx_ip.tc, tc) rx_gre = GRE(scapy.compat.raw(rx_ip[IPv6].payload)) + + self.assertEqual(rx_ip.plen, len(rx_gre)) + rx_ip = rx_gre[IPv6] self.assertEqual(rx_ip.src, tx_ip.src) @@ -304,6 +308,9 @@ class TestGRE(VppTestCase): self.assertEqual(rx_ip.dst, tunnel_dst) rx_gre = GRE(scapy.compat.raw(rx_ip[IPv6].payload)) + + self.assertEqual(rx_ip.plen, len(rx_gre)) + tx_ip = tx[IP] rx_ip = rx_gre[IP] @@ -329,6 +336,7 @@ class TestGRE(VppTestCase): self.assertEqual(rx_ip.src, tunnel_src) self.assertEqual(rx_ip.dst, tunnel_dst) + self.assertEqual(rx_ip.len, len(rx_ip)) rx_gre = GRE(scapy.compat.raw(rx_ip[IP].payload)) rx_ip = rx_gre[IPv6] @@ -356,6 +364,7 @@ class TestGRE(VppTestCase): self.assertEqual(rx_ip.src, tunnel_src) self.assertEqual(rx_ip.dst, tunnel_dst) + self.assertEqual(rx_ip.len, len(rx_ip)) rx_gre = rx[GRE] rx_l2 = rx_gre[Ether] @@ -1067,12 +1076,12 @@ class TestGRE(VppTestCase): route_via_tun.add_vpp_config() # - # Add a NHRP entry resolves the peer + # Add a TEIB entry resolves the peer # - nhrp = VppNhrp(self, gre_if, + teib = VppTeib(self, gre_if, gre_if._remote_hosts[ii].ip4, itf._remote_hosts[ii].ip4) - nhrp.add_vpp_config() + teib.add_vpp_config() # # Send a packet stream that is routed into the tunnel @@ -1093,13 +1102,13 @@ class TestGRE(VppTestCase): self.verify_decapped_4o4(self.pg0, rx, tx_i) # - # delete and re-add the NHRP + # delete and re-add the TEIB # - nhrp.remove_vpp_config() + teib.remove_vpp_config() self.send_and_assert_no_replies(self.pg0, tx_e) self.send_and_assert_no_replies(self.pg0, tx_i) - nhrp.add_vpp_config() + teib.add_vpp_config() rx = self.send_and_expect(self.pg0, tx_e, itf) self.verify_tunneled_4o4(self.pg0, rx, tx_e, itf.local_ip4, @@ -1152,12 +1161,12 @@ class TestGRE(VppTestCase): route_addr = "4::%d" % ii # - # Add a NHRP entry resolves the peer + # Add a TEIB entry resolves the peer # - nhrp = VppNhrp(self, gre_if, + teib = VppTeib(self, gre_if, gre_if._remote_hosts[ii].ip6, itf._remote_hosts[ii].ip6) - nhrp.add_vpp_config() + teib.add_vpp_config() # # route traffic via the peer @@ -1188,12 +1197,12 @@ class TestGRE(VppTestCase): self.verify_decapped_6o6(self.pg0, rx, tx_i) # - # delete and re-add the NHRP + # delete and re-add the TEIB # - nhrp.remove_vpp_config() + teib.remove_vpp_config() self.send_and_assert_no_replies(self.pg0, tx_e) - nhrp.add_vpp_config() + teib.add_vpp_config() rx = self.send_and_expect(self.pg0, tx_e, itf) self.verify_tunneled_6o6(self.pg0, rx, tx_e, itf.local_ip6,