+ def add_del_shared_mcast_dst_load(cls, is_add):
+ """
+ add or del tunnels sharing the same mcast dst
+ to test vxlan ref_count mechanism
+ """
+ n_shared_dst_tunnels = 20
+ vni_start = 10000
+ vni_end = vni_start + n_shared_dst_tunnels
+ for vni in range(vni_start, vni_end):
+ r = cls.vapi.vxlan_add_del_tunnel(src_address=cls.pg0.local_ip4n,
+ dst_address=cls.mcast_ip4n,
+ mcast_sw_if_index=1,
+ is_add=is_add, vni=vni)
+ if r.sw_if_index == 0xffffffff:
+ raise ValueError("bad sw_if_index: ~0")
+
+ @classmethod
+ def add_shared_mcast_dst_load(cls):
+ cls.add_del_shared_mcast_dst_load(is_add=1)
+
+ @classmethod
+ def del_shared_mcast_dst_load(cls):
+ cls.add_del_shared_mcast_dst_load(is_add=0)
+
+ @classmethod
+ def add_del_mcast_tunnels_load(cls, is_add):
+ """
+ add or del tunnels to test vxlan stability
+ """
+ n_distinct_dst_tunnels = 200