- self.vapi.sw_interface_set_l2_bridge(self.pg0.sw_if_index, 1,
- enable=0)
- self.vapi.sw_interface_set_l2_bridge(self.pg1.sw_if_index, 1,
- enable=0)
- self.vapi.sw_interface_set_l2_bridge(sub_if_on_pg2.sw_if_index,
- 1, enable=0)
- self.vapi.sw_interface_set_l2_bridge(sub_if_on_pg3.sw_if_index,
- 1, enable=0)
- self.vapi.sw_interface_set_l2_bridge(self.loop0.sw_if_index,
- 1, bvi=1, enable=0)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=self.pg0.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)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=sub_if_on_pg2.sw_if_index, bd_id=1, enable=0)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=sub_if_on_pg3.sw_if_index, bd_id=1, enable=0)
+ self.vapi.sw_interface_set_l2_bridge(
+ rx_sw_if_index=self.loop0.sw_if_index, bd_id=1,
+ port_type=L2_PORT_TYPE.BVI, enable=0)
+
+ #
+ # Do a FIB dump to make sure the paths are correctly reported as DVR
+ #
+ routes = self.vapi.ip_route_dump(0)
+
+ for r in routes:
+ if (ip_tag_bridged == str(r.route.prefix.network_address)):
+ self.assertEqual(r.route.paths[0].sw_if_index,
+ sub_if_on_pg3.sw_if_index)
+ self.assertEqual(r.route.paths[0].type,
+ FibPathType.FIB_PATH_TYPE_DVR)
+ if (ip_non_tag_bridged == str(r.route.prefix.network_address)):
+ self.assertEqual(r.route.paths[0].sw_if_index,
+ self.pg1.sw_if_index)
+ self.assertEqual(r.route.paths[0].type,
+ FibPathType.FIB_PATH_TYPE_DVR)