Repository: open-traffic-generator/snappi-ixnetwork (language: python)

Issue:
Add UTs for BGP EVPN 
Add UTs for BGP EVPN 


Discussion / hints:

Fix patch:
diff --git a/setup.py b/setup.py
index 69eebcc22..419962db3 100644
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,7 @@
     install_requires=["ixnetwork-restpy>=1.0.52"],
     extras_require={
         "testing": [
-            "snappi==0.7.33",
+            "snappi==0.7.38",
             "snappi_convergence==0.2.3",
             "pytest",
             "mock",
diff --git a/snappi_ixnetwork/device/base.py b/snappi_ixnetwork/device/base.py
index 9391c13a4..545946bea 100644
--- a/snappi_ixnetwork/device/base.py
+++ b/snappi_ixnetwork/device/base.py
@@ -1,5 +1,5 @@
-__all__ = ['Base', 'MultiValue', 'PostCalculated']
 
+__all__ = ['Base', 'MultiValue', 'PostCalculated']
 
 
 class MultiValue(object):
@@ -53,8 +53,7 @@ def create_node_elemet(self, ixn_obj, node_name, name=None):
         return self.add_element(node, name)
 
     def create_property(self, ixn_obj, name):
-        ixn_obj[name] = dict()
-        ixn_property = ixn_obj[name]
+        ixn_property = ixn_obj[name] = dict()
         ixn_property["xpath"] = ""
         return ixn_property
 
@@ -93,9 +92,186 @@ def configure_multivalues(self, snappi_obj, ixn_obj, attr_map):
                     raise NameError("ixn_attr is missing within ", ixn_map)
                 enum_map = ixn_map.get("enum_map")
                 value = snappi_obj.get(snappi_attr)
+                if value is None:
+                    # We need to specify product default if model not specify
+                    default_value = ixn_map.get("default_value")
+                    if default_value is None:
+                        raise NameError("Please specify default_value for ",
+                                        snappi_attr)
+                    value = default_value
                 if enum_map is not None and value is not None:
                     value = enum_map[value]
             else:
                 ixn_attr = ixn_map
                 value = snappi_obj.get(snappi_attr)
-            ixn_obj[ixn_attr] = self.multivalue(value)
\ No newline at end of file
+            ixn_obj[ixn_attr] = self.multivalue(value)
+
+    def get_symmetric_nodes(self, parent_list, node_name):
+        nodes_list = []
+        max_len = 0
+        for parent in parent_list:
+            nodes = getattr(parent, node_name)
+            node_len = len(nodes)
+            if node_len > max_len:
+                max_len = node_len
+            nodes_list.append(nodes)
+        symmetric_nodes = []
+        active_list = []
+        for nodes in nodes_list:
+            if len(nodes) == max_len:
+                active_list.extend([True] * max_len)
+                symmetric_nodes.extend(nodes)
+            else:
+                for index in range(0, max_len):
+                    node = nodes[0]
+                    if index < len(nodes):
+                        node = nodes[index]
+                        active_list.append(node.active)
+                        symmetric_nodes.append(node)
+                    else:
+                        active_list.append(False)
+                        symmetric_nodes.append(node)
+        return NodesInfo(max_len, active_list, symmetric_nodes)
+
+
+class NodesInfo(object):
+    def __init__(self, max_len, active_list, symmetric_nodes):
+        self._base = Base()
+        self._max_len = max_len
+        self._active_list = active_list
+        self._symmetric_nodes = symmetric_nodes
+
+    @property
+    def max_len(self):
+        return self._max_len
+
+    @property
+    def active_list(self):
+        return self._active_list
+
+    @property
+    def symmetric_nodes(self):
+        return self._symmetric_nodes
+
+    @property
+    def is_all_null(self):
+        for node in self._symmetric_nodes:
+            if node is not None:
+                return False
+        return True
+
+    def get_values(self, attr_name, enum_map=None, default=None):
+        """This will extract values from NodesInfo object.
+        It will set default value if value is None and have some default
+        Otherwise raise error"""
+        values = []
+        for node in self._symmetric_nodes:
+            value = node.get(attr_name)
+            if value is None:
+                if default is None:
+                    raise NameError("Please specify default_value for ",
+                                    attr_name)
+                value = default
+            if enum_map is not None:
+                value = enum_map[value]
+            values.append(value)
+        return values
+
+    def get_multivalues(self, attr_name, enum_map=None, default=None):
+        return self._base.multivalue(self.get_values(
+            attr_name, enum_map=enum_map, default=default
+        ))
+
+    def config_values(self, ixn_obj, attr_map):
+        for snappi_attr, ixn_map in attr_map.items():
+            if isinstance(ixn_map, dict):
+                ixn_attr = ixn_map.get("ixn_attr")
+                if ixn_attr is None:
+                    raise NameError("ixn_attr is missing within ", ixn_map)
+                enum_map = ixn_map.get("enum_map")
+                values = self.get_multivalues(
+                    snappi_attr, enum_map=enum_map, default=ixn_map.get(
+                        "default_value"
+                    )
+                )
+            else:
+                ixn_attr = ixn_map
+                values = self.get_multivalues(snappi_attr)
+            ixn_obj[ixn_attr] = values
+
+    def get_tab(self, tab_name):
+        dummy_value = None
+        tab_nodes = []
+        for node in self._symmetric_nodes:
+            tab_node = node.get(tab_name)
+            if tab_node is not None:
+                dummy_value = tab_node
+            tab_nodes.append(tab_node)
+
+        for idx, tab_node in enumerate(tab_nodes):
+            if tab_node is None and dummy_value is not None:
+                tab_nodes[idx] = dummy_value
+
+        return NodesInfo(
+            self._max_len,
+            self._active_list,
+            tab_nodes
+        )
+
+    def get_symmetric_nodes(self, node_name):
+        return self._base.get_symmetric_nodes(
+            self._symmetric_nodes, node_name
+        )
+
+    def get_group_nodes(self, tab_name):
+        """We will pass a attribute names which is array in type
+        Fill with other nodes and active_list as False
+        It will raise error if all elements are not same length
+        Finally return list of NodesInfo
+        It will use some IxNetwork tab which do not have enable/disable features"""
+        dummy_tab = None
+        for node in self._symmetric_nodes:
+            dummy_tab = node.get(tab_name)
+            if dummy_tab is not None:
+                break
+        tab_lengths = []
+        group_nodes = []
+        active_list = []
+        for node in self._symmetric_nodes:
+            tab = node.get(tab_name)
+            if tab is None:
+                active_list.append(False)
+                if dummy_tab is None:
+                    tab_lengths.append(0)
+                else:
+                    tab_lengths.append(len(dummy_tab))
+                    tab = dummy_tab
+            else:
+                tab_lengths.append(len(tab))
+                active_list.append(True)
+            if len(set(tab_lengths)) > 1:
+                raise Exception("All the attributes %s should have same lengths" % tab_name)
+            for idx in range(tab_lengths[-1]):
+                if len(group_nodes) <= idx:
+                    group_nodes.append([tab[idx]])
+                else:
+                    group_nodes[idx].append(tab[idx])
+
+        return active_list, [NodesInfo(
+            1,  # use dummy one
+            self._active_list,
+            group_node
+        ) for group_node in group_nodes]
+
+    def get_active_group_nodes(self, tab_name):
+        """It will cover get_group_nodes
+        At the same time it will raise error if None node
+        because IxNetwork do not have active field for those"""
+        active_list, node_info_list = self.get_group_nodes(
+            tab_name
+        )
+        if len(set(active_list)) > 1:
+            raise Exception("All the attributes %s should configure with equal length"
+                            % tab_name)
+        return node_info_list
+
diff --git a/snappi_ixnetwork/device/bgp.py b/snappi_ixnetwork/device/bgp.py
index 8879082ad..06e78d5c1 100644
--- a/snappi_ixnetwork/device/bgp.py
+++ b/snappi_ixnetwork/device/bgp.py
@@ -1,4 +1,5 @@
 from snappi_ixnetwork.device.base import Base
+from snappi_ixnetwork.device.bgpevpn import BgpEvpn
 
 class Bgp(Base):
     _BGP = {
@@ -106,12 +107,10 @@ class Bgp(Base):
     def __init__(self, ngpf):
         super(Bgp, self).__init__()
         self._ngpf = ngpf
+        self._bgp_evpn = BgpEvpn(ngpf)
         self._router_id = None
-        self._invalid_ips = []
-        self._same_dg_ips = []
 
     def config(self, device):
-        self._same_dg_ips, self._invalid_ips = self._get_interface_info()
         bgp = device.get("bgp")
         if bgp is None:
             return
@@ -124,6 +123,8 @@ def _get_interface_info(self):
         same_dg_ips = []
         invalid_ips = []
         ethernets = self._ngpf.working_dg.get("ethernet")
+        if ethernets is None:
+            return same_dg_ips, invalid_ips
         for ethernet in ethernets:
             for ip_type in ip_types:
                 ips = ethernet.get(ip_type)
@@ -134,22 +135,29 @@ def _get_interface_info(self):
                         invalid_ips.extend(ip_names)
         return same_dg_ips, invalid_ips
 
+    def _is_valid(self, ip_name):
+        is_invalid = True
+        same_dg_ips, invalid_ips = self._get_interface_info()
+        if ip_name in invalid_ips:
+            self._ngpf.api.add_error("Multiple IP {name} on top of name Ethernet".format(
+                name=ip_name
+            ))
+            is_invalid = False
+        if len(same_dg_ips) > 0 and ip_name not in same_dg_ips:
+            self._ngpf.api.add_error("BGP should not configured on top of different device")
+            is_invalid = False
+        return is_invalid
+
     def _config_ipv4_interfaces(self, bgp):
         ipv4_interfaces = bgp.get("ipv4_interfaces")
         if ipv4_interfaces is None:
             return
         for ipv4_interface in ipv4_interfaces:
-            is_invalid = False
             ipv4_name = ipv4_interface.get("ipv4_name")
-            if ipv4_name in self._invalid_ips:
-                self._ngpf.api.add_error("Multiple IP {name} on top of name Ethernet".format(
-                    name=ipv4_name
-                ))
-                is_invalid = True
-            if ipv4_name not in self._same_dg_ips:
-                self._ngpf.api.add_error("BGP should not configured on top of different device")
-                is_invalid = True
-            if is_invalid:
+            self._ngpf.working_dg = self._ngpf.api.ixn_objects.get_working_dg(
+                ipv4_name
+            )
+            if not self._is_valid(ipv4_name):
                 continue
             ixn_ipv4 = self._ngpf.api.ixn_objects.get_object(ipv4_name)
             self._config_bgpv4(ipv4_interface.get("peers"),
@@ -160,17 +168,11 @@ def _config_ipv6_interfaces(self, bgp):
         if ipv6_interfaces is None:
             return
         for ipv6_interface in ipv6_interfaces:
-            is_invalid = False
             ipv6_name = ipv6_interface.get("ipv6_name")
-            if ipv6_name in self._invalid_ips:
-                self._ngpf.api.add_error("Multiple IP {name} on top of name Ethernet".format(
-                    name=ipv6_name
-                ))
-                is_invalid = True
-            if ipv6_name not in self._same_dg_ips:
-                self._ngpf.api.add_error("BGP should not configured on top of different device")
-                is_invalid = True
-            if is_invalid:
+            self._ngpf.working_dg = self._ngpf.api.ixn_objects.get_working_dg(
+                ipv6_name
+            )
+            if not self._is_valid(ipv6_name):
                 continue
             ixn_ipv6 = self._ngpf.api.ixn_objects.get_object(ipv6_name)
             self._config_bgpv6(ipv6_interface.get("peers"),
@@ -202,6 +204,7 @@ def _config_bgpv4(self, bgp_peers, ixn_ipv4):
             if capability is not None:
                 self.configure_multivalues(capability, ixn_bgpv4, Bgp._CAPABILITY)
             self._bgp_route_builder(bgp_peer, ixn_bgpv4)
+            self._bgp_evpn.config(bgp_peer, ixn_bgpv4)
 
     def _config_bgpv6(self, bgp_peers, ixn_ipv6):
         if bgp_peers is None:
@@ -223,6 +226,7 @@ def _config_bgpv6(self, bgp_peers, ixn_ipv6):
                     capability, ixn_bgpv6, Bgp._CAPABILITY_IPv6
                 )
             self._bgp_route_builder(bgp_peer, ixn_bgpv6)
+            self._bgp_evpn.config(bgp_peer, ixn_bgpv6)
 
     def _bgp_route_builder(self, bgp_peer, ixn_bgp):
         v4_routes = bgp_peer.get("v4_routes")
diff --git a/snappi_ixnetwork/device/bgpevpn.py b/snappi_ixnetwork/device/bgpevpn.py
new file mode 100644
index 000000000..fd05fd146
--- /dev/null
+++ b/snappi_ixnetwork/device/bgpevpn.py
@@ -0,0 +1,553 @@
+from snappi_ixnetwork.device.base import Base, NodesInfo
+from snappi_ixnetwork.device.utils import convert_as_values, hex_to_ipv4
+
+
+class BgpEvpn(Base):
+    _ETHER_SEGMENT = {
+        "esi": "esiValue",
+        "esi_label": "esiLabel",
+        "active_mode": {
+            "ixn_attr": "enableSingleActive",
+            "enum_map": {
+                "single_active": True,
+                "all_active": False
+            }
+        },
+    }
+
+    _SEG_COMMUNITIES = {
+        "type": {
+            "ixn_attr": "type",
+            "default_value": "no_export",
+            "enum_map": {
+                "manual_as_number": "manual",
+                "no_export": "noexport",
+                "no_advertised": "noadvertised",
+                "no_export_subconfed": "noexport_subconfed",
+                "llgr_stale": "llgr_stale",
+                "no_llgr": "no_llgr"
+            }
+        },
+        "as_number": "asNumber",
+        "as_custom": "lastTwoOctets"
+    }
+
+    _SEG_EXT_COMMUNITIES = {
+        "type": {
+            "ixn_attr": "type",
+            "default_value": "administrator_as_2octet",
+            "enum_map": {
+                "administrator_as_2octet": "administratoras2octet",
+                "administrator_ipv4_address": "administratorip",
+                "administrator_as_4octet": "administratoras4octet",
+                "opaque": "opaque",
+                "evpn": "evpn",
+                "administrator_as_2octet_link_bandwidth": "administratoras2octetlinkbw"
+            }
+        },
+        "subtype": {
+            "ixn_attr": "subType",
+            "default_value": "route_target",
+            "enum_map": {
+                "route_target": "routetarget",
+                "origin": "origin",
+                "extended_bandwidth": "extendedbandwidth",
+                "color": "color",
+                "encapsulation": "encapsulation",
+                "mac_address": "macaddress"
+            }
+        }
+    }
+
+    _AS_SET_MODE = {
+        "do_not_include_local_as": "dontincludelocalas",
+        "include_as_seq": "includelocalasasasseq",
+        "include_as_set": "includelocalasasasset",
+        "include_as_confed_seq": "includelocalasasasseqconfederation",
+        "include_as_confed_set": "includelocalasasassetconfederation",
+        "prepend_to_first_segment": "prependlocalastofirstsegment",
+    }
+
+    _SEGMENT_TYPE = {
+        "as_seq": "asseq",
+        "as_set": "asset",
+        "as_confed_seq": "asseqconfederation",
+        "as_confed_set": "assetconfederation",
+    }
+
+    _VXLAN = {
+        "ad_label": "adRouteLabel",
+        "pmsi_label": "upstreamDownstreamAssignedMplsLabel",
+        "replication_type": {
+            "ixn_attr": "multicastTunnelType",
+            "enum_map": {
+                "ingress_replication": "tunneltypeingressreplication"
+            }
+        }
+    }
+
+    _COMMON_ROUTE_TYPE = {
+        "as_2octet": "as",
+        "as_4octet": "as4",
+        "ipv4_address": "ip"
+    }
+
+    _BROADCAST_DOMAINS = {
+        "ethernet_tag_id": "ethernetTagId",
+        "vlan_aware_service": "enableVlanAwareService"
+    }
+
+    _MAC_ADDRESS = {
+        "address": "mac",
+        "prefix": "prefixLength",
+        "count": "numberOfAddressesAsy"
+    }
+
+    _IP_ADDRESS = {
+        "address": "networkAddress",
+        "prefix": "prefixLength",
+        "count": "numberOfAddressesAsy"
+    }
+
+    _CMAC_PROPERTIES = {
+        "l2vni": "firstLabelStart",
+        "l3vni": "secondLabelStart",
+        "include_default_gateway": "includeDefaultGatewayExtendedCommunity"
+    }
+
+    def __init__(self, ngpf):
+        super(BgpEvpn, self).__init__()
+        self._ngpf = ngpf
+        self._peer_class = None
+
+    def config(self, bgp_peer, ixn_bgp):
+        if bgp_peer.get("evpn_ethernet_segments") is None:
+            return
+        ixn_bgp["filterEvpn"] = self.multivalue(True)
+        eth_segment_info = self.get_symmetric_nodes(
+            [bgp_peer], "evpn_ethernet_segments"
+        )
+        if eth_segment_info.is_all_null or \
+                eth_segment_info.max_len == 0:
+            return
+        self._peer_class = bgp_peer.__class__.__name__
+        if self._peer_class == "BgpV4Peer":
+            ixn_bgp["ethernetSegmentsCountV4"] = eth_segment_info.max_len
+            ixn_eth_segments = self.create_property(
+                ixn_bgp, "bgpEthernetSegmentV4"
+            )
+        else:
+            ixn_bgp["ethernetSegmentsCountV6"] = eth_segment_info.max_len
+            ixn_eth_segments = self.create_property(
+                ixn_bgp, "bgpEthernetSegmentV6"
+            )
+
+        self._config_eth_segment(eth_segment_info, ixn_eth_segments)
+        self._config_evis(eth_segment_info, ixn_bgp, ixn_eth_segments)
+
+    def _config_advance(self, parent_info, ixn_parent):
+        advanced = parent_info.get_tab("advanced")
+        if advanced.is_all_null:
+            return None
+
+        ixn_parent["origin"] = advanced.get_multivalues(
+            "origin"
+        )
+        med_values = []
+        for node in advanced.symmetric_nodes:
+            med_values.append(
+                node.get("multi_exit_discriminator")
+            )
+        if med_values.count(None) != len(med_values):
+            ixn_parent["enableMultiExitDiscriminator"] = self.multivalue(True)
+            ixn_parent["multiExitDiscriminator"] = self.multivalue(
+                med_values
+            )
+
+    def _config_communities(self, parent_info, ixn_parent):
+        active_list, communities_info_list = parent_info.get_group_nodes(
+            "communities"
+        )
+        if len(communities_info_list) == 0:
+            return None
+
+        ixn_parent["noOfCommunities"] = len(communities_info_list)
+        ixn_parent["enableCommunity"] = self.multivalue(active_list)
+        for communities_info in communities_info_list:
+            ixn_communities = self.create_node_elemet(ixn_parent, "bgpCommunitiesList")
+            communities_info.config_values(
+                ixn_communities, BgpEvpn._SEG_COMMUNITIES
+            )
+
+    def _config_ext_communities(self, parent_info, ixn_parent):
+        active_list, ext_communitiesinfo_list = parent_info.get_group_nodes(
+            "ext_communities"
+        )
+        if len(ext_communitiesinfo_list) == 0:
+            return None
+
+        ixn_parent["noOfExtendedCommunity"] = len(
+            ext_communitiesinfo_list
+        )
+        ixn_parent["enableExtendedCommunity"] = self.multivalue(active_list)
+        for ext_communitiesinfo in ext_communitiesinfo_list:
+            ixn_ext_communities = self.create_node_elemet(
+                ixn_parent, "bgpExtendedCommunitiesList"
+            )
+            ext_communitiesinfo.config_values(
+                ixn_ext_communities, BgpEvpn._SEG_EXT_COMMUNITIES
+            )
+            types = ixn_ext_communities.get("type").value
+            sub_types = ixn_ext_communities.get("subType").value
+            values = ext_communitiesinfo.get_values("value", default="0000000000c8")
+            idx = 0
+            opaqueData = list()
+            ip = list()
+            assignedNumber2Bytes = list()
+            asNumber2Bytes = list()
+            asNumber4Bytes = list()
+            assignedNumber4Bytes = list()
+            colorCOBits = list()
+            colorReservedBits = list()
+            colorValue = list()
+            for type, sub_type, value in zip(types, sub_types, values):
+                value.zfill(12)
+                opaqueData.append("000000000000")
+                ip.append("1.1.1.1")
+                assignedNumber2Bytes.append("1")
+                asNumber2Bytes.append("1")
+                asNumber4Bytes.append("1")
+                assignedNumber4Bytes.append("1")
+                colorCOBits.append("00")
+                colorReservedBits.append("0")
+                colorValue.append("0")
+
+                if type == "administratorip":
+                    if sub_type == "extendedbandwidth":
+                        opaqueData[idx] = value
+                    else:
+                        ip[idx] = hex_to_ipv4(value[:8])
+                        assignedNumber2Bytes[idx] = int(value[8:], 16)
+                elif type == "administratoras2octet":
+                    if sub_type == "extendedbandwidth":
+                        opaqueData[idx] = value
+                    else:
+                        asNumber2Bytes[idx] = int(value[:4], 16)
+                        assignedNumber4Bytes[idx] = int(value[4:], 16)
+                elif type == "administratoras4octet":
+                    if sub_type == "extendedbandwidth":
+                        opaqueData[idx] = value
+                    else:
+                        asNumber4Bytes[idx] = int(value[:8], 16)
+                        assignedNumber2Bytes[idx] = int(value[8:], 16)
+                elif type == "opaque":
+                    if sub_type == "color":
+                        bin_values = bin(int(value[:4], 16))[2:].zfill(8)
+                        colorCOBits[idx] = bin_values[:2]
+                        colorReservedBits[idx] = int(bin_values[2:], 2)
+                        colorValue[idx] = int(value[4:], 16)
+                    else:
+                        opaqueData[idx] = value
+                elif type == "evpn":
+                    if sub_type == "macaddress":
+                        opaqueData[idx] = value
+                idx += 1
+
+            ixn_ext_communities["opaqueData"] = self.multivalue(opaqueData)
+            ixn_ext_communities["ip"] = self.multivalue(ip)
+            ixn_ext_communities["assignedNumber2Bytes"] = self.multivalue(assignedNumber2Bytes)
+            ixn_ext_communities["asNumber2Bytes"] = self.multivalue(asNumber2Bytes)
+            ixn_ext_communities["asNumber4Bytes"] = self.multivalue(asNumber4Bytes)
+            ixn_ext_communities["assignedNumber4Bytes"] = self.multivalue(assignedNumber4Bytes)
+            ixn_ext_communities["colorCOBits"] = self.multivalue(colorCOBits)
+            ixn_ext_communities["colorReservedBits"] = self.multivalue(colorReservedBits)
+            ixn_ext_communities["colorValue"] = self.multivalue(colorValue)
+
+    def _config_as_path_segments(self, parent_info, ixn_parent):
+        as_path = parent_info.get_tab("as_path")
+        if as_path.is_all_null:
+            return None
+
+        ixn_parent["overridePeerAsSetMode"] = self.multivalue(True)
+        ixn_parent["asSetMode"] = as_path.get_multivalues(
+            "as_set_mode", BgpEvpn._AS_SET_MODE
+        )
+        active_list, segments_info_list = as_path.get_group_nodes("segments")
+        if len(segments_info_list) > 0:
+            ixn_parent["enableAsPathSegments"] = self.multivalue(active_list)
+            ixn_parent["noOfASPathSegmentsPerRouteRange"] = len(
+                segments_info_list
+            )
+            for segments_info in segments_info_list:
+                ixn_segments = self.create_node_elemet(
+                    ixn_parent, "bgpAsPathSegmentList"
+                )
+                ixn_segments["segmentType"] = segments_info.get_multivalues(
+                    "type", BgpEvpn._SEGMENT_TYPE
+                )
+                active_list, numbers_info_list = segments_info.get_group_nodes("as_numbers")
+                if len(numbers_info_list) > 0:
+                    ixn_segments["numberOfAsNumberInSegment"] = len(
+                        numbers_info_list
+                    )
+                    for numbers_info in numbers_info_list:
+                        ixn_as_number = self.create_node_elemet(
+                            ixn_segments, "bgpAsNumberList"
+                        )
+                        ixn_as_number["enableASNumber"] = self.multivalue(
+                            numbers_info.active_list
+                        )
+                        ixn_as_number["asNumber"] = self.multivalue(
+                            numbers_info.symmetric_nodes
+                        )
+
+    def _config_eth_segment(self, eth_segment_info, ixn_eth_segments):
+        eth_segment_info.config_values(
+            ixn_eth_segments, BgpEvpn._ETHER_SEGMENT
+        )
+        df_election_info = eth_segment_info.get_tab("df_election")
+        if not df_election_info.is_all_null:
+            ixn_eth_segments["dfElectionTimer"] = df_election_info.get_multivalues(
+                "election_timer"
+            )
+
+        self._config_advance(eth_segment_info, ixn_eth_segments)
+        self._config_communities(eth_segment_info, ixn_eth_segments)
+        self._config_ext_communities(eth_segment_info, ixn_eth_segments)
+        self._config_as_path_segments(eth_segment_info, ixn_eth_segments)
+
+    def _set_target(self, ixn_obj, rt_types, convert_rt_values):
+        ixn_obj["targetType"] = self.multivalue(rt_types)
+        ixn_obj["targetAsNumber"] = self.multivalue(convert_rt_values.as_num)
+        ixn_obj["targetAs4Number"] = self.multivalue(convert_rt_values.as4_num)
+        ixn_obj["targetIpAddress"] = self.multivalue(convert_rt_values.ip_addr)
+        ixn_obj["targetAssignedNumber"] = self.multivalue(
+            convert_rt_values.assign_num
+        )
+
+    def _config_evis(self, eth_segment_info, ixn_bgp, ixn_eth_segments):
+        vxlan_info = eth_segment_info.get_symmetric_nodes("evis")
+        ixn_eth_segments["evisCount"] = vxlan_info.max_len
+        if self._peer_class == "BgpV4Peer":
+            ixn_xvlan = self.create_node_elemet(
+                ixn_bgp, "bgpIPv4EvpnVXLAN"
+            )
+        else:
+            ixn_xvlan = self.create_node_elemet(
+                ixn_bgp, "bgpIPv6EvpnVXLAN"
+            )
+        vxlan_info.config_values(ixn_xvlan, BgpEvpn._VXLAN)
+
+        # Configure route_distinguisher
+        distinguisher_info = vxlan_info.get_tab("route_distinguisher")
+        rd_types = distinguisher_info.get_values(
+            "rd_type", enum_map=BgpEvpn._COMMON_ROUTE_TYPE
+        )
+        convert_values = convert_as_values(
+            rd_types, distinguisher_info.get_values(
+                "rd_value", default="65101:1"
+            )
+        )
+        ixn_xvlan["rdType"] = self.multivalue(rd_types)
+        ixn_xvlan["rdASNumber"] = self.multivalue(convert_values.common_num)
+        ixn_xvlan["rdEvi"] = self.multivalue(convert_values.assign_num)
+        ixn_xvlan["rdIpAddress"] = self.multivalue(convert_values.ip_addr)
+        ixn_xvlan["autoConfigureRdIpAddress"] = distinguisher_info.get_multivalues(
+            "auto_config_rd_ip_addr", default=True
+        )
+
+        # Configure route_target_export
+        exports_info_list = vxlan_info.get_active_group_nodes("route_target_export")
+        if len(exports_info_list) > 0:
+            ixn_xvlan["numRtInExportRouteTargetList"] = len(
+                exports_info_list
+            )
+        for exports_info in exports_info_list:
+            ixn_export = self.create_node_elemet(ixn_xvlan, "bgpExportRouteTargetList")
+            rt_types = exports_info.get_values(
+                "rt_type", enum_map=BgpEvpn._COMMON_ROUTE_TYPE
+            )
+            convert_rt_values = convert_as_values(
+                rt_types, exports_info.get_values(
+                    "rt_value", default="65101:1"
+                )
+            )
+            self._set_target(ixn_export, rt_types, convert_rt_values)
+
+        # Configure route_target_import
+        import_info_list = vxlan_info.get_active_group_nodes("route_target_import")
+        if len(import_info_list) > 0:
+            ixn_xvlan["importRtListSameAsExportRtList"] = False
+            ixn_xvlan["numRtInImportRouteTargetList"] = len(
+                import_info_list
+            )
+        for import_info in import_info_list:
+            ixn_import = self.create_node_elemet(ixn_xvlan, "bgpImportRouteTargetList")
+            rt_types = import_info.get_values(
+                "rt_type", enum_map=BgpEvpn._COMMON_ROUTE_TYPE
+            )
+            convert_rt_values = convert_as_values(
+                rt_types, import_info.get_values(
+                    "rt_value", default="65101:1"
+                )
+            )
+            self._set_target(ixn_import, rt_types, convert_rt_values)
+
+        # Configure l3_route_target_export
+        l3exports_info_list = vxlan_info.get_active_group_nodes("l3_route_target_export")
+        if len(l3exports_info_list) > 0:
+            ixn_xvlan["numRtInL3vniExportRouteTargetList"] = len(
+                l3exports_info_list
+            )
+        for l3exports_info in l3exports_info_list:
+            ixn_l3export = self.create_node_elemet(ixn_xvlan, "bgpL3VNIExportRouteTargetList")
+            rt_types = l3exports_info.get_values(
+                "rt_type", enum_map=BgpEvpn._COMMON_ROUTE_TYPE
+            )
+            convert_rt_values = convert_as_values(
+                rt_types, l3exports_info.get_values(
+                    "rt_value", default="65101:1"
+                )
+            )
+            self._set_target(ixn_l3export, rt_types, convert_rt_values)
+
+        # Configure l3_route_target_import
+        l3import_info_list = vxlan_info.get_active_group_nodes("l3_route_target_import")
+        if len(l3import_info_list) > 0:
+            ixn_xvlan["l3vniImportRtListSameAsL3vniExportRtList"] = False
+            ixn_xvlan["numRtInL3vniImportRouteTargetList"] = len(
+                l3import_info_list
+            )
+        for l3import_info in l3import_info_list:
+            ixn_l3import = self.create_node_elemet(ixn_xvlan, "bgpL3VNIImportRouteTargetList")
+            rt_types = l3import_info.get_values(
+                "rt_type", enum_map=BgpEvpn._COMMON_ROUTE_TYPE
+            )
+            convert_rt_values = convert_as_values(
+                rt_types, l3import_info.get_values(
+                    "rt_value", default="65101:1"
+                )
+            )
+            self._set_target(ixn_l3import, rt_types, convert_rt_values)
+
+        self._config_advance(vxlan_info, ixn_xvlan)
+        self._config_communities(vxlan_info, ixn_xvlan)
+        self._config_ext_communities(vxlan_info, ixn_xvlan)
+        self._config_as_path_segments(vxlan_info, ixn_xvlan)
+
+        broadcast_domains_info = vxlan_info.get_symmetric_nodes(
+            "broadcast_domains"
+        )
+        if not broadcast_domains_info.is_all_null:
+            if self._peer_class == "BgpV4Peer":
+                ixn_xvlan["numBroadcastDomainV4"] = broadcast_domains_info.max_len
+                ixn_broadcast_domains = self.create_property(
+                    ixn_xvlan, "broadcastDomainV4"
+                )
+            else:
+                ixn_xvlan["numBroadcastDomainV6"] = broadcast_domains_info.max_len
+                ixn_broadcast_domains = self.create_property(
+                    ixn_xvlan, "broadcastDomainV6"
+                )
+            ixn_broadcast_domains["active"] = self.multivalue(
+                broadcast_domains_info.active_list
+            )
+            broadcast_domains_info.config_values(
+                ixn_broadcast_domains, BgpEvpn._BROADCAST_DOMAINS
+            )
+            self._config_cmac_ip_range(
+                broadcast_domains_info, ixn_broadcast_domains, ixn_xvlan
+            )
+
+    def _get_symetic_address(self, cmac_ip_range_info, address_type):
+        active_list = []
+        symmetric_nodes = []
+        dummy_value = None
+        for node in cmac_ip_range_info.symmetric_nodes:
+            symmetric_nodes.append(
+                node.get(address_type)
+            )
+            if symmetric_nodes[-1] is None:
+                active_list.append(False)
+            else:
+                active_list.append(True)
+                if dummy_value is None:
+                    dummy_value = symmetric_nodes[-1]
+
+        if dummy_value is not None:
+            for idx in range(len(active_list)):
+                if active_list[idx] is False:
+                    symmetric_nodes[idx] = dummy_value
+                active_list[idx] = cmac_ip_range_info.active_list[idx] \
+                                   and active_list[idx]
+        return NodesInfo(
+            cmac_ip_range_info.max_len,
+            active_list,
+            symmetric_nodes
+        )
+
+    def _config_cmac_ip_range(self, broadcast_domains_info, ixn_broadcast_domains, ixn_xvlan):
+        cmac_ip_range_info = broadcast_domains_info.get_symmetric_nodes(
+            "cmac_ip_range"
+        )
+        if cmac_ip_range_info.is_all_null:
+            return
+
+        mac_info = self._get_symetic_address(cmac_ip_range_info, "mac_addresses")
+        ipv4_info = self._get_symetic_address(cmac_ip_range_info, "ipv4_addresses")
+        ipv6_info = self._get_symetic_address(cmac_ip_range_info, "ipv6_addresses")
+        ixn_broadcast_domains["noOfMacPools"] = cmac_ip_range_info.max_len
+        if mac_info.is_all_null:
+            raise Exception("mac_addresses should configured in cmac_ip_range")
+        names = cmac_ip_range_info.get_values("name")
+        ixn_ng = self.create_node_elemet(
+            self._ngpf.working_dg, "networkGroup"
+        )
+        for node in cmac_ip_range_info.symmetric_nodes:
+            self._ngpf.set_device_info(
+                node, ixn_ng
+            )
+        ixn_ng["name"] = names
+        self._ngpf.api.ixn_objects.set_scalable(ixn_ng)
+        ixn_ng["enabled"] = self.multivalue(cmac_ip_range_info.active_list)
+        ixn_mac_pools = self.create_node_elemet(
+            ixn_ng, "macPools", "pool_{}".format(names[0])
+        )
+        mac_info.config_values(
+            ixn_mac_pools, BgpEvpn._MAC_ADDRESS
+        )
+        ixn_connector = self.create_property(ixn_mac_pools, "connector")
+        ixn_connector["connectedTo"] = self.post_calculated(
+            "connectedTo", ref_ixnobj=ixn_xvlan
+        )
+        ixn_mac = self.create_node_elemet(
+            ixn_mac_pools, "cMacProperties", "mac_{}".format(names[0])
+        )
+        ixn_mac["enableSecondLabel"] = self.multivalue(True)
+        cmac_ip_range_info.config_values(
+            ixn_mac, BgpEvpn._CMAC_PROPERTIES
+        )
+        self._config_advance(cmac_ip_range_info, ixn_mac)
+        self._config_communities(cmac_ip_range_info, ixn_mac)
+        self._config_ext_communities(cmac_ip_range_info, ixn_mac)
+        self._config_as_path_segments(cmac_ip_range_info, ixn_mac)
+
+        if not ipv4_info.is_all_null:
+            ixn_ipv4 = self.create_node_elemet(
+                ixn_mac_pools, "ipv4PrefixPools"
+            )
+            ixn_mac["advertiseIpv4Address"] = self.multivalue(
+                ipv4_info.active_list
+            )
+            ipv4_info.config_values(ixn_ipv4, BgpEvpn._IP_ADDRESS)
+
+        if not ipv6_info.is_all_null:
+            ixn_ipv6 = self.create_node_elemet(
+                ixn_mac_pools, "ipv6PrefixPools"
+            )
+            ixn_mac["advertiseIpv6Address"] = self.multivalue(
+                ipv6_info.active_list
+            )
+            ipv6_info.config_values(ixn_ipv6, BgpEvpn._IP_ADDRESS)
+
+
diff --git a/snappi_ixnetwork/device/createixnconfig.py b/snappi_ixnetwork/device/createixnconfig.py
index 06ef588cd..8e5db55ac 100644
--- a/snappi_ixnetwork/device/createixnconfig.py
+++ b/snappi_ixnetwork/device/createixnconfig.py
@@ -4,6 +4,7 @@ class CreateIxnConfig(Base):
     def __init__(self, ngpf):
         super(CreateIxnConfig, self).__init__()
         self._ngpf = ngpf
+        self._post_calculated_info = list()
 
     def create(self, node, node_name, parent_xpath=""):
         if not isinstance(node, list):
@@ -19,6 +20,10 @@ def create(self, node, node_name, parent_xpath=""):
             element["xpath"] = xpath
             self._process_element(element, xpath)
 
+    def post_calculate(self):
+        for element, key, value in self._post_calculated_info:
+            element[key] = value.value
+
     def _process_element(self, element, parent_xpath, child_name=None):
         if child_name is not None and "xpath" in element:
             child_xpath = """{parent_xpath}/{child_name}""".format(
@@ -31,20 +36,23 @@ def _process_element(self, element, parent_xpath, child_name=None):
             if key == "name":
                 element["name"] = self.get_name(element)
             elif isinstance(value, MultiValue):
-                value = self._get_ixn_multivalue(value, key, parent_xpath)
+                value = self._get_ixn_multivalue(value, key, element["xpath"])
                 if value is None:
                     key_to_remove.append(key)
                 else:
                     element[key] = value
             elif isinstance(value, PostCalculated):
-                element[key] = value.value
+                self._post_calculated_info.append(
+                    [element, key, value]
+                )
             elif isinstance(value, dict):
                 self._process_element(value, parent_xpath, key)
             elif isinstance(value, list) and len(value) > 0 and \
                     isinstance(value[0], dict):
                 if child_name is not None:
-                    raise Exception("Add support node within element")
-                self.create(value, key, parent_xpath)
+                    self.create(value, key, element["xpath"])
+                else:
+                    self.create(value, key, parent_xpath)
 
         for key in key_to_remove:
             element.pop(key)
diff --git a/snappi_ixnetwork/device/loopbackint.py b/snappi_ixnetwork/device/loopbackint.py
index a1d2c8a35..5efa90267 100644
--- a/snappi_ixnetwork/device/loopbackint.py
+++ b/snappi_ixnetwork/device/loopbackint.py
@@ -58,6 +58,7 @@ def _create_dg(self, loop_back, device):
         )
         ixn_dg["multiplier"] = 1
         self._ngpf.working_dg = ixn_dg
+        self._ngpf.set_device_info(device, ixn_dg)
         return ixn_dg
 
     def _config_ipv4_loopbacks(self, ipv4_loopbacks, device, vxlan_source_int_list):
diff --git a/snappi_ixnetwork/device/ngpf.py b/snappi_ixnetwork/device/ngpf.py
index 49eaeb8e1..bac6666ac 100644
--- a/snappi_ixnetwork/device/ngpf.py
+++ b/snappi_ixnetwork/device/ngpf.py
@@ -23,7 +23,8 @@ class Ngpf(Base):
         "DeviceIpv4Loopback": "ipv4",
         "DeviceIpv6Loopback": "ipv6",
         "VxlanV4Tunnel": "ipv4",
-        "VxlanV6Tunnel": "ipv6"
+        "VxlanV6Tunnel": "ipv6",
+        "BgpCMacIpRange": "ethernetVlan",
     }
 
     _ROUTE_STATE = {
@@ -62,6 +63,7 @@ def config(self):
             self._createixnconfig.create(
                 self._ixn_config["topology"], "topology"
             )
+            self._createixnconfig.post_calculate()
         with Timer(self.api, "Push IxNetwork device config :"):
             self._pushixnconfig()
 
@@ -104,7 +106,6 @@ def _configure_topology(self):
 
         # We need to configure all interface before configure protocols
         for device in self.api.snappi_config.devices:
-            self.working_dg = self.api.ixn_objects.get_working_dg(device.name)
             self._bgp.config(device)
 
 
@@ -150,7 +151,10 @@ def _configure_device_group(self, ixn_topos):
         device_chain_dgs = {}
         for device in self.api.snappi_config.devices:
             chin_dgs = {}
-            for ethernet in device.get("ethernets"):
+            ethernets = device.get("ethernets")
+            if ethernets is None:
+                continue
+            for ethernet in ethernets:
                 if ethernet.get("connection") and ethernet.get("port_name"):
                     raise Exception(
                         "port_name and connection for ethernet configuration cannot be passed together, use either connection or port_name property. \
@@ -200,7 +204,9 @@ def _configure_device_group(self, ixn_topos):
 
         # Wait till all primary DG will configure
         for device in self.api.snappi_config.devices:
-            chin_dgs = device_chain_dgs[device.name]
+            chin_dgs = device_chain_dgs.get(device.name)
+            if chin_dgs is None:
+                continue
             for connected_to, ethernet_list in chin_dgs.items():
                 ixn_working_dg = self.api.ixn_objects.get_working_dg(connected_to)
                 self._chain_parent_dgs.append(ixn_working_dg)
diff --git a/snappi_ixnetwork/device/utils.py b/snappi_ixnetwork/device/utils.py
index b0046be04..90aaa2be2 100644
--- a/snappi_ixnetwork/device/utils.py
+++ b/snappi_ixnetwork/device/utils.py
@@ -1,3 +1,4 @@
+import re
 from collections import namedtuple, Mapping
 
 def namedtuple_with_defaults(typename, field_names, default_values=()):
@@ -8,4 +9,43 @@ def namedtuple_with_defaults(typename, field_names, default_values=()):
     else:
         prototype = T(*default_values)
     T.__new__.__defaults__ = tuple(prototype)
-    return T
\ No newline at end of file
+    return T
+
+
+def asdot2plain(asdot):
+    """This returns an ASPLAIN formated ASN given an ASDOT+ format"""
+    if re.findall(r'\.|\:', asdot):
+        left, right = re.split(r'\.|\:', asdot)
+        ret = int(left) * 65536 + int(right)
+        return ret
+    else:
+        return int(asdot)
+
+
+def convert_as_values(as_types, as_values):
+    ConvertedAsValues = namedtuple_with_defaults("ConvertedAsValues",
+                                                 ("as_num", "as4_num", "ip_addr", "assign_num", "common_num"),
+                                                 ([], [], [], [], []))
+
+    convert_values = ConvertedAsValues()
+    for idx, as_type in enumerate(as_types):
+        num, assign = as_values[idx].split(":")
+        convert_values.as_num.append("65101")
+        convert_values.as4_num.append("65101")
+        convert_values.common_num.append("65101")
+        convert_values.ip_addr.append("1.1.1.1")
+        convert_values.assign_num.append(assign)
+        if as_type == "as":
+            convert_values.as_num[idx] = num
+            convert_values.common_num[idx] = num
+        elif as_type == "as4":
+            convert_values.as4_num[idx] = num
+            convert_values.common_num[idx] = num
+        else:
+            convert_values.ip_addr[idx] = num
+    return convert_values
+
+def hex_to_ipv4(hex_value):
+    bytes = ["".join(x) for x in zip(*[iter(hex_value)] * 2)]
+    bytes = [int(x, 16) for x in bytes]
+    return ".".join(str(x) for x in reversed(bytes))
\ No newline at end of file
diff --git a/snappi_ixnetwork/snappi_api.py b/snappi_ixnetwork/snappi_api.py
index dae72132c..077968f7f 100644
--- a/snappi_ixnetwork/snappi_api.py
+++ b/snappi_ixnetwork/snappi_api.py
@@ -178,6 +178,12 @@ def _request_detail(self):
                                 )
                             )
         # request_detail.errors = errors
+
+        # Need to add this hack as dumping json config throws this exception
+        # Traffic regeneration will be part of set_transmit_state
+        errors = [error for error in errors
+                  if "before trying to generate BGP EVPN traffic" not in error]
+
         if len(errors) > 0:
             self._errors = []
             raise SnappiIxnException(500, errors)


Test patch:
diff --git a/tests/bgp_evpn/test_bgp_evpn.py b/tests/bgp_evpn/test_bgp_evpn.py
new file mode 100644
index 000000000..9ccdd81cc
--- /dev/null
+++ b/tests/bgp_evpn/test_bgp_evpn.py
@@ -0,0 +1,180 @@
+def test_bgp_evpn(api, utils):
+    # Creating Ports
+    config = api.config()
+    p1 = config.ports.port(name='p1', location=utils.settings.ports[0])[-1]
+    p2 = config.ports.port(name='p2', location=utils.settings.ports[1])[-1]
+
+    # Create BGP devices on tx & rx
+    tx_d = config.devices.device(name='tx_d')[-1]
+    rx_d = config.devices.device(name='rx_d')[-1]
+
+    tx_eth = tx_d.ethernets.ethernet(port_name=p1.name)[-1]
+    rx_eth = rx_d.ethernets.ethernet(port_name=p2.name)[-1]
+
+    tx_eth.name = 'tx_eth'
+    tx_eth.mac = '00:11:00:00:00:01'
+    tx_ip = tx_eth.ipv4_addresses.ipv4(name='tx_ip',
+                                       address='20.20.20.2',
+                                       gateway='20.20.20.1')[-1]
+
+    rx_eth.name = 'rx_eth'
+    rx_eth.mac = '00:12:00:00:00:01'
+    rx_ip = rx_eth.ipv4_addresses.ipv4(name='rx_ip',
+                                       address='20.20.20.1',
+                                       gateway='20.20.20.2')[-1]
+
+    # tx_bgp
+    tx_bgp = tx_d.bgp
+    tx_bgp.router_id = "192.0.0.1"
+    tx_bgp_iface = (tx_bgp.ipv4_interfaces
+                    .v4interface(ipv4_name=tx_ip.name)[-1])
+    tx_bgp_peer = tx_bgp_iface.peers.v4peer(name="tx_eBGP",
+                                            peer_address='20.20.20.1',
+                                            as_type='ebgp',
+                                            as_number=100)[-1]
+
+    # rx_bgp
+    rx_bgp = rx_d.bgp
+    rx_bgp.router_id = "193.0.0.1"
+    rx_bgp_iface = (rx_bgp.ipv4_interfaces
+                    .v4interface(ipv4_name=rx_ip.name)[-1])
+    rx_bgp_peer = rx_bgp_iface.peers.v4peer(name="rx_eBGP",
+                                            peer_address='20.20.20.2',
+                                            as_type='ebgp',
+                                            as_number=200)[-1]
+
+    # Create & advertise loopback under bgp in tx and rx
+    tx_l1 = tx_d.ipv4_loopbacks.add()
+    tx_l1.name = "tx_loopback1"
+    tx_l1.eth_name = "tx_eth"
+    tx_l1.address = "1.1.1.1"
+
+    tx_l1_r = tx_bgp_peer.v4_routes.add(name="tx_l1")
+    tx_l1_r.addresses.add(address="1.1.1.1", prefix=32)
+
+    rx_l1 = rx_d.ipv4_loopbacks.add()
+    rx_l1.name = "rx_loopback1"
+    rx_l1.eth_name = "rx_eth"
+    rx_l1.address = "2.2.2.2"
+
+    rx_l1_r = rx_bgp_peer.v4_routes.add(name="rx_l1")
+    rx_l1_r.addresses.add(address="2.2.2.2", prefix=32)
+
+    # Create BGP EVPN on tx
+    tx_vtep = config.devices.device(name='tx_vtep')[-1]
+    tx_vtep_bgp = tx_vtep.bgp
+    tx_vtep_bgp.router_id = "190.0.0.1"
+    tx_vtep_bgp_iface = (tx_vtep_bgp.ipv4_interfaces
+                         .v4interface(ipv4_name=tx_l1.name)[-1])
+    tx_vtep_bgp_peer = tx_vtep_bgp_iface.peers.v4peer(name="bgp1",
+                                                      peer_address='2.2.2.2',
+                                                      as_type='ibgp',
+                                                      as_number=101)[-1]
+
+    # Adding 1 Ethernet Segment per Bgp Peer
+    tx_vtep_es1 = tx_vtep_bgp_peer.evpn_ethernet_segments.ethernetsegment()[-1]
+
+    # Adding 1 EVI on the Ethernet Segment
+    tx_es1_evisV4_1 = tx_vtep_es1.evis.evi_vxlan()[-1]
+    tx_es1_evisV4_1.route_distinguisher.auto_config_rd_ip_addr = True
+    tx_es1_evisV4_1.route_distinguisher.rd_type = (
+        tx_es1_evisV4_1.route_distinguisher.AS_2OCTET)
+    tx_es1_evisV4_1.route_distinguisher.rd_value = "100:1"
+
+    export_rt = tx_es1_evisV4_1.route_target_export.routetarget()[-1]
+    import_rt = tx_es1_evisV4_1.route_target_import.routetarget()[-1]
+    export_rt.rt_type = export_rt.AS_2OCTET
+    export_rt.rt_value = "100:20"
+
+    import_rt.rt_type = import_rt.AS_2OCTET
+    import_rt.rt_value = "100:20"
+
+    # Adding 1 Broadcast Domain per EVI
+    tx_es1_evisV4_1_bd_1 = (tx_es1_evisV4_1
+                            .broadcast_domains
+                            .broadcastdomain()[-1])
+
+    # Adding 1 MAC Range Per Broadcast Domain
+    tx_es1_evisV4_1_bd_1_mac_Pool1 = (tx_es1_evisV4_1_bd_1
+                                      .cmac_ip_range
+                                      .cmaciprange(l2vni=20)[-1])
+
+    tx_es1_evisV4_1_bd_1_mac_Pool1.name = "tx_mac_pool"
+    tx_es1_evisV4_1_bd_1_mac_Pool1.mac_addresses.address = "10:11:22:33:44:55"
+
+    # Adding 1 IP Range Per Broadcast Domain
+    tx_es1_evisV4_1_bd_1_mac_Pool1.ipv4_addresses.address = "192.168.0.1"
+
+    # Create BGP EVPN on rx
+    rx_vtep = config.devices.device(name='rx_vtep')[-1]
+    rx_vtep_bgp = rx_vtep.bgp
+    rx_vtep_bgp.router_id = "191.0.0.1"
+    rx_vtep_bgp_iface = (rx_vtep_bgp.ipv4_interfaces
+                         .v4interface(ipv4_name=rx_l1.name)[-1])
+    rx_vtep_bgp_peer = rx_vtep_bgp_iface.peers.v4peer(name="bgp2",
+                                                      peer_address='1.1.1.1',
+                                                      as_type='ibgp',
+                                                      as_number=101)[-1]
+
+    # Adding 1 Ethernet Segment per Bgp Peer
+    rx_vtep_es1 = rx_vtep_bgp_peer.evpn_ethernet_segments.ethernetsegment()[-1]
+
+    # Adding 1 EVI on the Ethernet Segment
+    rx_es1_evisV4_1 = rx_vtep_es1.evis.evi_vxlan()[-1]
+
+    rx_es1_evisV4_1.route_distinguisher.rd_type = (
+        rx_es1_evisV4_1.route_distinguisher.AS_2OCTET)
+    rx_es1_evisV4_1.route_distinguisher.rd_value = "1000:1"
+
+    export_rt = rx_es1_evisV4_1.route_target_export.routetarget()[-1]
+    import_rt = rx_es1_evisV4_1.route_target_import.routetarget()[-1]
+    export_rt.rt_type = export_rt.AS_2OCTET
+    export_rt.rt_value = "100:20"
+
+    import_rt.rt_type = import_rt.AS_2OCTET
+    import_rt.rt_value = "100:20"
+
+    # Adding 1 Broadcast Domain per EVI
+    rx_es1_evisV4_1_bd_1 = (rx_es1_evisV4_1
+                            .broadcast_domains
+                            .broadcastdomain()[-1])
+
+    # Adding 1 MAC Range Per Broadcast Domain
+    rx_es1_evisV4_1_bd_1_mac_Pool1 = (rx_es1_evisV4_1_bd_1
+                                      .cmac_ip_range
+                                      .cmaciprange(l2vni=20)[-1])
+    rx_es1_evisV4_1_bd_1_mac_Pool1.name = "rx_mac_pool"
+    rx_es1_evisV4_1_bd_1_mac_Pool1.mac_addresses.address = "10:11:22:33:44:77"
+
+    # Adding 1 IP Range Per Broadcast Domain
+    rx_es1_evisV4_1_bd_1_mac_Pool1.ipv4_addresses.address = "192.168.1.2"
+
+    f1 = config.flows.flow(name="f1")[-1]
+    f1.tx_rx.device.tx_names = [tx_es1_evisV4_1_bd_1_mac_Pool1.name]
+    f1.tx_rx.device.rx_names = [rx_es1_evisV4_1_bd_1_mac_Pool1.name]
+
+    f1.duration.fixed_packets.packets = 1000
+
+    f1.size.fixed = 1500
+    f1.metrics.enable = True
+    f1.metrics.loss = True
+
+    utils.start_traffic(api, config)
+
+    utils.wait_for(
+        lambda: results_ok(api, ["f1"], 1000),
+        "stats to be as expected",
+        timeout_seconds=10,
+    )
+    utils.stop_traffic(api, config)
+
+
+def results_ok(api, flow_names, expected):
+    """
+    Returns True if there is no traffic loss else False
+    """
+    request = api.metrics_request()
+    request.flow.flow_names = flow_names
+    flow_results = api.get_metrics(request).flow_metrics
+    flow_rx = sum([f.frames_rx for f in flow_results])
+    return flow_rx == expected
diff --git a/tests/bgp_evpn/test_bgp_evpn_attribute_validation.py b/tests/bgp_evpn/test_bgp_evpn_attribute_validation.py
new file mode 100644
index 000000000..dd051fbe9
--- /dev/null
+++ b/tests/bgp_evpn/test_bgp_evpn_attribute_validation.py
@@ -0,0 +1,428 @@
+import pytest
+
+
+def test_bgp_evpn_validation(api, utils):
+    "Validate BGP EVPN Attributes against RestPy"
+
+    BGPV4_EVPN_ETH_SEGMENT = {
+        "DfElectionTimer": 10,
+        "EsiValue": "1000000000000000",
+        "EsiLabel": 8,
+        "EnableSingleActive": "true",
+        "MultiExitDiscriminator": 5,
+        "EnableMultiExitDiscriminator": "true",
+        "Origin": "egp",
+        "EnableOrigin": "true",
+        "EnableCommunity": "true",
+        "EnableExtendedCommunity": "true",
+        "EnableAsPathSegments": "true",
+        "AsSetMode": "includelocalasasasset"
+    }
+
+    BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST = {
+        "Type": "manual",
+        "AsNumber": "8",
+        "LastTwoOctets": "8",
+    }
+
+    BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST = {
+        "Type": "opaque",
+        "SubType": "color",
+        "ColorValue": "200"
+    }
+
+    BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST = {
+        "SegmentType": "asseqconfederation",
+    }
+
+    BGPV4_EVPN_VXLAN = {
+        "AdRouteLabel": 10,
+        "UpstreamDownstreamAssignedMplsLabel": 20,
+        "RdASNumber": 1000,
+        "RdEvi": 10,
+        "MultiExitDiscriminator": 99
+    }
+
+    BGPV4_EVPN_VXLAN_EXPORT_TARGET = {
+        "TargetAs4Number": "100",
+        "TargetAssignedNumber": "20"
+    }
+
+    BGPV4_EVPN_VXLAN_IMPORT_TARGET = {
+        "TargetAs4Number": "200",
+        "TargetAssignedNumber": "30"
+    }
+
+    BGPV4_EVPN_VXLAN_L3_EXPORT_TARGET = {
+        "TargetAs4Number": "300",
+        "TargetAssignedNumber": "50"
+    }
+
+    BGPV4_EVPN_VXLAN_L3_IMPORT_TARGET = {
+        "TargetAs4Number": "400",
+        "TargetAssignedNumber": "60"
+    }
+
+    BROADCAST_DOMAIN = {
+        "EthernetTagId": "5",
+        "EnableVlanAwareService": "true"
+    }
+
+    MAC_ADDRESS = {
+        "Mac": "10:11:22:33:44:55",
+        "PrefixLength": "48",
+        "NumberOfAddressesAsy": "1"
+    }
+
+    IP_ADDRESS = {
+        "NetworkAddress": "2.2.2.2",
+        "PrefixLength": "24",
+        "NumberOfAddressesAsy": "1"
+    }
+
+    IPV6_ADDRESS = {
+        "NetworkAddress": "2000:0:2:1::1",
+        "PrefixLength": "64",
+        "NumberOfAddressesAsy": "1"
+    }
+
+    CMAC_PROPERTIES = {
+        "FirstLabelStart": "16",
+        "SecondLabelStart": "20",
+        "MultiExitDiscriminator": "37",
+        "IncludeDefaultGatewayExtendedCommunity": "true"
+    }
+
+    # Creating Ports
+    config = api.config()
+    p1 = config.ports.port(name='p1', location=utils.settings.ports[0])[-1]
+    # Create BGP devices on tx
+    tx_d = config.devices.device(name='tx_d')[-1]
+    tx_eth = tx_d.ethernets.ethernet(port_name=p1.name)[-1]
+    tx_eth.name = 'tx_eth'
+    tx_eth.mac = '00:11:00:00:00:01'
+    tx_ip = tx_eth.ipv4_addresses.ipv4(name='tx_ip',
+                                       address='20.20.20.2',
+                                       gateway='20.20.20.1')[-1]
+
+    # tx_bgp
+    tx_bgp = tx_d.bgp
+    tx_bgp.router_id = "192.0.0.1"
+    tx_bgp_iface = (tx_bgp.ipv4_interfaces
+                    .v4interface(ipv4_name=tx_ip.name)[-1])
+    tx_bgp_peer = tx_bgp_iface.peers.v4peer(name="tx_eBGP",
+                                            peer_address='20.20.20.1',
+                                            as_type='ebgp',
+                                            as_number=100)[-1]
+
+    # Create & advertise loopback under bgp in tx and rx
+    tx_l1 = tx_d.ipv4_loopbacks.add()
+    tx_l1.name = "tx_loopback1"
+    tx_l1.eth_name = "tx_eth"
+    tx_l1.address = "1.1.1.1"
+    tx_l1_r = tx_bgp_peer.v4_routes.add(name="tx_l1")
+    tx_l1_r.addresses.add(address="1.1.1.1", prefix=32)
+
+    # Create BGP EVPN on tx
+    tx_vtep = config.devices.device(name='tx_vtep')[-1]
+    tx_vtep_bgp = tx_vtep.bgp
+    tx_vtep_bgp.router_id = "190.0.0.1"
+    tx_vtep_bgp_iface = (tx_vtep_bgp.ipv4_interfaces
+                         .v4interface(ipv4_name=tx_l1.name)[-1])
+    tx_vtep_bgp_peer = tx_vtep_bgp_iface.peers.v4peer(name="bgp1",
+                                                      peer_address='2.2.2.2',
+                                                      as_type='ibgp',
+                                                      as_number=101)[-1]
+
+    tx_eth_seg = tx_vtep_bgp_peer.evpn_ethernet_segments.ethernetsegment()[-1]
+    tx_eth_seg.df_election.election_timer = (
+        BGPV4_EVPN_ETH_SEGMENT["DfElectionTimer"])
+    tx_eth_seg.esi = BGPV4_EVPN_ETH_SEGMENT["EsiValue"]
+    tx_eth_seg.esi_label = BGPV4_EVPN_ETH_SEGMENT["EsiLabel"]
+    tx_eth_seg.active_mode = tx_eth_seg.SINGLE_ACTIVE
+    tx_eth_seg.advanced.origin = tx_eth_seg.advanced.EGP
+    tx_eth_seg.advanced.multi_exit_discriminator = (
+        BGPV4_EVPN_ETH_SEGMENT["MultiExitDiscriminator"])
+    tx_eth_seg_community = tx_eth_seg.communities.add()
+    tx_eth_seg_community.type = tx_eth_seg_community.MANUAL_AS_NUMBER
+    tx_eth_seg_community.as_number = int(
+        BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["AsNumber"])
+    tx_eth_seg_community.as_custom = int(
+        BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["LastTwoOctets"])
+    tx_eth_seg_ext_community = tx_eth_seg.ext_communities.add()
+    tx_eth_seg_ext_community.type = "opaque"
+    tx_eth_seg_ext_community.subtype = "color"
+    tx_eth_seg_ext_community.value = "0000000000C8"
+    tx_eth_seg.as_path.as_set_mode = "include_as_set"
+    tx_eth_seg.as_path.segments.add("as_confed_seq", [2, 3])
+
+    # Adding Tx EVI on the Ethernet Segment
+    tx_evi_vxlan = tx_eth_seg.evis.evi_vxlan()[-1]
+    tx_evi_vxlan.route_distinguisher.rd_type = (
+        tx_evi_vxlan.route_distinguisher.AS_2OCTET)
+    tx_evi_vxlan.route_distinguisher.rd_value = (
+        str(BGPV4_EVPN_VXLAN["RdASNumber"]) + ":" + str(
+            BGPV4_EVPN_VXLAN["RdEvi"]))
+    tx_evi_vxlan.ad_label = BGPV4_EVPN_VXLAN["AdRouteLabel"]
+    tx_evi_vxlan.pmsi_label = (
+        BGPV4_EVPN_VXLAN["UpstreamDownstreamAssignedMplsLabel"])
+
+    export_rt = tx_evi_vxlan.route_target_export.routetarget()[-1]
+    import_rt = tx_evi_vxlan.route_target_import.routetarget()[-1]
+    export_rt.rt_type = export_rt.AS_4OCTET
+    export_rt.rt_value = (
+        BGPV4_EVPN_VXLAN_EXPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV4_EVPN_VXLAN_EXPORT_TARGET[
+                "TargetAssignedNumber"])
+    import_rt.rt_type = import_rt.AS_4OCTET
+    import_rt.rt_value = (
+        BGPV4_EVPN_VXLAN_IMPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV4_EVPN_VXLAN_IMPORT_TARGET[
+                "TargetAssignedNumber"])
+
+    l3_export_rt = tx_evi_vxlan.l3_route_target_export.routetarget()[-1]
+    l3_import_rt = tx_evi_vxlan.l3_route_target_import.routetarget()[-1]
+    l3_export_rt.rt_type = l3_export_rt.AS_4OCTET
+    l3_export_rt.rt_value = (
+        BGPV4_EVPN_VXLAN_L3_EXPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV4_EVPN_VXLAN_L3_EXPORT_TARGET[
+                "TargetAssignedNumber"])
+    l3_import_rt.rt_type = l3_import_rt.AS_4OCTET
+    l3_import_rt.rt_value = (
+        BGPV4_EVPN_VXLAN_L3_IMPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV4_EVPN_VXLAN_L3_IMPORT_TARGET[
+                "TargetAssignedNumber"])
+
+    tx_evi_vxlan.advanced.origin = tx_evi_vxlan.advanced.EGP
+    tx_evi_vxlan.advanced.multi_exit_discriminator = (
+        BGPV4_EVPN_VXLAN["MultiExitDiscriminator"])
+    tx_evi_vxlan_comm = tx_evi_vxlan.communities.add()
+    tx_evi_vxlan_comm.type = tx_evi_vxlan_comm.MANUAL_AS_NUMBER
+    tx_evi_vxlan_comm.as_number = int(
+        BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["AsNumber"])
+    tx_evi_vxlan_comm.as_custom = int(
+        BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["LastTwoOctets"])
+    tx_evi_vxlan_ext_comm = tx_evi_vxlan.ext_communities.add()
+    tx_evi_vxlan_ext_comm.type = "opaque"
+    tx_evi_vxlan_ext_comm.subtype = "color"
+    tx_evi_vxlan_ext_comm.value = "0000000000C8"
+    tx_evi_vxlan.as_path.segments.add("as_confed_seq", [9, 10])
+
+    # Adding tx Broadcast Domain per EVI and MAC range
+    tx_evpn_brodcast_domain = (
+        tx_evi_vxlan.broadcast_domains.broadcastdomain()[-1])
+    tx_evpn_brodcast_domain.ethernet_tag_id = int(
+        BROADCAST_DOMAIN["EthernetTagId"])
+    tx_evpn_brodcast_domain.vlan_aware_service = True
+    tx_broadcast_macrange = (
+        tx_evpn_brodcast_domain.cmac_ip_range.cmaciprange(
+            l2vni=16, l3vni=20, name="tx_cmaciprange",
+            include_default_gateway=True)[-1])
+    tx_broadcast_macrange.mac_addresses.address = MAC_ADDRESS["Mac"]
+    tx_broadcast_macrange.ipv4_addresses.address = IP_ADDRESS["NetworkAddress"]
+    tx_broadcast_macrange.ipv6_addresses.address = (
+        IPV6_ADDRESS["NetworkAddress"])
+
+    tx_broadcast_macrange.advanced.multi_exit_discriminator = int(
+        CMAC_PROPERTIES["MultiExitDiscriminator"])
+
+    cmac_comm = tx_broadcast_macrange.communities.add()
+    cmac_comm.type = cmac_comm.MANUAL_AS_NUMBER
+    cmac_comm.as_number = int(
+        BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["AsNumber"])
+    cmac_comm.as_custom = int(
+        BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["LastTwoOctets"])
+    cmac_ext_comm = tx_broadcast_macrange.ext_communities.add()
+    cmac_ext_comm.type = "opaque"
+    cmac_ext_comm.subtype = "color"
+    cmac_ext_comm.value = "0000000000C8"
+    tx_broadcast_macrange.as_path.segments.add("as_confed_seq", [9, 10])
+
+    api.set_config(config)
+
+    validate_config(api,
+                    BGPV4_EVPN_ETH_SEGMENT,
+                    BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST,
+                    BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST,
+                    BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST,
+                    BGPV4_EVPN_VXLAN,
+                    BGPV4_EVPN_VXLAN_EXPORT_TARGET,
+                    BGPV4_EVPN_VXLAN_IMPORT_TARGET,
+                    BGPV4_EVPN_VXLAN_L3_EXPORT_TARGET,
+                    BGPV4_EVPN_VXLAN_L3_IMPORT_TARGET,
+                    BROADCAST_DOMAIN,
+                    MAC_ADDRESS,
+                    IP_ADDRESS,
+                    IPV6_ADDRESS,
+                    CMAC_PROPERTIES)
+
+
+def validate_config(api,
+                    BGPV4_EVPN_ETH_SEGMENT,
+                    BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST,
+                    BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST,
+                    BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST,
+                    BGPV4_EVPN_VXLAN,
+                    BGPV4_EVPN_VXLAN_EXPORT_TARGET,
+                    BGPV4_EVPN_VXLAN_IMPORT_TARGET,
+                    BGPV4_EVPN_VXLAN_L3_EXPORT_TARGET,
+                    BGPV4_EVPN_VXLAN_L3_IMPORT_TARGET,
+                    BROADCAST_DOMAIN,
+                    MAC_ADDRESS,
+                    IP_ADDRESS,
+                    IPV6_ADDRESS,
+                    CMAC_PROPERTIES):
+    ixn = api._ixnetwork
+    bgps = (
+        ixn.Topology.find().DeviceGroup.find()
+        .DeviceGroup.find().Ipv4Loopback.find().BgpIpv4Peer.find())
+    for bgp in bgps:
+        assert bgp.EthernetSegmentsCountV4 == 1
+        assert bgp.BgpEthernetSegmentV4.EvisCount == 1
+        evis = bgp.BgpIPv4EvpnVXLAN.find()
+        assert evis.Multiplier == 1
+
+    bgp_eth_seg = bgps[0].BgpEthernetSegmentV4
+    for attr in BGPV4_EVPN_ETH_SEGMENT:
+        if attr in ["DfElectionTimer", "EsiLabel",
+                    "MultiExitDiscriminator"]:
+            assert BGPV4_EVPN_ETH_SEGMENT[attr] == int(
+                (getattr(bgp_eth_seg, attr).Values)[0]
+            )
+        else:
+            assert BGPV4_EVPN_ETH_SEGMENT[attr] == (
+                (getattr(bgp_eth_seg, attr).Values)[0]
+            )
+
+    bgp_eth_seg_comm_list = (
+        bgps[0].BgpEthernetSegmentV4.BgpCommunitiesList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_ext_comm_list = (
+        bgps[0].BgpEthernetSegmentV4.BgpExtendedCommunitiesList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_ext_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_aspath_segments_list = (
+        bgps[0].BgpEthernetSegmentV4.BgpAsPathSegmentList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST[attr] == (
+            (getattr(bgp_eth_seg_aspath_segments_list, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan = bgps[0].BgpIPv4EvpnVXLAN.find()
+    for attr in BGPV4_EVPN_VXLAN:
+        assert BGPV4_EVPN_VXLAN[attr] == int(
+            (getattr(bgp_evpn_vxlan, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_export_target = (
+        bgp_evpn_vxlan.BgpExportRouteTargetList.find())
+    for attr in BGPV4_EVPN_VXLAN_EXPORT_TARGET:
+        assert BGPV4_EVPN_VXLAN_EXPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_export_target, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_import_target = (
+        bgp_evpn_vxlan.BgpImportRouteTargetList.find())
+    for attr in BGPV4_EVPN_VXLAN_IMPORT_TARGET:
+        assert BGPV4_EVPN_VXLAN_IMPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_import_target, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_l3_export_target = (
+        bgp_evpn_vxlan.BgpL3VNIExportRouteTargetList.find())
+    for attr in BGPV4_EVPN_VXLAN_L3_EXPORT_TARGET:
+        assert BGPV4_EVPN_VXLAN_L3_EXPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_l3_export_target, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_l3_import_target = (
+        bgp_evpn_vxlan.BgpL3VNIImportRouteTargetList.find())
+    for attr in BGPV4_EVPN_VXLAN_L3_IMPORT_TARGET:
+        assert BGPV4_EVPN_VXLAN_L3_IMPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_l3_import_target, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_comm_list = (
+        bgps[0].BgpIPv4EvpnVXLAN.find().BgpCommunitiesList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_vxlan_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_ext_comm_list = (
+        bgps[0].BgpIPv4EvpnVXLAN.find().BgpExtendedCommunitiesList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_vxlan_ext_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_aspath_segments_list = (
+        bgps[0].BgpIPv4EvpnVXLAN.find().BgpAsPathSegmentList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST[attr] == (
+            (getattr(bgp_eth_seg_vxlan_aspath_segments_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_broadcast_domain = (
+        bgps[0].BgpIPv4EvpnVXLAN.find().BroadcastDomainV4)
+    for attr in BROADCAST_DOMAIN:
+        assert BROADCAST_DOMAIN[attr] == (
+            (getattr(bgp_eth_seg_vxlan_broadcast_domain, attr).Values)[0]
+        )
+
+    mac = (ixn.Topology.find().DeviceGroup.find()
+           .DeviceGroup.find().NetworkGroup.find().MacPools.find())
+    for attr in MAC_ADDRESS:
+        assert MAC_ADDRESS[attr] == (
+            (getattr(mac, attr).Values)[0]
+        )
+
+    ipv4 = (mac.Ipv4PrefixPools.find())
+    for attr in IP_ADDRESS:
+        assert IP_ADDRESS[attr] == (
+            (getattr(ipv4, attr).Values)[0]
+        )
+
+    ipv6 = (mac.Ipv6PrefixPools.find())
+    for attr in IPV6_ADDRESS:
+        assert IPV6_ADDRESS[attr] == (
+            (getattr(ipv6, attr).Values)[0]
+        )
+
+    cmac = (mac.CMacProperties.find())
+    for attr in CMAC_PROPERTIES:
+        assert CMAC_PROPERTIES[attr] == (
+            (getattr(cmac, attr).Values)[0]
+        )
+
+    cmac_comm_list = (
+        cmac.BgpCommunitiesList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_COMMUNITIES_lIST[attr] == (
+            (getattr(cmac_comm_list, attr).Values)[0]
+        )
+
+    cmac_ext_comm_list = (
+        cmac.BgpExtendedCommunitiesList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST[attr] == (
+            (getattr(cmac_ext_comm_list, attr).Values)[0]
+        )
+
+    cmac_aspath_segments_list = (
+        cmac.BgpAsPathSegmentList.find())
+    for attr in BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST:
+        assert BGPV4_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST[attr] == (
+            (getattr(cmac_aspath_segments_list, attr).Values)[0]
+        )
+
+
+if __name__ == "__main__":
+    pytest.main(["-s", __file__])
diff --git a/tests/bgp_evpn/test_bgpv6_evpn_attribute_validation.py b/tests/bgp_evpn/test_bgpv6_evpn_attribute_validation.py
new file mode 100644
index 000000000..2a73adfb4
--- /dev/null
+++ b/tests/bgp_evpn/test_bgpv6_evpn_attribute_validation.py
@@ -0,0 +1,428 @@
+import pytest
+
+
+def test_bgpv6_evpn_validation(api, utils):
+    "Validate BGP EVPN Attributes against RestPy"
+
+    BGPV6_EVPN_ETH_SEGMENT = {
+        "DfElectionTimer": 10,
+        "EsiValue": "1000000000000000",
+        "EsiLabel": 8,
+        "EnableSingleActive": "true",
+        "MultiExitDiscriminator": 5,
+        "EnableMultiExitDiscriminator": "true",
+        "Origin": "egp",
+        "EnableOrigin": "true",
+        "EnableCommunity": "true",
+        "EnableExtendedCommunity": "true",
+        "EnableAsPathSegments": "true",
+        "AsSetMode": "includelocalasasasset"
+    }
+
+    BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST = {
+        "Type": "manual",
+        "AsNumber": "8",
+        "LastTwoOctets": "8",
+    }
+
+    BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST = {
+        "Type": "opaque",
+        "SubType": "color",
+        "ColorValue": "200"
+    }
+
+    BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST = {
+        "SegmentType": "asseqconfederation",
+    }
+
+    BGPV6_EVPN_VXLAN = {
+        "AdRouteLabel": 10,
+        "UpstreamDownstreamAssignedMplsLabel": 20,
+        "RdASNumber": 1000,
+        "RdEvi": 10,
+        "MultiExitDiscriminator": 99
+    }
+
+    BGPV6_EVPN_VXLAN_EXPORT_TARGET = {
+        "TargetAs4Number": "100",
+        "TargetAssignedNumber": "20"
+    }
+
+    BGPV6_EVPN_VXLAN_IMPORT_TARGET = {
+        "TargetAs4Number": "200",
+        "TargetAssignedNumber": "30"
+    }
+
+    BGPV6_EVPN_VXLAN_L3_EXPORT_TARGET = {
+        "TargetAs4Number": "300",
+        "TargetAssignedNumber": "50"
+    }
+
+    BGPV6_EVPN_VXLAN_L3_IMPORT_TARGET = {
+        "TargetAs4Number": "400",
+        "TargetAssignedNumber": "60"
+    }
+
+    BROADCAST_DOMAIN = {
+        "EthernetTagId": "5",
+        "EnableVlanAwareService": "true"
+    }
+
+    MAC_ADDRESS = {
+        "Mac": "10:11:22:33:44:55",
+        "PrefixLength": "48",
+        "NumberOfAddressesAsy": "1"
+    }
+
+    IP_ADDRESS = {
+        "NetworkAddress": "2.2.2.2",
+        "PrefixLength": "24",
+        "NumberOfAddressesAsy": "1"
+    }
+
+    IPV6_ADDRESS = {
+        "NetworkAddress": "2000:0:2:1::1",
+        "PrefixLength": "64",
+        "NumberOfAddressesAsy": "1"
+    }
+
+    CMAC_PROPERTIES = {
+        "FirstLabelStart": "16",
+        "SecondLabelStart": "20",
+        "MultiExitDiscriminator": "37",
+        "IncludeDefaultGatewayExtendedCommunity": "true"
+    }
+
+    # Creating Ports
+    config = api.config()
+    p1 = config.ports.port(name='p1', location=utils.settings.ports[0])[-1]
+    # Create BGP devices on tx
+    tx_d = config.devices.device(name='tx_d')[-1]
+    tx_eth = tx_d.ethernets.ethernet(port_name=p1.name)[-1]
+    tx_eth.name = 'tx_eth'
+    tx_eth.mac = '00:11:00:00:00:01'
+    tx_ip = tx_eth.ipv6_addresses.ipv6(name='tx_ip',
+                                       address='2000::2',
+                                       gateway='2000::1')[-1]
+
+    # tx_bgp
+    tx_bgp = tx_d.bgp
+    tx_bgp.router_id = "192.0.0.1"
+    tx_bgp_iface = (tx_bgp.ipv6_interfaces
+                    .v6interface(ipv6_name=tx_ip.name)[-1])
+    tx_bgp_peer = tx_bgp_iface.peers.v6peer(name="tx_eBGP",
+                                            peer_address='2000::1',
+                                            as_type='ebgp',
+                                            as_number=100)[-1]
+
+    # Create & advertise loopback under bgp in tx and rx
+    tx_l1 = tx_d.ipv6_loopbacks.add()
+    tx_l1.name = "tx_loopback1"
+    tx_l1.eth_name = "tx_eth"
+    tx_l1.address = "2222::1"
+    tx_l1_r = tx_bgp_peer.v6_routes.add(name="tx_l1")
+    tx_l1_r.addresses.add(address="2222::1", prefix=64)
+
+    # Create BGP EVPN on tx
+    tx_vtep = config.devices.device(name='tx_vtep')[-1]
+    tx_vtep_bgp = tx_vtep.bgp
+    tx_vtep_bgp.router_id = "190.0.0.1"
+    tx_vtep_bgp_iface = (tx_vtep_bgp.ipv6_interfaces
+                         .v6interface(ipv6_name=tx_l1.name)[-1])
+    tx_vtep_bgp_peer = tx_vtep_bgp_iface.peers.v6peer(name="bgp1",
+                                                      peer_address='2000::1',
+                                                      as_type='ibgp',
+                                                      as_number=101)[-1]
+
+    tx_eth_seg = tx_vtep_bgp_peer.evpn_ethernet_segments.ethernetsegment()[-1]
+    tx_eth_seg.df_election.election_timer = (
+        BGPV6_EVPN_ETH_SEGMENT["DfElectionTimer"])
+    tx_eth_seg.esi = BGPV6_EVPN_ETH_SEGMENT["EsiValue"]
+    tx_eth_seg.esi_label = BGPV6_EVPN_ETH_SEGMENT["EsiLabel"]
+    tx_eth_seg.active_mode = tx_eth_seg.SINGLE_ACTIVE
+    tx_eth_seg.advanced.origin = tx_eth_seg.advanced.EGP
+    tx_eth_seg.advanced.multi_exit_discriminator = (
+        BGPV6_EVPN_ETH_SEGMENT["MultiExitDiscriminator"])
+    tx_eth_seg_community = tx_eth_seg.communities.add()
+    tx_eth_seg_community.type = tx_eth_seg_community.MANUAL_AS_NUMBER
+    tx_eth_seg_community.as_number = int(
+        BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["AsNumber"])
+    tx_eth_seg_community.as_custom = int(
+        BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["LastTwoOctets"])
+    tx_eth_seg_ext_community = tx_eth_seg.ext_communities.add()
+    tx_eth_seg_ext_community.type = "opaque"
+    tx_eth_seg_ext_community.subtype = "color"
+    tx_eth_seg_ext_community.value = "0000000000C8"
+    tx_eth_seg.as_path.as_set_mode = "include_as_set"
+    tx_eth_seg.as_path.segments.add("as_confed_seq", [2, 3])
+
+    # Adding Tx EVI on the Ethernet Segment
+    tx_evi_vxlan = tx_eth_seg.evis.evi_vxlan()[-1]
+    tx_evi_vxlan.route_distinguisher.rd_type = (
+        tx_evi_vxlan.route_distinguisher.AS_2OCTET)
+    tx_evi_vxlan.route_distinguisher.rd_value = (
+        str(BGPV6_EVPN_VXLAN["RdASNumber"]) + ":" + str(
+            BGPV6_EVPN_VXLAN["RdEvi"]))
+    tx_evi_vxlan.ad_label = BGPV6_EVPN_VXLAN["AdRouteLabel"]
+    tx_evi_vxlan.pmsi_label = (
+        BGPV6_EVPN_VXLAN["UpstreamDownstreamAssignedMplsLabel"])
+
+    export_rt = tx_evi_vxlan.route_target_export.routetarget()[-1]
+    import_rt = tx_evi_vxlan.route_target_import.routetarget()[-1]
+    export_rt.rt_type = export_rt.AS_4OCTET
+    export_rt.rt_value = (
+        BGPV6_EVPN_VXLAN_EXPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV6_EVPN_VXLAN_EXPORT_TARGET[
+                "TargetAssignedNumber"])
+    import_rt.rt_type = import_rt.AS_4OCTET
+    import_rt.rt_value = (
+        BGPV6_EVPN_VXLAN_IMPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV6_EVPN_VXLAN_IMPORT_TARGET[
+                "TargetAssignedNumber"])
+
+    l3_export_rt = tx_evi_vxlan.l3_route_target_export.routetarget()[-1]
+    l3_import_rt = tx_evi_vxlan.l3_route_target_import.routetarget()[-1]
+    l3_export_rt.rt_type = l3_export_rt.AS_4OCTET
+    l3_export_rt.rt_value = (
+        BGPV6_EVPN_VXLAN_L3_EXPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV6_EVPN_VXLAN_L3_EXPORT_TARGET[
+                "TargetAssignedNumber"])
+    l3_import_rt.rt_type = l3_import_rt.AS_4OCTET
+    l3_import_rt.rt_value = (
+        BGPV6_EVPN_VXLAN_L3_IMPORT_TARGET[
+            "TargetAs4Number"] + ":" + BGPV6_EVPN_VXLAN_L3_IMPORT_TARGET[
+                "TargetAssignedNumber"])
+
+    tx_evi_vxlan.advanced.origin = tx_evi_vxlan.advanced.EGP
+    tx_evi_vxlan.advanced.multi_exit_discriminator = (
+        BGPV6_EVPN_VXLAN["MultiExitDiscriminator"])
+    tx_evi_vxlan_comm = tx_evi_vxlan.communities.add()
+    tx_evi_vxlan_comm.type = tx_evi_vxlan_comm.MANUAL_AS_NUMBER
+    tx_evi_vxlan_comm.as_number = (
+        BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["AsNumber"])
+    tx_evi_vxlan_comm.as_custom = (
+        BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["LastTwoOctets"])
+    tx_evi_vxlan_ext_comm = tx_evi_vxlan.ext_communities.add()
+    tx_evi_vxlan_ext_comm.type = "opaque"
+    tx_evi_vxlan_ext_comm.subtype = "color"
+    tx_evi_vxlan_ext_comm.value = "0000000000C8"
+    tx_evi_vxlan.as_path.segments.add("as_confed_seq", [9, 10])
+
+    # Adding tx Broadcast Domain per EVI and MAC range
+    tx_evpn_brodcast_domain = (
+        tx_evi_vxlan.broadcast_domains.broadcastdomain()[-1])
+    tx_evpn_brodcast_domain.ethernet_tag_id = int(
+        BROADCAST_DOMAIN["EthernetTagId"])
+    tx_evpn_brodcast_domain.vlan_aware_service = True
+    tx_broadcast_macrange = (
+        tx_evpn_brodcast_domain.cmac_ip_range.cmaciprange(
+            l2vni=16, l3vni=20, name="tx_cmaciprange",
+            include_default_gateway=True)[-1])
+    tx_broadcast_macrange.mac_addresses.address = MAC_ADDRESS["Mac"]
+    tx_broadcast_macrange.ipv4_addresses.address = IP_ADDRESS["NetworkAddress"]
+    tx_broadcast_macrange.ipv6_addresses.address = (
+        IPV6_ADDRESS["NetworkAddress"])
+
+    tx_broadcast_macrange.advanced.multi_exit_discriminator = int(
+        CMAC_PROPERTIES["MultiExitDiscriminator"])
+
+    cmac_comm = tx_broadcast_macrange.communities.add()
+    cmac_comm.type = cmac_comm.MANUAL_AS_NUMBER
+    cmac_comm.as_number = (
+        BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["AsNumber"])
+    cmac_comm.as_custom = (
+        BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST["LastTwoOctets"])
+    cmac_ext_comm = tx_broadcast_macrange.ext_communities.add()
+    cmac_ext_comm.type = "opaque"
+    cmac_ext_comm.subtype = "color"
+    cmac_ext_comm.value = "0000000000C8"
+    tx_broadcast_macrange.as_path.segments.add("as_confed_seq", [9, 10])
+
+    api.set_config(config)
+
+    validate_config(api,
+                    BGPV6_EVPN_ETH_SEGMENT,
+                    BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST,
+                    BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST,
+                    BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST,
+                    BGPV6_EVPN_VXLAN,
+                    BGPV6_EVPN_VXLAN_EXPORT_TARGET,
+                    BGPV6_EVPN_VXLAN_IMPORT_TARGET,
+                    BGPV6_EVPN_VXLAN_L3_EXPORT_TARGET,
+                    BGPV6_EVPN_VXLAN_L3_IMPORT_TARGET,
+                    BROADCAST_DOMAIN,
+                    MAC_ADDRESS,
+                    IP_ADDRESS,
+                    IPV6_ADDRESS,
+                    CMAC_PROPERTIES)
+
+
+def validate_config(api,
+                    BGPV6_EVPN_ETH_SEGMENT,
+                    BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST,
+                    BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST,
+                    BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST,
+                    BGPV6_EVPN_VXLAN,
+                    BGPV6_EVPN_VXLAN_EXPORT_TARGET,
+                    BGPV6_EVPN_VXLAN_IMPORT_TARGET,
+                    BGPV6_EVPN_VXLAN_L3_EXPORT_TARGET,
+                    BGPV6_EVPN_VXLAN_L3_IMPORT_TARGET,
+                    BROADCAST_DOMAIN,
+                    MAC_ADDRESS,
+                    IP_ADDRESS,
+                    IPV6_ADDRESS,
+                    CMAC_PROPERTIES):
+    ixn = api._ixnetwork
+    bgps = (
+        ixn.Topology.find().DeviceGroup.find()
+        .DeviceGroup.find().Ipv6Loopback.find().BgpIpv6Peer.find())
+    for bgp in bgps:
+        assert bgp.EthernetSegmentsCountV6 == 1
+        assert bgp.BgpEthernetSegmentV6.EvisCount == 1
+        evis = bgp.BgpIPv6EvpnVXLAN.find()
+        assert evis.Multiplier == 1
+
+    bgp_eth_seg = bgps[0].BgpEthernetSegmentV6
+    for attr in BGPV6_EVPN_ETH_SEGMENT:
+        if attr in ["DfElectionTimer", "EsiLabel",
+                    "MultiExitDiscriminator"]:
+            assert BGPV6_EVPN_ETH_SEGMENT[attr] == int(
+                (getattr(bgp_eth_seg, attr).Values)[0]
+            )
+        else:
+            assert BGPV6_EVPN_ETH_SEGMENT[attr] == (
+                (getattr(bgp_eth_seg, attr).Values)[0]
+            )
+
+    bgp_eth_seg_comm_list = (
+        bgps[0].BgpEthernetSegmentV6.BgpCommunitiesList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_ext_comm_list = (
+        bgps[0].BgpEthernetSegmentV6.BgpExtendedCommunitiesList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_ext_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_aspath_segments_list = (
+        bgps[0].BgpEthernetSegmentV6.BgpAsPathSegmentList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST[attr] == (
+            (getattr(bgp_eth_seg_aspath_segments_list, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan = bgps[0].BgpIPv6EvpnVXLAN.find()
+    for attr in BGPV6_EVPN_VXLAN:
+        assert BGPV6_EVPN_VXLAN[attr] == int(
+            (getattr(bgp_evpn_vxlan, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_export_target = (
+        bgp_evpn_vxlan.BgpExportRouteTargetList.find())
+    for attr in BGPV6_EVPN_VXLAN_EXPORT_TARGET:
+        assert BGPV6_EVPN_VXLAN_EXPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_export_target, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_import_target = (
+        bgp_evpn_vxlan.BgpImportRouteTargetList.find())
+    for attr in BGPV6_EVPN_VXLAN_IMPORT_TARGET:
+        assert BGPV6_EVPN_VXLAN_IMPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_import_target, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_l3_export_target = (
+        bgp_evpn_vxlan.BgpL3VNIExportRouteTargetList.find())
+    for attr in BGPV6_EVPN_VXLAN_L3_EXPORT_TARGET:
+        assert BGPV6_EVPN_VXLAN_L3_EXPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_l3_export_target, attr).Values)[0]
+        )
+
+    bgp_evpn_vxlan_l3_import_target = (
+        bgp_evpn_vxlan.BgpL3VNIImportRouteTargetList.find())
+    for attr in BGPV6_EVPN_VXLAN_L3_IMPORT_TARGET:
+        assert BGPV6_EVPN_VXLAN_L3_IMPORT_TARGET[attr] == (
+            (getattr(bgp_evpn_vxlan_l3_import_target, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_comm_list = (
+        bgps[0].BgpIPv6EvpnVXLAN.find().BgpCommunitiesList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_vxlan_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_ext_comm_list = (
+        bgps[0].BgpIPv6EvpnVXLAN.find().BgpExtendedCommunitiesList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST[attr] == (
+            (getattr(bgp_eth_seg_vxlan_ext_comm_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_aspath_segments_list = (
+        bgps[0].BgpIPv6EvpnVXLAN.find().BgpAsPathSegmentList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST[attr] == (
+            (getattr(bgp_eth_seg_vxlan_aspath_segments_list, attr).Values)[0]
+        )
+
+    bgp_eth_seg_vxlan_broadcast_domain = (
+        bgps[0].BgpIPv6EvpnVXLAN.find().BroadcastDomainV6)
+    for attr in BROADCAST_DOMAIN:
+        assert BROADCAST_DOMAIN[attr] == (
+            (getattr(bgp_eth_seg_vxlan_broadcast_domain, attr).Values)[0]
+        )
+
+    mac = (ixn.Topology.find().DeviceGroup.find()
+           .DeviceGroup.find().NetworkGroup.find().MacPools.find())
+    for attr in MAC_ADDRESS:
+        assert MAC_ADDRESS[attr] == (
+            (getattr(mac, attr).Values)[0]
+        )
+
+    ipv4 = (mac.Ipv4PrefixPools.find())
+    for attr in IP_ADDRESS:
+        assert IP_ADDRESS[attr] == (
+            (getattr(ipv4, attr).Values)[0]
+        )
+
+    ipv6 = (mac.Ipv6PrefixPools.find())
+    for attr in IPV6_ADDRESS:
+        assert IPV6_ADDRESS[attr] == (
+            (getattr(ipv6, attr).Values)[0]
+        )
+
+    cmac = (mac.CMacProperties.find())
+    for attr in CMAC_PROPERTIES:
+        assert CMAC_PROPERTIES[attr] == (
+            (getattr(cmac, attr).Values)[0]
+        )
+
+    cmac_comm_list = (
+        cmac.BgpCommunitiesList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_COMMUNITIES_lIST[attr] == (
+            (getattr(cmac_comm_list, attr).Values)[0]
+        )
+
+    cmac_ext_comm_list = (
+        cmac.BgpExtendedCommunitiesList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_EXT_COMMUNITIES_lIST[attr] == (
+            (getattr(cmac_ext_comm_list, attr).Values)[0]
+        )
+
+    cmac_aspath_segments_list = (
+        cmac.BgpAsPathSegmentList.find())
+    for attr in BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST:
+        assert BGPV6_EVPN_ETH_SEGMENT_ASPATH_SEGMENTS_lIST[attr] == (
+            (getattr(cmac_aspath_segments_list, attr).Values)[0]
+        )
+
+
+if __name__ == "__main__":
+    pytest.main(["-s", __file__])
diff --git a/tests/test_flow_tracking.py b/tests/test_flow_tracking.py
index af640fa0a..8597e49ec 100644
--- a/tests/test_flow_tracking.py
+++ b/tests/test_flow_tracking.py
@@ -17,6 +17,9 @@ def test_flow_tracking_stats(api, utils):
     layer1.speed = "speed_100_gbps"
     layer1.media = "copper"
     layer1.name = "test"
+
+    config.options.port_options.location_preemption = True
+    
     d1, d2, d3, d4 = (
         config.devices.device(name="Device1")
         .device(name="Device2")