from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsRoute, \
VppMplsIpBind, VppIpMRoute, VppMRoutePath, \
MRouteItfFlags, MRouteEntryFlags, VppIpTable, VppMplsTable, \
- VppMplsLabel, MplsLspMode
+ VppMplsLabel, MplsLspMode, find_mpls_route
from vpp_mpls_tunnel_interface import VppMPLSTunnelInterface
+import scapy.compat
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, UDP, ICMP
# ICMP sourced from the interface's address
self.assertEqual(rx_ip.src, src_if.local_ip6)
# hop-limit reset to 255 for IMCP packet
- self.assertEqual(rx_ip.hlim, 254)
+ self.assertEqual(rx_ip.hlim, 255)
icmp = rx[ICMPv6TimeExceeded]
labels=[VppMplsLabel(33)])])
route_32_eos.add_vpp_config()
+ self.assertTrue(
+ find_mpls_route(self, 0, 32, 1,
+ [VppRoutePath(self.pg0.remote_ip4,
+ self.pg0.sw_if_index,
+ labels=[VppMplsLabel(33)])]))
+
#
# a stream that matches the route for 10.0.0.1
# PG0 is in the default table
verify_mpls_stack(self, rx, mpls_labels)
tx_eth = tx[Ether]
- rx_eth = Ether(str(rx[MPLS].payload))
+ rx_eth = Ether(scapy.compat.raw(rx[MPLS].payload))
self.assertEqual(rx_eth.src, tx_eth.src)
self.assertEqual(rx_eth.dst, tx_eth.dst)
#
# add to tunnel to the customers bridge-domain
#
- self.vapi.sw_interface_set_l2_bridge(mpls_tun.sw_if_index,
- bd_id=1)
- self.vapi.sw_interface_set_l2_bridge(self.pg1.sw_if_index,
- bd_id=1)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=mpls_tun.sw_if_index, bd_id=1)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=self.pg1.sw_if_index, bd_id=1)
#
# Packet from the customer interface and from the core
#
# remove interfaces from customers bridge-domain
#
- self.vapi.sw_interface_set_l2_bridge(mpls_tun.sw_if_index,
- bd_id=1,
- enable=0)
- self.vapi.sw_interface_set_l2_bridge(self.pg1.sw_if_index,
- bd_id=1,
- enable=0)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=mpls_tun.sw_if_index, bd_id=1, enable=0)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=self.pg1.sw_if_index, bd_id=1, enable=0)
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)