@classmethod
def setUpClass(cls):
    super(TestGtpu, cls).setUpClass()
    try:
        cls.dport = 2152
        cls.gtp_type = 255
        cls.create_pg_interfaces(range(4))
        for pg in cls.pg_interfaces:
            pg.admin_up()
        cls.pg0.config_ip4()
        cls.pg0.resolve_arp()
        cls.mcast_ip4 = '0.0.0.0'
        cls.mcast_mac = util.mcast_ip_to_mac(cls.mcast_ip4)
        cls.single_tunnel_bd = 11
        cls.single_tunnel_vni = 11
        r = cls.vapi.gtpu_add_del_tunnel(is_add=True, mcast_sw_if_index=4294967295, decap_next_index=4294967295, src_address=cls.pg0.local_ip4, dst_address=cls.pg0.remote_ip4, teid=cls.single_tunnel_vni)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, bd_id=cls.single_tunnel_bd)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=cls.pg1.sw_if_index, bd_id=cls.single_tunnel_bd)
        cls.n_ucast_tunnels = 10
        cls.mcast_flood_bd = 12
        cls.create_gtpu_flood_test_bd(cls.mcast_flood_bd, cls.n_ucast_tunnels)
        r = cls.vapi.gtpu_add_del_tunnel(is_add=True, src_address=cls.pg0.local_ip4, dst_address=cls.mcast_ip4, mcast_sw_if_index=1, decap_next_index=4294967295, teid=cls.mcast_flood_bd)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, bd_id=cls.mcast_flood_bd)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=cls.pg2.sw_if_index, bd_id=cls.mcast_flood_bd)
        cls.add_shared_mcast_dst_load()
        cls.add_mcast_tunnels_load()
        cls.del_shared_mcast_dst_load()
        cls.del_mcast_tunnels_load()
        cls.ucast_flood_bd = 13
        cls.create_gtpu_flood_test_bd(cls.ucast_flood_bd, cls.n_ucast_tunnels)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=cls.pg3.sw_if_index, bd_id=cls.ucast_flood_bd)
    except Exception:
        super(TestGtpu, cls).tearDownClass()
        raise
@classmethod
def setUpClass(cls):
    super(TestGtpu, cls).setUpClass()
    try:
        cls.dport = 2152
        cls.gtp_type = 255
        cls.create_pg_interfaces(range(4))
        for pg in cls.pg_interfaces:
            pg.admin_up()
        cls.pg0.config_ip4()
        cls.pg0.resolve_arp()
        cls.mcast_ip4 = '0.0.0.0'
        cls.mcast_mac = util.mcast_ip_to_mac(cls.mcast_ip4)
        cls.single_tunnel_bd = 11
        cls.single_tunnel_vni = 11
        r = cls.vapi.gtpu_add_del_tunnel(is_add=True, mcast_sw_if_index=4294967295, decap_next_index=4294967295, src_address=cls.pg0.local_ip4, dst_address=cls.pg0.remote_ip4, teid=cls.single_tunnel_vni)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, bd_id=cls.single_tunnel_bd)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=cls.pg1.sw_if_index, bd_id=cls.single_tunnel_bd)
        cls.n_ucast_tunnels = 10
        cls.mcast_flood_bd = 12
        cls.create_gtpu_flood_test_bd(cls.mcast_flood_bd, cls.n_ucast_tunnels)
        r = cls.vapi.gtpu_add_del_tunnel(is_add=True, src_address=cls.pg0.local_ip4, dst_address=cls.mcast_ip4, mcast_sw_if_index=1, decap_next_index=4294967295, teid=cls.mcast_flood_bd)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index, bd_id=cls.mcast_flood_bd)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=cls.pg2.sw_if_index, bd_id=cls.mcast_flood_bd)
        cls.add_shared_mcast_dst_load()
        cls.add_mcast_tunnels_load()
        cls.del_shared_mcast_dst_load()
        cls.del_mcast_tunnels_load()
        cls.ucast_flood_bd = 13
        cls.create_gtpu_flood_test_bd(cls.ucast_flood_bd, cls.n_ucast_tunnels)
        cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=cls.pg3.sw_if_index, bd_id=cls.ucast_flood_bd)
    except Exception:
        super(TestGtpu, cls).tearDownClass()
        raise