#!/usr/bin/env python
-import random
-import socket
import unittest
from framework import VppTestCase, VppTestRunner
-from vpp_sub_interface import VppSubInterface, VppDot1QSubint
-from vpp_ip_route import VppIpRoute, VppRoutePath, DpoProto, VppIpMRoute, \
- VppMRoutePath, MRouteEntryFlags, MRouteItfFlags
+from vpp_sub_interface import VppDot1QSubint
+from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_papi_provider import L2_VTR_OP
from scapy.packet import Raw
-from scapy.layers.l2 import Ether, Dot1Q, ARP
+from scapy.layers.l2 import Ether, Dot1Q
from scapy.layers.inet import IP, UDP
-from util import ppp
from socket import AF_INET, inet_pton
super(TestDVR, self).setUp()
self.create_pg_interfaces(range(4))
- self.create_loopback_interfaces(range(1))
+ self.create_loopback_interfaces(1)
for i in self.pg_interfaces:
i.admin_up()
self.vapi.sw_interface_set_l2_bridge(self.loop0.sw_if_index,
1, bvi=1, enable=0)
+ #
+ # Do a FIB dump to make sure the paths are correctly reported as DVR
+ #
+ routes = self.vapi.ip_fib_dump()
+
+ for r in routes:
+ if (inet_pton(AF_INET, ip_tag_bridged) == r.address):
+ self.assertEqual(r.path[0].sw_if_index,
+ sub_if_on_pg3.sw_if_index)
+ self.assertEqual(r.path[0].is_dvr, 1)
+ if (inet_pton(AF_INET, ip_non_tag_bridged) == r.address):
+ self.assertEqual(r.path[0].sw_if_index,
+ self.pg1.sw_if_index)
+ self.assertEqual(r.path[0].is_dvr, 1)
+
#
# the explicit route delete is require so it happens before
# the sbu-interface delete. subinterface delete is required
route_2.add_vpp_config()
#
- # packets are dropped because bridge does not flood unkown unicast
+ # packets are dropped because bridge does not flood unknown unicast
#
self.send_and_assert_no_replies(self.pg0, pkt_no_tag)