aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_mpls.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_mpls.py')
-rw-r--r--test/test_mpls.py77
1 files changed, 73 insertions, 4 deletions
diff --git a/test/test_mpls.py b/test/test_mpls.py
index d0c9e249a05..77cec429f5a 100644
--- a/test/test_mpls.py
+++ b/test/test_mpls.py
@@ -102,7 +102,10 @@ class TestMPLS(VppTestCase):
pkts.append(p)
return pkts
- def create_stream_labelled_ip6(self, src_if, mpls_label, mpls_ttl):
+ def create_stream_labelled_ip6(self, src_if, mpls_label, mpls_ttl,
+ dst_ip=None):
+ if dst_ip is None:
+ dst_ip = src_if.remote_ip6
self.reset_packet_infos()
pkts = []
for i in range(0, 257):
@@ -110,7 +113,7 @@ class TestMPLS(VppTestCase):
payload = self.info_to_payload(info)
p = (Ether(dst=src_if.local_mac, src=src_if.remote_mac) /
MPLS(label=mpls_label, ttl=mpls_ttl) /
- IPv6(src=src_if.remote_ip6, dst=src_if.remote_ip6) /
+ IPv6(src=src_if.remote_ip6, dst=dst_ip) /
UDP(sport=1234, dport=1234) /
Raw(payload))
info.data = p.copy()
@@ -928,8 +931,8 @@ class TestMPLS(VppTestCase):
rx = self.pg3.get_capture(257)
self.verify_capture_tunneled_ip4(self.pg0, rx, tx, [43])
- def test_mcast_tail(self):
- """ MPLS Multicast Tail """
+ def test_mcast_ip4_tail(self):
+ """ MPLS IPv4 Multicast Tail """
#
# Add a multicast route that will forward the traffic
@@ -994,6 +997,72 @@ class TestMPLS(VppTestCase):
dst_ip="232.1.1.1")
self.send_and_assert_no_replies(self.pg0, tx, "RPF-ID drop 56")
+ def test_mcast_ip6_tail(self):
+ """ MPLS IPv6 Multicast Tail """
+
+ #
+ # Add a multicast route that will forward the traffic
+ # post-disposition
+ #
+ route_ff = VppIpMRoute(
+ self,
+ "::",
+ "ff01::1", 32,
+ MRouteEntryFlags.MFIB_ENTRY_FLAG_NONE,
+ table_id=1,
+ paths=[VppMRoutePath(self.pg1.sw_if_index,
+ MRouteItfFlags.MFIB_ITF_FLAG_FORWARD)],
+ is_ip6=1)
+ route_ff.add_vpp_config()
+
+ #
+ # An interface receive label that maps traffic to RX on interface
+ # pg1
+ # by injecting the packet in on pg0, which is in table 0
+ # doing an rpf-id and matching a route in table 1
+ # if the packet egresses, then we must have matched the route in
+ # table 1
+ #
+ route_34_eos = VppMplsRoute(
+ self, 34, 1,
+ [VppRoutePath("::",
+ self.pg1.sw_if_index,
+ nh_table_id=1,
+ rpf_id=55,
+ is_ip6=1)],
+ is_multicast=1)
+
+ route_34_eos.add_vpp_config()
+
+ #
+ # Drop due to interface lookup miss
+ #
+ tx = self.create_stream_labelled_ip6(self.pg0, [34], 255,
+ dst_ip="ff01::1")
+
+ #
+ # set the RPF-ID of the enrtry to match the input packet's
+ #
+ route_ff.update_rpf_id(55)
+
+ tx = self.create_stream_labelled_ip6(self.pg0, [34], 255,
+ dst_ip="ff01::1")
+ self.pg0.add_stream(tx)
+
+ self.pg_enable_capture(self.pg_interfaces)
+ self.pg_start()
+
+ rx = self.pg1.get_capture(257)
+ self.verify_capture_ip6(self.pg1, rx, tx)
+
+ #
+ # set the RPF-ID of the enrtry to not match the input packet's
+ #
+ route_ff.update_rpf_id(56)
+ tx = self.create_stream_labelled_ip6(self.pg0, [34], 225,
+ dst_ip="ff01::1")
+ self.send_and_assert_no_replies(self.pg0, tx, "RPF-ID drop 56")
+
class TestMPLSDisabled(VppTestCase):
""" MPLS disabled """