From f90f1cae7d83a8e73be83fcc379e0d636ee83fdb Mon Sep 17 00:00:00 2001 From: takishida <38262981+takishida@users.noreply.github.com> Date: Wed, 15 May 2024 09:34:36 -0700 Subject: [PATCH 01/15] L3Out loopback IP should not overlap with existing subnet (#119) * Add l3out_overlapping_loopback_check * Add IPv6 handling in class IPAddress * ipv6_to_binary() as staticmethod --------- Co-authored-by: gmonroy --- aci-preupgrade-validation-script.py | 159 ++- docs/docs/validations.md | 79 +- .../diff_l3out_loopback.json | 860 ++++++++++++++++ .../diff_l3out_loopback_and_rtrId.json | 862 ++++++++++++++++ .../diff_l3out_rtrId.json | 864 ++++++++++++++++ .../no_overlap.json | 864 ++++++++++++++++ .../overlap_on_diff_nodes.json | 945 ++++++++++++++++++ .../same_l3out_loopback.json | 718 +++++++++++++ .../same_l3out_loopback_and_rtrId.json | 768 ++++++++++++++ .../same_l3out_rtrId.json | 797 +++++++++++++++ .../same_l3out_rtrId_non_vpc.json | 818 +++++++++++++++ .../test_l3out_overlapping_loopback_check.py | 44 + tests/test_IPAddress.py | 194 +++- 13 files changed, 7947 insertions(+), 25 deletions(-) create mode 100644 tests/l3out_overlapping_loopback_check/diff_l3out_loopback.json create mode 100644 tests/l3out_overlapping_loopback_check/diff_l3out_loopback_and_rtrId.json create mode 100644 tests/l3out_overlapping_loopback_check/diff_l3out_rtrId.json create mode 100644 tests/l3out_overlapping_loopback_check/no_overlap.json create mode 100644 tests/l3out_overlapping_loopback_check/overlap_on_diff_nodes.json create mode 100644 tests/l3out_overlapping_loopback_check/same_l3out_loopback.json create mode 100644 tests/l3out_overlapping_loopback_check/same_l3out_loopback_and_rtrId.json create mode 100644 tests/l3out_overlapping_loopback_check/same_l3out_rtrId.json create mode 100644 tests/l3out_overlapping_loopback_check/same_l3out_rtrId_non_vpc.json create mode 100644 tests/l3out_overlapping_loopback_check/test_l3out_overlapping_loopback_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 7baa0de..d91c96e 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -374,16 +374,46 @@ def cmd(self, command, **kargs): class IPAddress: """Custom IP handling class since old APICs do not have `ipaddress` module. """ + @classmethod + def ip_to_binary(cls, ip): + if ':' in ip: + return cls.ipv6_to_binary(ip) + else: + return cls.ipv4_to_binary(ip) + @staticmethod - def ip_to_binary(ip): - octets = ip.split(".") + def ipv4_to_binary(ipv4): + octets = ipv4.split(".") octets_bin = [format(int(octet), "08b") for octet in octets] return "".join(octets_bin) + @staticmethod + def ipv6_to_binary(ipv6): + HEXTET_COUNT = 8 + _hextets = ipv6.split(":") + dbl_colon_index = None + if '' in _hextets: + # leading/trailing '::' results in additional '' at the beginning/end. + if _hextets[0] == '': + _hextets = _hextets[1:] + if _hextets[-1] == '': + _hextets = _hextets[:-1] + # Uncompress all zero hextets represented by '::' + dbl_colon_index = _hextets.index('') + skipped_hextets = HEXTET_COUNT - len(_hextets) + 1 + hextets = _hextets[:dbl_colon_index] + hextets += ['0'] * skipped_hextets + hextets += _hextets[dbl_colon_index+1:] + else: + hextets = _hextets + hextets_bin = [format(int(hextet, 16), "016b") for hextet in hextets] + return "".join(hextets_bin) + @classmethod def get_network_binary(cls, ip, pfxlen): + maxlen = 128 if ':' in ip else 32 ip_bin = cls.ip_to_binary(ip) - return ip_bin[0:32-(32-int(pfxlen))] + return ip_bin[0:maxlen-(maxlen-int(pfxlen))] @classmethod def ip_in_subnet(cls, ip, subnet): @@ -1814,6 +1844,128 @@ def is_old(v): return result +def l3out_overlapping_loopback_check(index, total_checks, **kwargs): + title = 'L3Out Loopback IP Overlap With L3Out Interfaces' + result = FAIL_O + msg = '' + headers = ['Tenant:VRF', 'Node ID', 'Loopback IP (Tenant:L3Out:NodeP)', 'Interface IP (Tenant:L3Out:NodeP:IFP)'] + data = [] + recommended_action = 'Change either the loopback or L3Out interface IP subnet to avoid overlap.' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#l3out-loopback-ip-overlap-with-l3out-interfaces' + print_title(title, index, total_checks) + + tn_regex = r'uni/tn-(?P[^/]+)/' + path_regex = r'topology/pod-(?P\d+)/(?:prot)?paths-(?P\d+)(?:-(?P\d+))?' + + vrfs = defaultdict(dict) + api = 'l3extOut.json' + api += '?rsp-subtree=full' + api += '&rsp-subtree-class=l3extRsEctx,l3extRsNodeL3OutAtt,l3extLoopBackIfP,l3extRsPathL3OutAtt,l3extMember' + l3outs = icurl('class', api) + for l3out in l3outs: + vrf = "" + loopback_ips = defaultdict(dict) + interface_ips = defaultdict(list) + for child in l3out['l3extOut'].get('children', []): + dn = re.search(tn_regex, l3out['l3extOut']['attributes']['dn']) + tenant_name = dn.group('tenant') if dn else "" + l3out_name = l3out['l3extOut']['attributes']['name'] + # Get VRF + if child.get('l3extRsEctx'): + vrf_tdn = re.search(tn_regex, child['l3extRsEctx']['attributes']['tDn']) + if vrf_tdn: + vrf = ':'.join([vrf_tdn.group('tenant'), child['l3extRsEctx']['attributes']['tnFvCtxName']]) + else: + vrf = child['l3extRsEctx']['attributes']['tDn'] + # Get loopback and interface IPs + elif child.get('l3extLNodeP'): + nodep_name = child['l3extLNodeP']['attributes']['name'] + for np_child in child['l3extLNodeP'].get('children', []): + # Get the loopback IP for each node + if np_child.get('l3extRsNodeL3OutAtt'): + node = np_child['l3extRsNodeL3OutAtt'] + m = re.search(node_regex, node['attributes']['tDn']) + if not m: + logging.error('Failed to parse tDn - %s', node['attributes']['tDn']) + continue + node_id = m.group('node') + + loopback_ip = '' + if node['attributes']['rtrIdLoopBack'] == 'yes': + loopback_ip = node['attributes']['rtrId'] + else: + for lb in node.get('children', []): + # There should be only one l3extLoopBackIfP per node + if lb.get('l3extLoopBackIfP'): + loopback_ip = lb['l3extLoopBackIfP']['attributes']['addr'] + break + if loopback_ip: + loopback_ips[node_id] = { + 'addr': loopback_ip, + 'config': ':'.join([tenant_name, l3out_name, nodep_name]), + } + # Get interface IPs for each node + elif np_child.get('l3extLIfP'): + ifp_name = np_child['l3extLIfP']['attributes']['name'] + for ifp_child in np_child['l3extLIfP'].get('children', []): + if not ifp_child.get('l3extRsPathL3OutAtt'): + continue + port = ifp_child['l3extRsPathL3OutAtt'] + m = re.search(path_regex, port['attributes']['tDn']) + if not m: + logging.error('Failed to parse tDn - %s', port['attributes']['tDn']) + continue + node1_id = m.group('node1') + node2_id = m.group('node2') + config = ':'.join([tenant_name, l3out_name, nodep_name, ifp_name]) + # non-vPC port + if not node2_id: + interface_ips[node1_id].append({ + 'addr': port['attributes']['addr'], + 'config': config, + }) + # vPC port + else: + for member in port.get('children', []): + if not member.get('l3extMember'): + continue + node_id = node1_id + if member['l3extMember']['attributes']['side'] == 'B': + node_id = node2_id + interface_ips[node_id].append({ + 'addr': member['l3extMember']['attributes']['addr'], + 'config': config, + }) + for node in loopback_ips: + if not vrfs[vrf].get(node): + vrfs[vrf][node] = {} + vrfs[vrf][node]['loopback'] = loopback_ips[node] + for node in interface_ips: + if not vrfs[vrf].get(node): + vrfs[vrf][node] = {} + vrfs[vrf][node]['interfaces'] = vrfs[vrf][node].get('interfaces', []) + interface_ips[node] + + # Check overlaps + for vrf in vrfs: + for node in vrfs[vrf]: + loopback = vrfs[vrf][node].get('loopback') + interfaces = vrfs[vrf][node].get('interfaces') + if not loopback or not interfaces: + continue + for interface in interfaces: + if IPAddress.ip_in_subnet(loopback['addr'], interface['addr']): + data.append([ + vrf, + node, + '{} ({})'.format(loopback['addr'], loopback['config']), + '{} ({})'.format(interface['addr'], interface['config']), + ]) + if not data: + result = PASS + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result + + def bgp_peer_loopback_check(index, total_checks, **kwargs): """ Implementation change due to CSCvm28482 - 4.1(2) """ title = 'BGP Peer Profile at node level without Loopback' @@ -3333,6 +3485,7 @@ def subnet_scope_check(index, total_checks, cversion, **kwargs): bgp_peer_loopback_check, l3out_route_map_direction_check, l3out_route_map_missing_target_check, + l3out_overlapping_loopback_check, intersight_upgrade_status_check, isis_redis_metric_mpod_msite_check, bgp_golf_route_target_type_check, diff --git a/docs/docs/validations.md b/docs/docs/validations.md index eafebf5..c84bccc 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -108,13 +108,14 @@ Items | Faults | This Script [BGP Peer Profile at node level without Loopback][c5] | :white_check_mark: | :no_entry_sign: | :white_check_mark: [L3Out Route Map import/export direction][c6] | :white_check_mark: | :no_entry_sign: | :white_check_mark: [L3Out Route Map Match Rule with missing-target][c7] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: -[ISIS Redistribution Metric for MPod/Msite][c8] | :white_check_mark: | :no_entry_sign: | :white_check_mark: -[BGP Route-target Type for GOLF over L2EVPN][c9] | :white_check_mark: | :no_entry_sign: | :white_check_mark: -[APIC Container Bridge IP Overlap with APIC TEP][c10] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: -[Per-Leaf Fabric Uplink Scale Validation][c11] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: -[OoB Mgmt Security][c12] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: -[EECDH SSL Cipher Disabled][c13] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: -[BD and EPG Subnet must have matching scopes][c14] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: +[L3Out Loopback IP Overlap with L3Out Interfaces][c8] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: +[ISIS Redistribution Metric for MPod/Msite][c9] | :white_check_mark: | :no_entry_sign: | :white_check_mark: +[BGP Route-target Type for GOLF over L2EVPN][c10] | :white_check_mark: | :no_entry_sign: | :white_check_mark: +[APIC Container Bridge IP Overlap with APIC TEP][c11] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: +[Per-Leaf Fabric Uplink Scale Validation][c12] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: +[OoB Mgmt Security][c13] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: +[EECDH SSL Cipher Disabled][c14] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: +[BD and EPG Subnet must have matching scopes][c15] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: [c1]: #vpc-paired-leaf-switches @@ -124,13 +125,14 @@ Items | Faults | This Script [c5]: #bgp-peer-profile-at-node-level-without-loopback [c6]: #l3out-route-map-importexport-direction [c7]: #l3out-route-map-match-rule-with-missing-target -[c8]: #isis-redistribution-metric-for-mpodmsite -[c9]: #bgp-route-target-type-for-golf-over-l2evpn -[c10]: #apic-container-bridge-ip-overlap-with-apic-tep -[c11]: #fabric-uplink-scale-cannot-exceed-56-uplinks-per-leaf -[c12]: #oob-mgmt-security -[c13]: #eecdh-ssl-cipher -[c14]: #bd-and-epg-subnet-must-have-matching-scopes +[c8]: #l3out-loopback-ip-overlap-with-l3out-interfaces +[c9]: #isis-redistribution-metric-for-mpodmsite +[c10]: #bgp-route-target-type-for-golf-over-l2evpn +[c11]: #apic-container-bridge-ip-overlap-with-apic-tep +[c12]: #fabric-uplink-scale-cannot-exceed-56-uplinks-per-leaf +[c13]: #oob-mgmt-security +[c14]: #eecdh-ssl-cipher +[c15]: #bd-and-epg-subnet-must-have-matching-scopes ### Defect Condition Checks @@ -1472,6 +1474,55 @@ To avoid an unexpected behavior change after an upgrade, if the route map contex When a match rule reference with `missing-target` is present for a route map with type **Match Prefix AND Routing Policy** prior to the upgrade and prior to the fix of CSCwx11570, the corresponding route-map context is not functioning. However, the fact that it has not been functioning without any operational impact indicates that the route map context may not be needed in the first place. If you remove the match rule reference with `missing-target`, a new route-map sequence will be deployed based on other match conditions which may or may not be needed. Thus, it is important for you to check the original intent of the route-map context and decide how to resolve it. If the route-map context is not needed in the first place, you would need to remove the entire route-map context instead of just removing the match rule reference with `missing-target`. +### L3Out Loopback IP Overlap with L3Out Interfaces + +When a loopback IP address in an L3Out is overlapping with a subnet of L3Out interfaces on the same leaf in the same VRF, only one of them (loopback or L3Out interface) is deployed even though the configuration is allowed without any faults. As a result, after an upgrade, what's deployed out of the two may change, and traffic may suddenly stop working after an upgrade because the interface that used to be deployed prior to the upgrade may be replaced with the other one. + +In an L3Out, there are two ways to configure a loopback IP: + +1. Use Router ID as Loopback IP Address. +2. Configure an explicit loopback iP address that may be different from the router ID. + +Both options are configured under `Tenant > L3Out > Logical Node Profile > (node ID)` in the APIC GUI. + +This script checks both options to see if any of them is overlapping with the subnet configured as the L3Out interfaces under `Tenant > L3Out > Logical Node Profile > Logical Interface Profile` in the APIC GUI. + +Note that the overlap may happen across different L3Outs. For example, the loopback IP address is configured on `L3Out 1` on `node-101` in `VRF A` while the L3Out interface with the overlapping subnet is configrued on `L3Out 2` on the same node and the same VRF. + +!!! tip + There are other overlapping configurations like overlaps between an L3Out loopback IP address and a BD subnet. Those are, however, covered by a fault (F1425), which is validated by another check - [BD Subnets (F1425 subnet-overlap)][f13]. + +!!! tip + The enhancement (CSCwa48038) was made on APIC to prevent users from doing this conflicting configuration in the first place. However, if the user already had this conflicting configuration, and proceeded with an upgrade from an older version to the version with the enhancement, the conflicting configuration remains there with the remaining risk of uncertainty where we don't know which interface will be deployed after the next upgrade. + +!!! example + Alternative to the APIC GUI, you can also check these objects for the loopback IP addresses or L3Out Interface subnets via API. + + **Use Router ID as Loopback Address** in the APIC GUI corresponds to the object `l3extRsNodeL3OutAtt` with `rtrIdLoopBack` set to `yes`. + In this example, `node-103` is configured with a loopback IP `10.0.0.3` via L3Out `BGP` in tenant `TK`. + + ``` + admin@f1-apic1:~> moquery -c l3extRsNodeL3OutAtt | egrep 'dn|rtr' + dn : uni/tn-TK/out-OSPF/lnodep-IPv4/rsnodeL3OutAtt-[topology/pod-1/node-103] + rtrId : 10.0.0.3 + rtrIdLoopBack : no + dn : uni/tn-TK/out-BGP/lnodep-IPv4/rsnodeL3OutAtt-[topology/pod-1/node-103] + rtrId : 10.0.0.3 + rtrIdLoopBack : yes + ``` + + Configuring an explicit loopback IP address is done via the object `l3extLoopBackIfP` which is optionally configured under `l3extRsNodeL3OutAtt` when `l3extRsNodeL3OutAtt.rtrIdLoopBack` is set to `no`. + + ``` + admin@f1-apic1:~> moquery -c l3extLoopBackIfP | egrep 'dn|addr' + addr : 10.0.0.103 + dn : uni/tn-TK/out-BGP2/lnodep-IPv4/rsnodeL3OutAtt-[topology/pod-1/node-103]/lbp-[10.0.0.103] + ``` + + Note that you need to get the corresponding VRF from the parent L3Out to see which VRF these loopbacks are deployed. + + + ### ISIS Redistribution Metric for MPod/Msite ISIS Redistribution Metric is used when a spine redistributes routes from another pod or site into local underlay network (ISIS). If this metric is not set to less than 63, traffic disruption may occur with an upgrade of spine swithces. diff --git a/tests/l3out_overlapping_loopback_check/diff_l3out_loopback.json b/tests/l3out_overlapping_loopback_check/diff_l3out_loopback.json new file mode 100644 index 0000000..8737833 --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/diff_l3out_loopback.json @@ -0,0 +1,860 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:36.152-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extLoopBackIfP": { + "attributes": { + "addr": "10.0.0.103", + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:33.717-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "lbp-[10.0.0.103]", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:52.274-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extLoopBackIfP": { + "attributes": { + "addr": "10.0.0.104", + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:49.774-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "lbp-[10.0.0.104]", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.40/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T16:54:22.525-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.30/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T16:54:22.525-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:53:57.758-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:41.371-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T13:50:08.561-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.336-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/diff_l3out_loopback_and_rtrId.json b/tests/l3out_overlapping_loopback_check/diff_l3out_loopback_and_rtrId.json new file mode 100644 index 0000000..ce1a32e --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/diff_l3out_loopback_and_rtrId.json @@ -0,0 +1,862 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:58:44.629-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:33.348-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:52.274-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extLoopBackIfP": { + "attributes": { + "addr": "10.0.0.104", + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:49.774-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "lbp-[10.0.0.104]", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.40/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T16:54:22.525-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.30/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T16:54:22.525-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:53:57.758-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:41.371-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T13:50:08.561-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.336-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/diff_l3out_rtrId.json b/tests/l3out_overlapping_loopback_check/diff_l3out_rtrId.json new file mode 100644 index 0000000..475ae1b --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/diff_l3out_rtrId.json @@ -0,0 +1,864 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:33.348-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:33.348-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:40.150-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:40.150-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.40/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T16:54:22.525-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.30/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T16:54:22.525-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:53:57.758-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:41.371-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T13:50:08.561-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.336-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/no_overlap.json b/tests/l3out_overlapping_loopback_check/no_overlap.json new file mode 100644 index 0000000..a5810a5 --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/no_overlap.json @@ -0,0 +1,864 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:21.034-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:33.348-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:52.274-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:40.150-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.51.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T17:02:02.813-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.51.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T17:02:02.813-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:43.119-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:37.017-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T13:50:08.561-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.336-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/overlap_on_diff_nodes.json b/tests/l3out_overlapping_loopback_check/overlap_on_diff_nodes.json new file mode 100644 index 0000000..5366cf6 --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/overlap_on_diff_nodes.json @@ -0,0 +1,945 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:21.034-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:33.348-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:52.274-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:40.150-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.0.0.101/24", + "annotation": "", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-05-08T17:05:17.023-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "inherit", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/12]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/12]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + }, + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.51.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T17:02:02.813-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.51.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T17:02:02.813-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:05:41.644-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "10.0.0.1", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extLoopBackIfP": { + "attributes": { + "addr": "10.10.10.10", + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-05-08T17:05:58.109-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "lbp-[10.10.10.10]", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:43.119-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:37.017-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T13:50:08.561-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.336-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/same_l3out_loopback.json b/tests/l3out_overlapping_loopback_check/same_l3out_loopback.json new file mode 100644 index 0000000..02a47b0 --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/same_l3out_loopback.json @@ -0,0 +1,718 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:56.480-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + } + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:56.392-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.40/25", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T13:12:40.876-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.30/25", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T13:12:40.876-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extLoopBackIfP": { + "attributes": { + "addr": "10.0.0.104", + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:52.670-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "lbp-[10.0.0.104]", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:41.371-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extLoopBackIfP": { + "attributes": { + "addr": "10.0.0.103", + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:38.168-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "lbp-[10.0.0.103]", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/same_l3out_loopback_and_rtrId.json b/tests/l3out_overlapping_loopback_check/same_l3out_loopback_and_rtrId.json new file mode 100644 index 0000000..ccf8e43 --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/same_l3out_loopback_and_rtrId.json @@ -0,0 +1,768 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:56.480-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + } + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:56.392-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.40/25", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T13:12:40.876-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.30/25", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T13:12:40.876-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:49:48.065-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:41.371-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extLoopBackIfP": { + "attributes": { + "addr": "10.0.0.103", + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:38.168-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "lbp-[10.0.0.103]", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/same_l3out_rtrId.json b/tests/l3out_overlapping_loopback_check/same_l3out_rtrId.json new file mode 100644 index 0000000..67274d4 --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/same_l3out_rtrId.json @@ -0,0 +1,797 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:56.480-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + } + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:56.392-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:03.804-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.40/25", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T13:12:40.876-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.0.0.30/25", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T13:12:40.876-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:56.531-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:27:04.722-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T13:50:08.561-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.336-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/same_l3out_rtrId_non_vpc.json b/tests/l3out_overlapping_loopback_check/same_l3out_rtrId_non_vpc.json new file mode 100644 index 0000000..b7b3efa --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/same_l3out_rtrId_non_vpc.json @@ -0,0 +1,818 @@ +[ + { + "l3extOut": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-common/out-default", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "0" + }, + "children": [ + { + "l3extRsEctx": { + "attributes": { + "annotation": "", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2023-10-10T19:29:01.074-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "default-target", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-common/ctx-default", + "tRn": "ctx-default", + "tType": "name", + "tnFvCtxName": "", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-mgmt/out-INB_OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:10.596-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:13.262-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:18.258-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "INB_OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-INB_OSPF", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.10.10.1/24", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-10", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "sub-interface", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-11T12:06:19.600-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-101/pathep-[eth1/13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:14.870-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-101]", + "rtrId": "1.0.0.101", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-101", + "tType": "mo", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-11T12:06:11.387-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-mgmt/ctx-inb", + "tRn": "ctx-inb", + "tType": "name", + "tnFvCtxName": "inb", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-OSPF", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.592-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "OSPF", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.504-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1053", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-04-12T09:56:04.207-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "9000", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/protpaths-103-104/pathep-[N9K_VPC_3-4_13]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.4/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-B", + "side": "B", + "status": "", + "uid": "15374" + } + } + }, + { + "l3extMember": { + "attributes": { + "addr": "10.53.0.3/24", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "modTs": "2024-05-08T12:56:24.560-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "mem-A", + "side": "A", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:21.034-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:33.348-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T16:57:52.274-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "no", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:54:40.150-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + }, + { + "l3extOut": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "dn": "uni/tn-TK/out-BGP", + "enforceRtctrl": "export", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:53.557-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "BGP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "status": "", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLNodeP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:55.488-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IPv4", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "rn": "lnodep-IPv4", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extLIfP": { + "attributes": { + "addr": "0.0.0.0", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "encap": "unknown", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:56:01.299-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "IFP", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "prio": "unspecified", + "rn": "lifp-IFP", + "status": "", + "tag": "yellow-green", + "targetDscp": "unspecified", + "uid": "15374" + }, + "children": [ + { + "l3extRsPathL3OutAtt": { + "attributes": { + "addr": "10.0.0.30/24", + "annotation": "", + "autostate": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "encap": "vlan-1051", + "encapScope": "local", + "extMngdBy": "", + "forceResolve": "yes", + "ifInstT": "ext-svi", + "ipv6Dad": "enabled", + "lcOwn": "local", + "llAddr": "::", + "mac": "00:22:BD:F8:19:FF", + "modTs": "2024-05-08T17:09:33.155-07:00", + "mode": "regular", + "monPolDn": "uni/tn-common/monepg-default", + "mtu": "inherit", + "rType": "mo", + "rn": "rspathL3OutAtt-[topology/pod-1/paths-103/pathep-[eth1/12]]", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-103/pathep-[eth1/12]", + "tType": "mo", + "targetDscp": "unspecified", + "uid": "15374" + } + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:43.119-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-104]", + "rtrId": "10.0.0.4", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-104", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T16:44:55.748-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.319-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + }, + { + "l3extRsNodeL3OutAtt": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "configIssues": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-05-08T17:01:37.017-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsnodeL3OutAtt-[topology/pod-1/node-103]", + "rtrId": "10.0.0.3", + "rtrIdLoopBack": "yes", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricNode", + "tDn": "topology/pod-1/node-103", + "tType": "mo", + "uid": "15374" + }, + "children": [ + { + "l3extInfraNodeP": { + "attributes": { + "annotation": "", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fabricExtCtrlPeering": "no", + "fabricExtIntersiteCtrlPeering": "no", + "lcOwn": "local", + "modTs": "2024-05-08T13:50:08.561-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "rn": "infranodep", + "spineRole": "", + "status": "", + "uid": "15374" + } + } + }, + { + "ipRouteP": { + "attributes": { + "aggregate": "no", + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "fromPfxLen": "0", + "ip": "10.51.255.34", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:58.336-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "pref": "1", + "rn": "rt-[10.51.255.34]", + "rtCtrl": "", + "status": "", + "toPfxLen": "0", + "type": "rt-static", + "uid": "15374" + }, + "children": [ + { + "ipNexthopP": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "descr": "", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:59.300-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "nhAddr": "10.51.0.34", + "pref": "1", + "rn": "nh-[10.51.0.34]", + "status": "", + "type": "prefix", + "uid": "15374" + } + } + } + ] + } + } + ] + } + } + ] + } + }, + { + "l3extRsEctx": { + "attributes": { + "annotation": "orchestrator:terraform", + "childAction": "", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2024-04-12T09:55:54.049-07:00", + "monPolDn": "uni/tn-common/monepg-default", + "rType": "mo", + "rn": "rsectx", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "fvCtx", + "tContextDn": "", + "tDn": "uni/tn-TK/ctx-VRFA", + "tRn": "ctx-VRFA", + "tType": "name", + "tnFvCtxName": "VRFA", + "uid": "0" + } + } + } + ] + } + } +] diff --git a/tests/l3out_overlapping_loopback_check/test_l3out_overlapping_loopback_check.py b/tests/l3out_overlapping_loopback_check/test_l3out_overlapping_loopback_check.py new file mode 100644 index 0000000..11ba12b --- /dev/null +++ b/tests/l3out_overlapping_loopback_check/test_l3out_overlapping_loopback_check.py @@ -0,0 +1,44 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + + +# icurl queries +api = 'l3extOut.json' +api += '?rsp-subtree=full' +api += '&rsp-subtree-class=l3extRsEctx,l3extRsNodeL3OutAtt,l3extLoopBackIfP,l3extRsPathL3OutAtt,l3extMember' + + +@pytest.mark.parametrize( + "icurl_outputs, expected_result", + [ + # No overlap + ({api: read_data(dir, "no_overlap.json")}, script.PASS), + # Overlap across different nodes + ({api: read_data(dir, "overlap_on_diff_nodes.json")}, script.PASS), + # Overlap within the same L3Out - Router ID as loopback (non-VPC) + ({api: read_data(dir, "same_l3out_rtrId_non_vpc.json")}, script.FAIL_O), + # Overlap within the same L3Out - Router ID as loopback (VPC) + ({api: read_data(dir, "same_l3out_rtrId.json")}, script.FAIL_O), + # Overlap within the same L3Out - Explicit loopback (VPC) + ({api: read_data(dir, "same_l3out_loopback.json")}, script.FAIL_O), + # Overlap within the same L3Out - Explicit loopback and Router ID as loopback (VPC) + ({api: read_data(dir, "same_l3out_loopback_and_rtrId.json")}, script.FAIL_O), + # Overlap across different L3Outs - Router ID as loopback (VPC) + ({api: read_data(dir, "diff_l3out_rtrId.json")}, script.FAIL_O), + # Overlap across different L3Outs - Explicit loopback (VPC) + ({api: read_data(dir, "diff_l3out_loopback.json")}, script.FAIL_O), + # Overlap across different L3Outs - Explicit loopback and Router ID as loopback (VPC) + ({api: read_data(dir, "diff_l3out_loopback_and_rtrId.json")}, script.FAIL_O), + ], +) +def test_logic(mock_icurl, expected_result): + result = script.l3out_overlapping_loopback_check(1, 1) + assert result == expected_result diff --git a/tests/test_IPAddress.py b/tests/test_IPAddress.py index 35842f1..5cecbaa 100644 --- a/tests/test_IPAddress.py +++ b/tests/test_IPAddress.py @@ -4,22 +4,136 @@ script = importlib.import_module("aci-preupgrade-validation-script") +ipv4_test_data = [ + ("10.0.0.1", "00001010000000000000000000000001"), + ("10.255.200.99", "00001010111111111100100001100011"), + ("172.16.10.123", "10101100000100000000101001111011"), + ("172.17.0.1", "10101100000100010000000000000001"), + ("172.17.10.123", "10101100000100010000101001111011"), + ("192.168.1.1", "11000000101010000000000100000001"), +] +ipv6_test_data = [ + ( + "2001::1", + ( + "0010000000000001" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000001" + ), + ), + ( + "2001:dead:beef::1:2:3", + ( + "0010000000000001" + "1101111010101101" + "1011111011101111" + "0000000000000000" + "0000000000000000" + "0000000000000001" + "0000000000000010" + "0000000000000011" + ), + ), + ( + "2001:df0:f2::f10", + ( + "0010000000000001" + "0000110111110000" + "0000000011110010" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000111100010000" + ), + ), + ( + "fe80::1234:5678:c0ff:ee00", + ( + "1111111010000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0001001000110100" + "0101011001111000" + "1100000011111111" + "1110111000000000" + ), + ), + ( + "fe80:1234:5678:abcd:efff:cafe:babe:deca", + ( + "1111111010000000" + "0001001000110100" + "0101011001111000" + "1010101111001101" + "1110111111111111" + "1100101011111110" + "1011101010111110" + "1101111011001010" + ), + ), + ( + "::1", + ( + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000001" + ), + ), + ( + "2001:420:1101:1::", + ( + "0010000000000001" + "0000010000100000" + "0001000100000001" + "0000000000000001" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + ), + ), +] + + @pytest.mark.parametrize( "ip, expected", - [ - ("10.0.0.1", "00001010000000000000000000000001"), - ("10.255.200.99", "00001010111111111100100001100011"), - ("172.16.10.123", "10101100000100000000101001111011"), - ("172.17.0.1", "10101100000100010000000000000001"), - ("172.17.10.123", "10101100000100010000101001111011"), - ("192.168.1.1", "11000000101010000000000100000001"), - ], + ipv4_test_data + ipv6_test_data, ) def test_ip_to_binary(ip, expected): result = script.IPAddress.ip_to_binary(ip) assert result == expected +@pytest.mark.parametrize( + "ip, expected", + ipv4_test_data, +) +def test_ipv4_to_binary(ip, expected): + result = script.IPAddress.ipv4_to_binary(ip) + assert result == expected + + +@pytest.mark.parametrize( + "ip, expected", + ipv6_test_data, +) +def test_ipv6_to_binary(ip, expected): + result = script.IPAddress.ipv6_to_binary(ip) + assert result == expected + + @pytest.mark.parametrize( "ip, pfxlen, expected", [ @@ -29,6 +143,63 @@ def test_ip_to_binary(ip, expected): ("172.17.0.1", 24, "101011000001000100000000"), ("172.17.10.123", 28, "1010110000010001000010100111"), ("192.168.1.1", 30, "110000001010100000000001000000"), + ("2001::1", 16, "0010000000000001"), + ( + "2001:dead:beef::1:2:3", + 64, + ( + "0010000000000001" + "1101111010101101" + "1011111011101111" + "0000000000000000" + ), + ), + ( + "2001:df0:f2::f10", + 56, + ("0010000000000001" "0000110111110000" "0000000011110010" "00000000"), + ), + ( + "fe80::1234:5678:c0ff:ee00", + 16, + "1111111010000000", + ), + ( + "fe80:1234:5678:abcd:efff:cafe:babe:deca", + 96, + ( + "1111111010000000" + "0001001000110100" + "0101011001111000" + "1010101111001101" + "1110111111111111" + "1100101011111110" + ), + ), + ( + "::1", + 128, + ( + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000000" + "0000000000000001" + ), + ), + ( + "2001:420:1101:1::", + 64, + ( + "0010000000000001" + "0000010000100000" + "0001000100000001" + "0000000000000001" + ), + ), ], ) def test_get_network_binary(ip, pfxlen, expected): @@ -45,6 +216,13 @@ def test_get_network_binary(ip, pfxlen, expected): ("172.17.0.1", "172.18.0.1/16", False), ("172.17.0.1", "172.17.0.1/24", True), ("172.17.0.1", "172.17.1.1/24", False), + ("2001::1", "2002::1/16", False), + ("2001::1", "2001::10/16", True), + ("2001::1", "2001::/16", True), + ("2001:cafe:babe::1:2:3", "2001:cafe:babe:deca:fc0f:ffee:bad0:900d/48", True), + ("2001:cafe:babe::1:2:3", "2001:cafe:babe:deca:fc0f:ffee:bad0:900d/80", False), + ("fe80::1234:5678:c0ff:ee00", "fe80::/16", True), + ("::1", "2001:420:1101:1::1/64", False), ], ) def test_ip_in_subnet(ip, subnet, expected): From b1c34a8d2b1b1df8ad0395c41a31a4d8f33d82c7 Mon Sep 17 00:00:00 2001 From: GM Date: Fri, 17 May 2024 14:19:54 -0400 Subject: [PATCH 02/15] CIMC check clarifications around multi-step upgrades and RNE differences (#126) --- aci-preupgrade-validation-script.py | 15 +++--- docs/docs/validations.md | 8 +++- .../compatRsSuppHw_605_L2.json | 10 ++++ .../compatRsSuppHw_605_M1.json | 10 ++++ .../eqptCh_newver.json | 40 ++++++++++++++++ .../eqptCh_oldver.json | 40 ++++++++++++++++ .../eqptCh_reallyoldver.json | 40 ++++++++++++++++ .../test_cimc_compatibilty_check.py | 47 +++++++++++++++++++ 8 files changed, 201 insertions(+), 9 deletions(-) create mode 100644 tests/cimc_compatibilty_check/compatRsSuppHw_605_L2.json create mode 100644 tests/cimc_compatibilty_check/compatRsSuppHw_605_M1.json create mode 100644 tests/cimc_compatibilty_check/eqptCh_newver.json create mode 100644 tests/cimc_compatibilty_check/eqptCh_oldver.json create mode 100644 tests/cimc_compatibilty_check/eqptCh_reallyoldver.json create mode 100644 tests/cimc_compatibilty_check/test_cimc_compatibilty_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index d91c96e..bca1d69 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -2343,10 +2343,10 @@ def cimc_compatibilty_check(index, total_checks, tversion, **kwargs): title = 'APIC CIMC Compatibility' result = FAIL_UF msg = '' - headers = ["Node ID", "Current CIMC version", "Minimum Recommended CIMC Version"] + headers = ["Node ID", "Model", "Current CIMC version", "Catalog Recommended CIMC Version", "Warning"] data = [] - recommended_action = 'Plan to upgrade CIMC version prior to APIC upgrade' - doc_url = '"Compatibility (CIMC Versions)" from Pre-Upgrade Checklists' + recommended_action = 'Check Release note of APIC Model/version for latest recommendations.' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#compatibility-cimc-version' print_title(title, index, total_checks) apic_obj = icurl('class', 'eqptCh.json?query-target-filter=wcard(eqptCh.descr,"APIC")') if apic_obj and tversion: @@ -2360,12 +2360,13 @@ def cimc_compatibilty_check(index, total_checks, tversion, **kwargs): "/rssuppHw-[uni/fabric/compcat-default/ctlrhw-" + model + "].json" compatMo = icurl('mo', compat_lookup_dn) recommended_cimc = compatMo[0]['compatRsSuppHw']['attributes']['cimcVersion'] + warning = "" if compatMo and recommended_cimc: - if is_firstver_gt_secondver(current_cimc, recommended_cimc): - pass - else: + if not is_firstver_gt_secondver(current_cimc, "3.0(3a)"): + warning = "Multi-step Upgrade may be required, check UCS CIMC Matrix." + if not is_firstver_gt_secondver(current_cimc, recommended_cimc): nodeid = eqptCh['eqptCh']['attributes']['dn'].split('/')[2] - data.append([nodeid, current_cimc, recommended_cimc]) + data.append([nodeid, apic_model, current_cimc, recommended_cimc, warning]) if not data: result = PASS diff --git a/docs/docs/validations.md b/docs/docs/validations.md index c84bccc..10a2af5 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -179,9 +179,12 @@ The script performs the equivalent check by querying objects `compatRsUpgRel`. ### Compatibility (CIMC Version) -The [APIC Upgrade/Downgrade Support Matrix][1] should be checked for the supported UCS HUU version for your target Cisco APIC version to make sure all server components are running the version from the supported HUU bundle. +The script checks the minimum recommended CIMC version for the given APIC model on the target version by querying `compatRsSuppHw` objects. -The script checks the minimum recommended CIMC version for the given APIC model on the target version by querying objects `compatRsSuppHw`. +As the `compatRsSuppHw` object recommendation is strictly tied to the target software image, it is possible that the [Release Note Documentation][4] for your model/target version has a different recommendation than what the software recommends. Always check the release note of your Target version and APIC model to ensure you are getting the latest recommendations. + +!!! note + Older versions of CIMC may required multi-step CIMC upgrades to get to the identified target version. Refer to the [Cisco UCS Rack Server Upgrade Matrix][22] for the latest documentation on which steps are required and support given your current and target CIMC versions. ### Compatibility (Switch Hardware) @@ -1820,3 +1823,4 @@ Because of this, the target version of your upgrade must be a version with a fix [19]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/5x/security-configuration/cisco-apic-security-configuration-guide-release-52x/https-access-52x.html [20]: https://www.cisco.com/c/en/us/support/docs/field-notices/740/fn74085.html [21]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvv30303 +[22]: https://www.cisco.com/c/dam/en/us/td/docs/unified_computing/ucs/c/sw/CIMC-Upgrade-Downgrade-Matrix/index.html \ No newline at end of file diff --git a/tests/cimc_compatibilty_check/compatRsSuppHw_605_L2.json b/tests/cimc_compatibilty_check/compatRsSuppHw_605_L2.json new file mode 100644 index 0000000..0896e33 --- /dev/null +++ b/tests/cimc_compatibilty_check/compatRsSuppHw_605_L2.json @@ -0,0 +1,10 @@ +[ + { + "compatRsSuppHw": { + "attributes": { + "cimcVersion": "4.0(2f)", + "dn": "uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicl2]" + } + } + } +] \ No newline at end of file diff --git a/tests/cimc_compatibilty_check/compatRsSuppHw_605_M1.json b/tests/cimc_compatibilty_check/compatRsSuppHw_605_M1.json new file mode 100644 index 0000000..318965b --- /dev/null +++ b/tests/cimc_compatibilty_check/compatRsSuppHw_605_M1.json @@ -0,0 +1,10 @@ +[ + { + "compatRsSuppHw": { + "attributes": { + "cimcVersion": "3.0(4j)", + "dn": "uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicm1]" + } + } + } +] \ No newline at end of file diff --git a/tests/cimc_compatibilty_check/eqptCh_newver.json b/tests/cimc_compatibilty_check/eqptCh_newver.json new file mode 100644 index 0000000..5e1b4a7 --- /dev/null +++ b/tests/cimc_compatibilty_check/eqptCh_newver.json @@ -0,0 +1,40 @@ +[ + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "4.0(2f)", + "configRole": "unspecified", + "descr": "APIC-SERVER-L2", + "dn": "topology/pod-1/node-1/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-L2" + } + } + }, + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "4.0(2f)", + "descr": "APIC-SERVER-L2", + "dn": "topology/pod-1/node-2/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-L2" + } + } + }, + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "4.0(2f)", + "configRole": "unspecified", + "descr": "APIC-SERVER-M1", + "dn": "topology/pod-2/node-3/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-M1" + } + } + } +] \ No newline at end of file diff --git a/tests/cimc_compatibilty_check/eqptCh_oldver.json b/tests/cimc_compatibilty_check/eqptCh_oldver.json new file mode 100644 index 0000000..4830b92 --- /dev/null +++ b/tests/cimc_compatibilty_check/eqptCh_oldver.json @@ -0,0 +1,40 @@ +[ + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "3.0(4l)", + "configRole": "unspecified", + "descr": "APIC-SERVER-L2", + "dn": "topology/pod-1/node-1/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-L2" + } + } + }, + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "3.0(4l)", + "descr": "APIC-SERVER-L2", + "dn": "topology/pod-1/node-2/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-L2" + } + } + }, + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "3.0(4l)", + "configRole": "unspecified", + "descr": "APIC-SERVER-M1", + "dn": "topology/pod-2/node-3/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-M1" + } + } + } +] \ No newline at end of file diff --git a/tests/cimc_compatibilty_check/eqptCh_reallyoldver.json b/tests/cimc_compatibilty_check/eqptCh_reallyoldver.json new file mode 100644 index 0000000..45f5209 --- /dev/null +++ b/tests/cimc_compatibilty_check/eqptCh_reallyoldver.json @@ -0,0 +1,40 @@ +[ + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "1.5(4e)", + "configRole": "unspecified", + "descr": "APIC-SERVER-L2", + "dn": "topology/pod-1/node-1/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-L2" + } + } + }, + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "1.5(4e)", + "descr": "APIC-SERVER-L2", + "dn": "topology/pod-1/node-2/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-L2" + } + } + }, + { + "eqptCh": { + "attributes": { + "bootSource": "bootflash", + "cimcVersion": "1.5(4e)", + "configRole": "unspecified", + "descr": "APIC-SERVER-M1", + "dn": "topology/pod-2/node-3/sys/ch", + "hybridMode": "no", + "model": "APIC-SERVER-M1" + } + } + } +] \ No newline at end of file diff --git a/tests/cimc_compatibilty_check/test_cimc_compatibilty_check.py b/tests/cimc_compatibilty_check/test_cimc_compatibilty_check.py new file mode 100644 index 0000000..dfd452d --- /dev/null +++ b/tests/cimc_compatibilty_check/test_cimc_compatibilty_check.py @@ -0,0 +1,47 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + + +# icurl queries +eqptCh_api = 'eqptCh.json?query-target-filter=wcard(eqptCh.descr,"APIC")' + +compatRsSuppHwL2_api = 'uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicl2].json' +compatRsSuppHwM1_api = 'uni/fabric/compcat-default/ctlrfw-apic-6.0(5)/rssuppHw-[uni/fabric/compcat-default/ctlrhw-apicm1].json' + +@pytest.mark.parametrize( + "icurl_outputs, tversion, expected_result", + [ + ( + {eqptCh_api: read_data(dir, "eqptCh_reallyoldver.json"), + compatRsSuppHwL2_api: read_data(dir, "compatRsSuppHw_605_L2.json"), + compatRsSuppHwM1_api: read_data(dir, "compatRsSuppHw_605_M1.json")}, + "6.0(5a)", + script.FAIL_UF, + ), + ( + {eqptCh_api: read_data(dir, "eqptCh_oldver.json"), + compatRsSuppHwL2_api: read_data(dir, "compatRsSuppHw_605_L2.json"), + compatRsSuppHwM1_api: read_data(dir, "compatRsSuppHw_605_M1.json")}, + "6.0(5a)", + script.FAIL_UF, + ), + ( + {eqptCh_api: read_data(dir, "eqptCh_newver.json"), + compatRsSuppHwL2_api: read_data(dir, "compatRsSuppHw_605_L2.json"), + compatRsSuppHwM1_api: read_data(dir, "compatRsSuppHw_605_M1.json")}, + "6.0(5a)", + script.PASS, + ), + ], +) +def test_logic(mock_icurl, tversion, expected_result): + result = script.cimc_compatibilty_check(1, 1, script.AciVersion(tversion)) + assert result == expected_result From 272578f2a224b842c8e12753ebf8fa3c14810a49 Mon Sep 17 00:00:00 2001 From: GM Date: Fri, 17 May 2024 14:27:23 -0400 Subject: [PATCH 03/15] #88 #101 - invalid_fex_rs_check + tests (#124) * invalid_fex_rs_check + tests * docs + check doc link * fix bugId in doc * remove `check` from title --- aci-preupgrade-validation-script.py | 33 ++++++++++++- docs/docs/validations.md | 17 ++++++- .../infraRsHPathAtt_neg.json | 46 +++++++++++++++++++ .../infraRsHPathAtt_pos.json | 46 +++++++++++++++++++ .../test_invalid_fex_rs_check.py | 33 +++++++++++++ 5 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json create mode 100644 tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json create mode 100644 tests/invalid_fex_rs_check/test_invalid_fex_rs_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index bca1d69..865a157 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -739,6 +739,7 @@ def get_vpc_nodes(**kwargs): return vpc_nodes + def get_switch_version(**kwargs): """ Returns lowest switch version as AciVersion instance """ prints("Gathering Lowest Switch Version from Firmware Repository...", end='') @@ -758,6 +759,7 @@ def get_switch_version(**kwargs): return lowest_sw_ver + def apic_cluster_health_check(index, total_checks, cversion, **kwargs): title = 'APIC Cluster is Fully-Fit' result = FAIL_UF @@ -3017,6 +3019,7 @@ def oob_mgmt_security_check(index, total_checks, cversion, tversion, **kwargs): print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) return result + def mini_aci_6_0_2_check(index, total_checks, cversion, tversion, **kwargs): title = 'Mini ACI Upgrade to 6.0(2)+' result = FAIL_UF @@ -3049,7 +3052,6 @@ def mini_aci_6_0_2_check(index, total_checks, cversion, tversion, **kwargs): return result - def sup_a_high_memory_check(index, total_checks, tversion, **kwargs): title = "SUP-A/A+ High Memory Usage" result = PASS @@ -3417,6 +3419,34 @@ def subnet_scope_check(index, total_checks, cversion, **kwargs): return result +def invalid_fex_rs_check(index, total_checks, **kwargs): + title = 'Invalid FEX Relation Source' + result = PASS + msg = '' + headers = ["FEX ID", "Invalid DN"] + data = [] + recommended_action = 'Identify if FEX ID in use, then contact TAC for cleanup' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations#invalid-fex-fabricpathep-dn-references' + print_title(title, index, total_checks) + + + hpath_api = 'infraRsHPathAtt.json?query-target-filter=wcard(infraRsHPathAtt.dn,"eth")' + infraRsHPathAtt = icurl('class', hpath_api) + + for rs in infraRsHPathAtt: + dn = rs["infraRsHPathAtt"]["attributes"]["dn"] + m = re.search(r'eth(?P\d+)\/\d\/\d', dn) + if m: + fex_id = m.group('fex') + data.append([fex_id, dn]) + + if data: + result = FAIL_UF + + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result + + if __name__ == "__main__": prints(' ==== %s%s, Script Version %s ====\n' % (ts, tz, SCRIPT_VERSION)) prints('!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!\n') @@ -3510,6 +3540,7 @@ def subnet_scope_check(index, total_checks, cversion, **kwargs): vmm_active_uplinks_check, fabric_dpp_check, n9k_c93108tc_fx3p_interface_down_check, + invalid_fex_rs_check, ] summary = {PASS: 0, FAIL_O: 0, FAIL_UF: 0, ERROR: 0, MANUAL: 0, POST: 0, NA: 0, 'TOTAL': len(checks)} diff --git a/docs/docs/validations.md b/docs/docs/validations.md index 10a2af5..bfd1462 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -152,6 +152,8 @@ Items | Defect | This Script [VMM Uplink Container with empty Actives][d11] | CSCvr96408 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [CoS 3 with Dynamic Packet Prioritization][d12] | CSCwf05073 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [N9K-C93108TC-FX3P/FX3H Interface Down][d13] | CSCwh81430 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: +[Invalid FEX fabricPathEp DN References][d14] | CSCwh68103 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: + [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -166,6 +168,7 @@ Items | Defect | This Script [d11]: #vmm-uplink-container-with-empty-actives [d12]: #cos-3-with-dynamic-packet-prioritization [d13]: #n9k-c93108tc-fx3pfx3h-interface-down +[d14]: #invalid-fex-fabricpathep-dn-references ## General Check Details @@ -1800,6 +1803,17 @@ The problem is related only to the front-panel interfaces Ethernet 1/1- 1/48. Op Because of this, the target version of your upgrade must be a version with a fix of CSCwh81430 when your fabric includes those switches mentioned above. See the Field Notice [FN74085][20] for details. +### Invalid FEX fabricPathEp DN References + +If you have deployed a FEX on a version prior to having validations introduced in [CSCwh68103][23], it is possible that `fabricPathEp` objects were created with an incorrect DN format. As a result, the related `infraRsHPathAtt` objects pointing to those `fabricPathEp` will also contain the invalid DN in their DN formatting given how ACI builds out object relations. + +Having these invalid DNs and then upgrading to a version that has the validations introduced in [CSCwh68103][23] will result in validation failures while trying to make changes to access policies, blocking new config from being accepted. The validation failure will present itself with the text `Failed to decode IfIndex, id: 0x.......`. + +If invalid DNs are found, first identify if the FEX IDs are still in use in case a window needs to be planned. If not in use, delete the `infraRsHPathAtt` objects having an invalid DN. + +This check queries `infraRsHPathAtt` objects related to eths, then check if any have DNs which are incorrectly formatted. + + [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script [1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html @@ -1823,4 +1837,5 @@ Because of this, the target version of your upgrade must be a version with a fix [19]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/5x/security-configuration/cisco-apic-security-configuration-guide-release-52x/https-access-52x.html [20]: https://www.cisco.com/c/en/us/support/docs/field-notices/740/fn74085.html [21]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvv30303 -[22]: https://www.cisco.com/c/dam/en/us/td/docs/unified_computing/ucs/c/sw/CIMC-Upgrade-Downgrade-Matrix/index.html \ No newline at end of file +[22]: https://www.cisco.com/c/dam/en/us/td/docs/unified_computing/ucs/c/sw/CIMC-Upgrade-Downgrade-Matrix/index.html +[23]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh68103 \ No newline at end of file diff --git a/tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json b/tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json new file mode 100644 index 0000000..7ab519b --- /dev/null +++ b/tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json @@ -0,0 +1,46 @@ +[ + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/extpaths-198/pathep-[eth1/7]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2021-10-23T08:33:12.722+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-105/extpaths-198/pathep-[eth1/7]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } + }, + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-__ui_l101_eth1--1/rsHPathAtt-[topology/pod-1/paths-101/pathep-[eth1/1]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2018-06-04T08:10:52.124+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/1]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } + } +] \ No newline at end of file diff --git a/tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json b/tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json new file mode 100644 index 0000000..71fc3bd --- /dev/null +++ b/tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json @@ -0,0 +1,46 @@ +[ + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth198/1/7]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2021-10-23T08:33:12.722+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } + }, + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-__ui_l101_eth1--1/rsHPathAtt-[topology/pod-1/paths-101/pathep-[eth1/1]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2018-06-04T08:10:52.124+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-101/pathep-[eth1/1]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } + } +] \ No newline at end of file diff --git a/tests/invalid_fex_rs_check/test_invalid_fex_rs_check.py b/tests/invalid_fex_rs_check/test_invalid_fex_rs_check.py new file mode 100644 index 0000000..bc9dbf3 --- /dev/null +++ b/tests/invalid_fex_rs_check/test_invalid_fex_rs_check.py @@ -0,0 +1,33 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + + +# icurl queries +hpath_api = 'infraRsHPathAtt.json?query-target-filter=wcard(infraRsHPathAtt.dn,"eth")' + + +@pytest.mark.parametrize( + "icurl_outputs, expected_result", + [ + ( + {hpath_api: read_data(dir, "infraRsHPathAtt_pos.json")}, + script.FAIL_UF, + ), + ( + {hpath_api: read_data(dir, "infraRsHPathAtt_neg.json")}, + script.PASS, + ), + + ], +) +def test_logic(mock_icurl, expected_result): + result = script.invalid_fex_rs_check(1, 1) + assert result == expected_result From ce1eda7f44ccec1fbb989d75939d6a0416290336 Mon Sep 17 00:00:00 2001 From: wilsonbc2 Date: Mon, 20 May 2024 09:28:53 -0400 Subject: [PATCH 04/15] 77 cscwf00416 aci 1602 leaf sends manually configured intf description as port description in lldp instead of dn (#123) * Added check for CSCwf00416 LLDP custom interface descriptions * Added error handling if no tversion is given * resolve review comments --------- Co-authored-by: gmonroy --- aci-preupgrade-validation-script.py | 27 ++++++ docs/docs/validations.md | 40 ++++++++- .../fvRsDomAtt_neg.json | 1 + .../fvRsDomAtt_pos.json | 1 + .../infraPortBlk_neg.json | 1 + .../infraPortBlk_pos.json | 1 + ...ldp_custom_int_description_defect_check.py | 89 +++++++++++++++++++ 7 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 tests/lldp_custom_int_description_defect_check/fvRsDomAtt_neg.json create mode 100644 tests/lldp_custom_int_description_defect_check/fvRsDomAtt_pos.json create mode 100644 tests/lldp_custom_int_description_defect_check/infraPortBlk_neg.json create mode 100644 tests/lldp_custom_int_description_defect_check/infraPortBlk_pos.json create mode 100644 tests/lldp_custom_int_description_defect_check/test_lldp_custom_int_description_defect_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 865a157..5fdfbc2 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3447,6 +3447,32 @@ def invalid_fex_rs_check(index, total_checks, **kwargs): return result +def lldp_custom_int_description_defect_check(index, total_checks, tversion, **kwargs): + title = 'LLDP Custom Interface Description Defect' + result = PASS + msg = '' + headers = ["Potential Defect"] + data = [] + recommended_action = 'Target version is not recommended; Custom interface descriptions and lazy VMM domain attachments found.' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#lldp-custom-interface-description' + print_title(title, index, total_checks) + + if not tversion: + print_result(title, MANUAL, "Target version not supplied. Skipping.") + return MANUAL + + if tversion.major1 == '6' and tversion.older_than('6.0(3a)'): + custom_int_count = icurl('class', 'infraPortBlk.json?query-target-filter=ne(infraPortBlk.descr,"")&rsp-subtree-include=count')[0]['moCount']['attributes']['count'] + lazy_vmm_count = icurl('class','fvRsDomAtt.json?query-target-filter=and(eq(fvRsDomAtt.tCl,"vmmDomP"),eq(fvRsDomAtt.resImedcy,"lazy"))&rsp-subtree-include=count')[0]['moCount']['attributes']['count'] + + if int(custom_int_count) > 0 and int(lazy_vmm_count) > 0: + result = FAIL_O + data.append(['CSCwf00416']) + + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result + + if __name__ == "__main__": prints(' ==== %s%s, Script Version %s ====\n' % (ts, tz, SCRIPT_VERSION)) prints('!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!\n') @@ -3541,6 +3567,7 @@ def invalid_fex_rs_check(index, total_checks, **kwargs): fabric_dpp_check, n9k_c93108tc_fx3p_interface_down_check, invalid_fex_rs_check, + lldp_custom_int_description_defect_check, ] summary = {PASS: 0, FAIL_O: 0, FAIL_UF: 0, ERROR: 0, MANUAL: 0, POST: 0, NA: 0, 'TOTAL': len(checks)} diff --git a/docs/docs/validations.md b/docs/docs/validations.md index bfd1462..271aad8 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -153,6 +153,7 @@ Items | Defect | This Script [CoS 3 with Dynamic Packet Prioritization][d12] | CSCwf05073 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [N9K-C93108TC-FX3P/FX3H Interface Down][d13] | CSCwh81430 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [Invalid FEX fabricPathEp DN References][d14] | CSCwh68103 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: +[LLDP Custom Interface Description][d15] | CSCwf00416 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [d1]: #ep-announce-compatibility @@ -169,6 +170,7 @@ Items | Defect | This Script [d12]: #cos-3-with-dynamic-packet-prioritization [d13]: #n9k-c93108tc-fx3pfx3h-interface-down [d14]: #invalid-fex-fabricpathep-dn-references +[d15]: #lldp-custom-interface-description ## General Check Details @@ -1815,6 +1817,41 @@ This check queries `infraRsHPathAtt` objects related to eths, then check if any + +### LLDP Custom Interface Description + +Due to the defect [CSCwf00416][24], custom interface descriptions may override the port topology DN. In ACI LLDP should always advertise the topology DN as the port description irrespective of whether an interface description is configured or not. + +In cases where there is a custom interface description and a VMM-integrated deployment with deploy immediacy set to on-demand, connectivity may break on upgrade. If both of these features are enabled it is not recommended to upgrade to 6.0(1) or 6.0(2). + +!!! note + To check for any custom interface descriptions, you can use the following moquery command. + ``` + apic1# moquery -c infraPortBlk -x query-target-filter=ne\(infraPortBlk.descr,""\) + Total Objects shown: 11 + + # infra.PortBlk + name : portblock1 + annotation : + childAction : + descr : port 30 on Leaf 101 and 103 to FI-B <<< Description is set + dn : uni/infra/accportprof-system-port-profile-node-103/hports-system-port-selector-accbundle-VPC_FIB-typ-range/portblk-portblock1 + --- omit --- + ``` + + To check for any VMM Domains using on-demand deploy immediacy, you can use the following moquery command. + ``` + apic1# moquery -c fvRsDomAtt -x query-target-filter=and\(eq\(fvRsDomAtt.tCl,\"vmmDomP\"\),eq\(fvRsDomAtt.instrImedcy,\"lazy\"\)\) + Total Objects shown: 90 + + # fv.RsDomAtt + tDn : uni/vmmp-VMware/dom-shared-dvs + dn : uni/tn-prod/ap-inet/epg-epg1/rsdomAtt-[uni/vmmp-VMware/dom-shared-dvs] + instrImedcy : lazy <<< deploy immediacy is on-demand + tCl : vmmDomP + --- omit --- + ``` + [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script [1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html [2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html @@ -1838,4 +1875,5 @@ This check queries `infraRsHPathAtt` objects related to eths, then check if any [20]: https://www.cisco.com/c/en/us/support/docs/field-notices/740/fn74085.html [21]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvv30303 [22]: https://www.cisco.com/c/dam/en/us/td/docs/unified_computing/ucs/c/sw/CIMC-Upgrade-Downgrade-Matrix/index.html -[23]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh68103 \ No newline at end of file +[23]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh68103 +[24]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwf00416 diff --git a/tests/lldp_custom_int_description_defect_check/fvRsDomAtt_neg.json b/tests/lldp_custom_int_description_defect_check/fvRsDomAtt_neg.json new file mode 100644 index 0000000..f27438d --- /dev/null +++ b/tests/lldp_custom_int_description_defect_check/fvRsDomAtt_neg.json @@ -0,0 +1 @@ +[{"moCount":{"attributes":{"childAction":"","count":"0","dn":"","status":""}}}] diff --git a/tests/lldp_custom_int_description_defect_check/fvRsDomAtt_pos.json b/tests/lldp_custom_int_description_defect_check/fvRsDomAtt_pos.json new file mode 100644 index 0000000..379334b --- /dev/null +++ b/tests/lldp_custom_int_description_defect_check/fvRsDomAtt_pos.json @@ -0,0 +1 @@ +[{"moCount":{"attributes":{"childAction":"","count":"1","dn":"","status":""}}}] diff --git a/tests/lldp_custom_int_description_defect_check/infraPortBlk_neg.json b/tests/lldp_custom_int_description_defect_check/infraPortBlk_neg.json new file mode 100644 index 0000000..f27438d --- /dev/null +++ b/tests/lldp_custom_int_description_defect_check/infraPortBlk_neg.json @@ -0,0 +1 @@ +[{"moCount":{"attributes":{"childAction":"","count":"0","dn":"","status":""}}}] diff --git a/tests/lldp_custom_int_description_defect_check/infraPortBlk_pos.json b/tests/lldp_custom_int_description_defect_check/infraPortBlk_pos.json new file mode 100644 index 0000000..379334b --- /dev/null +++ b/tests/lldp_custom_int_description_defect_check/infraPortBlk_pos.json @@ -0,0 +1 @@ +[{"moCount":{"attributes":{"childAction":"","count":"1","dn":"","status":""}}}] diff --git a/tests/lldp_custom_int_description_defect_check/test_lldp_custom_int_description_defect_check.py b/tests/lldp_custom_int_description_defect_check/test_lldp_custom_int_description_defect_check.py new file mode 100644 index 0000000..20f86ac --- /dev/null +++ b/tests/lldp_custom_int_description_defect_check/test_lldp_custom_int_description_defect_check.py @@ -0,0 +1,89 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + + +# icurl queries +infraPortBlks = 'infraPortBlk.json?query-target-filter=ne(infraPortBlk.descr,"")&rsp-subtree-include=count' +fvRsDomAtts = 'fvRsDomAtt.json?query-target-filter=and(eq(fvRsDomAtt.tCl,"vmmDomP"),eq(fvRsDomAtt.resImedcy,"lazy"))&rsp-subtree-include=count' + + +@pytest.mark.parametrize( + "icurl_outputs, tversion, expected_result", + [ + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_pos.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_pos.json"), + }, + "6.0(2d)", + script.FAIL_O, + ), + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_pos.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_pos.json"), + }, + "6.0(1e)", + script.FAIL_O, + ), + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_pos.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_pos.json"), + }, + "6.0(4d)", + script.PASS, + ), + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_pos.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_pos.json"), + }, + "4.2(7d)", + script.PASS, + ), + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_pos.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_neg.json"), + }, + "6.0(2a)", + script.PASS, + ), + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_neg.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_pos.json"), + }, + "6.0(2a)", + script.PASS, + ), + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_neg.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_neg.json"), + }, + "6.0(2a)", + script.PASS, + ), + ( + { + infraPortBlks: read_data(dir, "infraPortBlk_neg.json"), + fvRsDomAtts: read_data(dir, "fvRsDomAtt_neg.json"), + }, + "5.2(5d)", + script.PASS, + ), + ], +) +def test_logic(mock_icurl, tversion, expected_result): + result = script.lldp_custom_int_description_defect_check(1, 1, script.AciVersion(tversion)) + assert result == expected_result From d2816586845b324e6772f1cd459567fa166fd29d Mon Sep 17 00:00:00 2001 From: GM Date: Mon, 20 May 2024 09:39:19 -0400 Subject: [PATCH 05/15] bump to v2.1.0 --- aci-preupgrade-validation-script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 5fdfbc2..f2c03e3 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -32,7 +32,7 @@ import os import re -SCRIPT_VERSION = "v2.0.0" +SCRIPT_VERSION = "v2.1.0" DONE = 'DONE' PASS = 'PASS' FAIL_O = 'FAIL - OUTAGE WARNING!!' From b0e15eed1a3da1fadf635e08f0b91fe633403c21 Mon Sep 17 00:00:00 2001 From: Enrique Estrada Date: Wed, 22 May 2024 15:12:11 -0600 Subject: [PATCH 06/15] Issue #25 Fix --- aci-preupgrade-validation-script.py | 73 +++++++++++++++++++ tests/static_route_overlap_check/fvRsCtx.json | 8 +- .../static_route_overlap_check/fvSubnet.json | 8 +- .../ipRouteP-notFound.json | 8 -- .../ipRouteP-outside.json | 7 +- .../static_route_overlap_check/ipRouteP.json | 7 +- .../l3extRsEctx.json | 8 +- .../test_static_route_overlap_check.py | 44 +++++++---- 8 files changed, 111 insertions(+), 52 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index edba75e..8e35c0e 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3302,6 +3302,78 @@ def subnet_scope_check(index, total_checks, cversion, **kwargs): print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) return result +def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs): + title = 'Static Route Subnet and BD Subnet Overlap' + result = PASS + msg = '' + headers = ["Node ID", "Node Name", "Recommended Action"] + data = [] + recommended_action = 'Do not use /32 routes that overlap with a BD subnet range ' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script' + print_title(title, index, total_checks) + iproute_regex = r'uni/tn-(?P[^/]+)/out-(?P[^/]+)/lnodep-(?P[^/]+)/rsnodeL3OutAtt-\[topology/pod-(?P[^/]+)/node-(?P\d{3,4})\]/rt-\[(?P[^/]+)/(?P\d{1,2})\]' + bd_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/rsctx' + subnet_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/subnet-\[(?P[^/]+/\d{2})\]' + + if (cversion.older_than("5.0(1a)") and tversion.newer_than("5.2(4a)") ): + #4 API Calls, one for each class + # Static Route (ipRouteP), L3out to Ctx (l3extRsEctx), + # BD to Ctx (fvRsCtx) and BD Subnet (fvSubnet) + slash32filter = 'ipRouteP.json?query-target-filter=and(wcard(ipRouteP.dn,"/32"))' + staticRoutes = icurl('class', slash32filter) + #Static Route Dictionary with VRF and L3out keys + #{"staticRoute_IP": {"vrf" : vrf_dn, "l3out": l3out_dn}} + staticroute_vrf = icurl('class', 'l3extRsEctx.json') + staticR_to_vrf = {} + for staticRoute in staticRoutes: + staticroute_array = re.search(iproute_regex, staticRoute['ipRouteP']['attributes']['dn']) + l3out_dn = 'uni/tn-' + staticroute_array.group("tenant") + '/out-' + staticroute_array.group("l3out")+ '/rsectx' + + for l3outCtx in staticroute_vrf: + l3outCtx_Vrf = {} + if l3outCtx['l3extRsEctx']['attributes']['dn'] == l3out_dn: + l3outCtx_Vrf['vrf'] = l3outCtx['l3extRsEctx']['attributes']['tDn'] + l3outCtx_Vrf['l3out'] = l3outCtx['l3extRsEctx']['attributes']['dn'].replace('/rsectx', '') + staticR_to_vrf[staticroute_array.group("addr")] = l3outCtx_Vrf + + #VRF Dictionary with BD List + #{"vrf1_dn" : [bd1_dn, bd1_dn ], } + bds_in_vrf = icurl('class', 'fvRsCtx.json') + vrf_to_bd = {} + for bd_ref in bds_in_vrf: + vrf_name = bd_ref['fvRsCtx']['attributes']['tDn'] + bd_list = vrf_to_bd.get(vrf_name, []) + bd_name = bd_ref['fvRsCtx']['attributes']['dn'].replace('/rsctx','') + bd_list.append(bd_name) + vrf_to_bd[vrf_name] = bd_list + + # BD Dictionary with Subnet List + # {"bd1_dn" : [ subnet1 , subnet2] } + subnets_in_bd = icurl('class', 'fvSubnet.json') + bd_to_subnet = {} + for subnet in subnets_in_bd: + try: + subnet_array = re.search(subnet_regex, subnet['fvSubnet']['attributes']['dn']) + bd_dn = 'uni/tn-' + subnet_array.group("tenant") + '/BD-' + subnet_array.group("bd") + subnet_list = bd_to_subnet.get(bd_dn, []) + subnet_list.append(subnet_array.group("subnet")) + bd_to_subnet[bd_dn] = subnet_list + except: + continue + + for static_route, info in staticR_to_vrf.items(): + for bd in vrf_to_bd[info['vrf']]: + for subnet in bd_to_subnet[bd]: + if IPAddress.ip_in_subnet(static_route, subnet): + error_message = 'Overlapping between Static Route ' + static_route + ' in L3out '+ info['l3out'] + ' and BD Subnet ' + subnet + ' in BD ' + bd + data.append([error_message]) + + if data: + result = FAIL_O + + + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result if __name__ == "__main__": prints(' ==== %s%s, Script Version %s ====\n' % (ts, tz, SCRIPT_VERSION)) @@ -3380,6 +3452,7 @@ def subnet_scope_check(index, total_checks, cversion, **kwargs): oob_mgmt_security_check, eecdh_cipher_check, subnet_scope_check, + static_route_overlap_check, # Bugs ep_announce_check, diff --git a/tests/static_route_overlap_check/fvRsCtx.json b/tests/static_route_overlap_check/fvRsCtx.json index e67bc77..a98ac0f 100644 --- a/tests/static_route_overlap_check/fvRsCtx.json +++ b/tests/static_route_overlap_check/fvRsCtx.json @@ -4,11 +4,7 @@ "attributes": { "annotation": "", "childAction": "", - "dn": "uni/tn-av/BD-bd1/rsctx", - "extMngdBy": "", - "forceResolve": "yes", - "lcOwn": "local", - "modTs": "2024-04-12T19:18:44.213+00:00", + "dn": "uni/tn-AA/BD-bd1/rsctx", "monPolDn": "uni/tn-common/monepg-default", "rType": "mo", "state": "formed", @@ -16,7 +12,7 @@ "status": "", "tCl": "fvCtx", "tContextDn": "", - "tDn": "uni/tn-av/ctx-1", + "tDn": "uni/tn-AA/ctx-1", "tRn": "ctx-1", "tType": "name", "tnFvCtxName": "1", diff --git a/tests/static_route_overlap_check/fvSubnet.json b/tests/static_route_overlap_check/fvSubnet.json index 772c942..155681f 100644 --- a/tests/static_route_overlap_check/fvSubnet.json +++ b/tests/static_route_overlap_check/fvSubnet.json @@ -8,16 +8,10 @@ "ctrl": "", "debugMessage": "", "descr": "", - "dn": "uni/tn-av/BD-bd1/subnet-[81.81.81.1/24]", + "dn": "uni/tn-AA/BD-bd1/subnet-[81.81.81.1/24]", "extMngdBy": "", "ip": "81.81.81.1/24", "ipDPLearning": "enabled", - "lcOwn": "local", - "modTs": "2024-04-12T19:18:44.213+00:00", - "monPolDn": "uni/tn-common/monepg-default", - "name": "", - "nameAlias": "", - "preferred": "no", "scope": "private", "status": "", "uid": "15374", diff --git a/tests/static_route_overlap_check/ipRouteP-notFound.json b/tests/static_route_overlap_check/ipRouteP-notFound.json index 621c92d..32960f8 100644 --- a/tests/static_route_overlap_check/ipRouteP-notFound.json +++ b/tests/static_route_overlap_check/ipRouteP-notFound.json @@ -1,10 +1,2 @@ [ - { - "error": { - "attributes": { - "code": "122", - "text": "class ipRouteP not found" - } - } - } ] \ No newline at end of file diff --git a/tests/static_route_overlap_check/ipRouteP-outside.json b/tests/static_route_overlap_check/ipRouteP-outside.json index 4ab1a3e..80aebb1 100644 --- a/tests/static_route_overlap_check/ipRouteP-outside.json +++ b/tests/static_route_overlap_check/ipRouteP-outside.json @@ -6,15 +6,10 @@ "annotation": "", "childAction": "", "descr": "", - "dn": "uni/tn-av/out-av_static/lnodep-av_static_nodeProfile/rsnodeL3OutAtt-[topology/pod-1/node-101]/rt-[81.81.81.81/32]", + "dn": "uni/tn-AA/out-static/lnodep-static_nodeProfile/rsnodeL3OutAtt-[topology/pod-1/node-101]/rt-[81.81.91.81/32]", "extMngdBy": "", "fromPfxLen": "0", "ip": "81.81.91.81/32", - "lcOwn": "local", - "modTs": "2024-04-15T04:23:57.234+00:00", - "monPolDn": "uni/tn-common/monepg-default", - "name": "", - "nameAlias": "", "pref": "1", "rtCtrl": "", "status": "", diff --git a/tests/static_route_overlap_check/ipRouteP.json b/tests/static_route_overlap_check/ipRouteP.json index 81b716c..929828b 100644 --- a/tests/static_route_overlap_check/ipRouteP.json +++ b/tests/static_route_overlap_check/ipRouteP.json @@ -6,15 +6,10 @@ "annotation": "", "childAction": "", "descr": "", - "dn": "uni/tn-av/out-av_static/lnodep-av_static_nodeProfile/rsnodeL3OutAtt-[topology/pod-1/node-101]/rt-[81.81.81.81/32]", + "dn": "uni/tn-AA/out-static/lnodep-static_nodeProfile/rsnodeL3OutAtt-[topology/pod-1/node-101]/rt-[81.81.81.81/32]", "extMngdBy": "", "fromPfxLen": "0", "ip": "81.81.81.81/32", - "lcOwn": "local", - "modTs": "2024-04-15T04:23:57.234+00:00", - "monPolDn": "uni/tn-common/monepg-default", - "name": "", - "nameAlias": "", "pref": "1", "rtCtrl": "", "status": "", diff --git a/tests/static_route_overlap_check/l3extRsEctx.json b/tests/static_route_overlap_check/l3extRsEctx.json index 5f0e9f1..e2a4944 100644 --- a/tests/static_route_overlap_check/l3extRsEctx.json +++ b/tests/static_route_overlap_check/l3extRsEctx.json @@ -4,19 +4,15 @@ "attributes": { "annotation": "", "childAction": "", - "dn": "uni/tn-av/out-av_static/rsectx", + "dn": "uni/tn-AA/out-static/rsectx", "extMngdBy": "", "forceResolve": "yes", - "lcOwn": "local", - "modTs": "2024-04-15T05:49:59.397+00:00", - "monPolDn": "uni/tn-common/monepg-default", - "rType": "mo", "state": "formed", "stateQual": "none", "status": "", "tCl": "fvCtx", "tContextDn": "", - "tDn": "uni/tn-av/ctx-1", + "tDn": "uni/tn-AA/ctx-1", "tRn": "ctx-1", "tType": "name", "tnFvCtxName": "1", diff --git a/tests/static_route_overlap_check/test_static_route_overlap_check.py b/tests/static_route_overlap_check/test_static_route_overlap_check.py index d3b3c15..e080e62 100644 --- a/tests/static_route_overlap_check/test_static_route_overlap_check.py +++ b/tests/static_route_overlap_check/test_static_route_overlap_check.py @@ -11,29 +11,47 @@ # icurl queries -staticRoutes = 'ipRouteP.json' -route_vrf = 'l3extRsEctx.json?query-target-filter=and(wcard(l3extRsEctx.dn,"tn-av.*.av_static"))' -bds_in_vrf = 'fvRsCtx.json?query-target-filter=and(eq(fvRsCtx.tDn,"uni/tn-av/ctx-1"))' -subnets_in_bd = 'fvSubnet.json?query-target-filter=and(wcard(fvSubnet.dn,"uni/tn-av/BD-bd1"))' +staticRoutes = 'ipRouteP.json?query-target-filter=and(wcard(ipRouteP.dn,"/32"))' +staticroute_vrf = 'l3extRsEctx.json' +bds_in_vrf = 'fvRsCtx.json' +subnets_in_bd = 'fvSubnet.json' @pytest.mark.parametrize( "icurl_outputs, cversion, tversion, expected_result", [ - ##FAILING + ##FAILING = AFFECTED VERSION + AFFECTED MO ( - {staticRoutes: read_data(dir, "ipRouteP.json"), route_vrf: read_data(dir, "l3extRsEctx.json"), - bds_in_vrf: read_data(dir, "fvRsCtx.json"),subnets_in_bd: read_data(dir, "fvSubnet.json")}, - "4.2(7f)", "5.2(8h)", script.FAIL_O, + {staticRoutes: read_data(dir, "ipRouteP.json"), + staticroute_vrf: read_data(dir, "l3extRsEctx.json"), + bds_in_vrf: read_data(dir, "fvRsCtx.json"), + subnets_in_bd: read_data(dir, "fvSubnet.json")}, + "4.2(7f)", "5.2(4d)", script.FAIL_O, ), - ##PASSING + + ##PASSING = AFFECTED VERSION + NON-AFFECTED MO ( - {staticRoutes: read_data(dir, "ipRouteP-outside.json"), route_vrf: read_data(dir, "l3extRsEctx.json"), - bds_in_vrf: read_data(dir, "fvRsCtx.json"),subnets_in_bd: read_data(dir, "fvSubnet.json")}, - "4.2(7f)", "5.2(8h)", script.FAIL_O, + {staticRoutes: read_data(dir, "ipRouteP-outside.json"), + staticroute_vrf: read_data(dir, "l3extRsEctx.json"), + bds_in_vrf: read_data(dir, "fvRsCtx.json"), + subnets_in_bd: read_data(dir, "fvSubnet.json")}, + "4.2(7f)", "5.2(4d)", script.PASS, ), + ##PASSING = NON-AFFECTED VERSION + AFFECTED MO ( - {}, "5.0(1h)", "6.2(8h)", script.PASS, + {staticRoutes: read_data(dir, "ipRouteP.json"), + staticroute_vrf: read_data(dir, "l3extRsEctx.json"), + bds_in_vrf: read_data(dir, "fvRsCtx.json"), + subnets_in_bd: read_data(dir, "fvSubnet.json")}, + "5.1(1a)", "5.2(4d)", script.PASS, + ), + ## PASSING = AFFECTED VERSION + AFFECTED MO NON EXISTING + ( + {staticRoutes: read_data(dir, "ipRouteP-notFound.json"), + staticroute_vrf: read_data(dir, "l3extRsEctx.json"), + bds_in_vrf: read_data(dir, "fvRsCtx.json"), + subnets_in_bd: read_data(dir, "fvSubnet.json")}, + "4.2(7f)", "5.2(4d)", script.PASS, ), ], ) From 6c16ae99752a0c54ad158e79a6a11104068a2813 Mon Sep 17 00:00:00 2001 From: wilsonbc2 Date: Thu, 23 May 2024 16:51:14 -0400 Subject: [PATCH 07/15] 50 newvalidation cscwb08081 set clause not applying if prefix list is empty or not explicitly matched (#128) * Adding check for route-map community match CSCwb08081 * Fixed formatting for get_switch_version. Now displays version and adds newline character. * rtmap_comm_match_defect_check now also checks for set statement in routemap. Fixed documentation. --- aci-preupgrade-validation-script.py | 60 ++++++++++++++- docs/docs/validations.md | 37 ++++++++- .../rtctrlCtxP_NEG.json | 1 + .../rtctrlCtxP_POS.json | 1 + .../rtctrlSubjP_NEG.json | 1 + .../rtctrlSubjP_POS.json | 1 + .../test_rtmap_comm_match_defect_check.py | 76 +++++++++++++++++++ 7 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 tests/rtmap_comm_match_defect_check/rtctrlCtxP_NEG.json create mode 100644 tests/rtmap_comm_match_defect_check/rtctrlCtxP_POS.json create mode 100644 tests/rtmap_comm_match_defect_check/rtctrlSubjP_NEG.json create mode 100644 tests/rtmap_comm_match_defect_check/rtctrlSubjP_POS.json create mode 100644 tests/rtmap_comm_match_defect_check/test_rtmap_comm_match_defect_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index f2c03e3..d69e40a 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -756,7 +756,7 @@ def get_switch_version(**kwargs): version = AciVersion(version) if lowest_sw_ver.newer_than(str(version)): lowest_sw_ver = version - + prints('%s\n' % lowest_sw_ver) return lowest_sw_ver @@ -3418,6 +3418,63 @@ def subnet_scope_check(index, total_checks, cversion, **kwargs): print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) return result +def rtmap_comm_match_defect_check(index, total_checks, tversion, **kwargs): + title = 'Route-map Community Match Defect' + result = PASS + msg = '' + headers = ["Route-map DN", "Route-map Match DN", "Failure Reason"] + data = [] + recommended_action = 'Add a prefix list match to each route-map prior to upgrading.' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations#route-map-community-match' + print_title(title, index, total_checks) + + if not tversion: + print_result(title, MANUAL, "Target version not supplied. Skipping.") + return MANUAL + + if (tversion.major1 == "5" and tversion.major2 == "2" and tversion.older_than("5.2(8a)")): + rtctrlSubjPs = icurl('class', 'rtctrlSubjP.json?rsp-subtree=full&rsp-subtree-class=rtctrlMatchCommFactor,rtctrlMatchRtDest&rsp-subtree-include=required') + if rtctrlSubjPs: + subj_dn_list = [] + for rtctrlSubjP in rtctrlSubjPs: + has_comm = False + has_dest = False + dn = rtctrlSubjP['rtctrlSubjP']['attributes']['dn'] + for child in rtctrlSubjP['rtctrlSubjP']['children']: + if child.get("rtctrlMatchCommTerm"): + has_comm = True + elif child.get("rtctrlMatchRtDest"): + has_dest = True + if has_comm and not has_dest: + subj_dn_list.append(dn) + + # Now check if affected match statement is in use by any route-map + if len(subj_dn_list) > 0: + rtctrlCtxPs = icurl('class','rtctrlCtxP.json?rsp-subtree=full&rsp-subtree-class=rtctrlRsCtxPToSubjP,rtctrlRsScopeToAttrP&rsp-subtree-include=required') + if rtctrlCtxPs: + for rtctrlCtxP in rtctrlCtxPs: + has_affected_subj = False + has_set = False + for child in rtctrlCtxP['rtctrlCtxP']['children']: + if child.get("rtctrlRsCtxPToSubjP") and child['rtctrlRsCtxPToSubjP']['attributes']['tDn'] in subj_dn_list: + has_affected_subj = True + subj_dn = child['rtctrlRsCtxPToSubjP']['attributes']['tDn'] + if child.get("rtctrlScope"): + for subchild in child['rtctrlScope']['children']: + if subchild.get("rtctrlRsScopeToAttrP"): + has_set = True + + if has_affected_subj and has_set: + dn = rtctrlCtxP['rtctrlCtxP']['attributes']['dn'] + parent_dn = '/'.join(dn.rsplit('/', 1)[:-1]) + data.append([parent_dn,subj_dn,"Route-map has community match statement but no prefix list."]) + + if data: + result = FAIL_O + + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result + def invalid_fex_rs_check(index, total_checks, **kwargs): title = 'Invalid FEX Relation Source' @@ -3568,6 +3625,7 @@ def lldp_custom_int_description_defect_check(index, total_checks, tversion, **kw n9k_c93108tc_fx3p_interface_down_check, invalid_fex_rs_check, lldp_custom_int_description_defect_check, + rtmap_comm_match_defect_check, ] summary = {PASS: 0, FAIL_O: 0, FAIL_UF: 0, ERROR: 0, MANUAL: 0, POST: 0, NA: 0, 'TOTAL': len(checks)} diff --git a/docs/docs/validations.md b/docs/docs/validations.md index 271aad8..c0fcea6 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -154,7 +154,7 @@ Items | Defect | This Script [N9K-C93108TC-FX3P/FX3H Interface Down][d13] | CSCwh81430 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [Invalid FEX fabricPathEp DN References][d14] | CSCwh68103 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [LLDP Custom Interface Description][d15] | CSCwf00416 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: - +[Route-map Community Match][d16] | CSCwb08081 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -171,6 +171,8 @@ Items | Defect | This Script [d13]: #n9k-c93108tc-fx3pfx3h-interface-down [d14]: #invalid-fex-fabricpathep-dn-references [d15]: #lldp-custom-interface-description +[d16]: #route-map-community-match + ## General Check Details @@ -1805,6 +1807,7 @@ The problem is related only to the front-panel interfaces Ethernet 1/1- 1/48. Op Because of this, the target version of your upgrade must be a version with a fix of CSCwh81430 when your fabric includes those switches mentioned above. See the Field Notice [FN74085][20] for details. + ### Invalid FEX fabricPathEp DN References If you have deployed a FEX on a version prior to having validations introduced in [CSCwh68103][23], it is possible that `fabricPathEp` objects were created with an incorrect DN format. As a result, the related `infraRsHPathAtt` objects pointing to those `fabricPathEp` will also contain the invalid DN in their DN formatting given how ACI builds out object relations. @@ -1817,7 +1820,6 @@ This check queries `infraRsHPathAtt` objects related to eths, then check if any - ### LLDP Custom Interface Description Due to the defect [CSCwf00416][24], custom interface descriptions may override the port topology DN. In ACI LLDP should always advertise the topology DN as the port description irrespective of whether an interface description is configured or not. @@ -1852,6 +1854,36 @@ In cases where there is a custom interface description and a VMM-integrated depl --- omit --- ``` +### Route-map Community Match + +Due to the defect [CSCwb08081][25], if you have a route-map with a community match statement but there is no prefix list match the set clause may not be applied. + +It is recommended if you are upgrading to an affected release to add a prefix list match statement prior to upgrade. + +!!! example + In this example, the Route-map match rule `rtctrlSubjP` has a community match `rtctrlMatchCommFactor` but no prefix list match `rtctrlMatchRtDest`. This match rule would be affected by the defect. + ``` + apic1# moquery -c rtctrlSubjP -x rsp-subtree=full -x rsp-subtree-class=rtctrlMatchCommFactor,rtctrlMatchRtDest | egrep "^#|dn " + # rtctrl.SubjP + dn : uni/tn-Cisco/subj-match-comm + # rtctrl.MatchCommTerm + dn : uni/tn-Cisco/subj-match-comm/commtrm-test + # rtctrl.MatchCommFactor + dn : uni/tn-Cisco/subj-match-comm/commtrm-test/commfct-regular:as2-nn2:4:15 + ``` + In order to fix this, navigate to `Tenants > "Cisco" > Policies > Protocol > Match Rules > "match-comm"` and add a prefix-list. + ``` + apic1# moquery -c rtctrlSubjP -x rsp-subtree=full -x rsp-subtree-class=rtctrlMatchCommFactor,rtctrlMatchRtDest | egrep "^#|dn " + # rtctrl.SubjP + dn : uni/tn-Cisco/subj-match-comm + # rtctrl.MatchCommTerm + dn : uni/tn-Cisco/subj-match-comm/commtrm-test + # rtctrl.MatchCommFactor + dn : uni/tn-Cisco/subj-match-comm/commtrm-test/commfct-regular:as2-nn2:4:15 + # rtctrl.MatchRtDest + dn : uni/tn-Cisco/subj-match-comm/dest-[0.0.0.0/0] + ``` + [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script [1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html [2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html @@ -1877,3 +1909,4 @@ In cases where there is a custom interface description and a VMM-integrated depl [22]: https://www.cisco.com/c/dam/en/us/td/docs/unified_computing/ucs/c/sw/CIMC-Upgrade-Downgrade-Matrix/index.html [23]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh68103 [24]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwf00416 +[25]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwb08081 diff --git a/tests/rtmap_comm_match_defect_check/rtctrlCtxP_NEG.json b/tests/rtmap_comm_match_defect_check/rtctrlCtxP_NEG.json new file mode 100644 index 0000000..65fb95f --- /dev/null +++ b/tests/rtmap_comm_match_defect_check/rtctrlCtxP_NEG.json @@ -0,0 +1 @@ +[{"rtctrlCtxP":{"attributes":{"action":"permit","annotation":"","childAction":"","descr":"","dn":"uni/tn-bw/prof-test/ctx-test","extMngdBy":"","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","name":"test","nameAlias":"","order":"0","status":"","uid":"15374","userdom":":all:"},"children":[{"rtctrlScope":{"attributes":{"annotation":"","childAction":"","descr":"","extMngdBy":"","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","name":"","nameAlias":"","rn":"scp","status":"","uid":"15374","userdom":":all:"},"children":[{"rtctrlRsScopeToAttrP":{"attributes":{"annotation":"","childAction":"","extMngdBy":"","forceResolve":"yes","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","rType":"mo","rn":"rsScopeToAttrP","state":"formed","stateQual":"none","status":"","tCl":"rtctrlAttrP","tContextDn":"","tDn":"uni/tn-bw/attr-set-as-path","tRn":"attr-set-as-path","tType":"name","tnRtctrlAttrPName":"set-as-path","uid":"0","userdom":":all:"}}}]}},{"rtctrlRsCtxPToSubjP":{"attributes":{"annotation":"","childAction":"","extMngdBy":"","forceResolve":"yes","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","rType":"mo","rn":"rsctxPToSubjP-deny-all-routes","state":"formed","stateQual":"none","status":"","tCl":"rtctrlSubjP","tContextDn":"","tDn":"uni/tn-bw/subj-deny-all-routes","tRn":"subj-deny-all-routes","tType":"name","tnRtctrlSubjPName":"deny-all-routes","uid":"15374","userdom":":all:"}}}]}}] diff --git a/tests/rtmap_comm_match_defect_check/rtctrlCtxP_POS.json b/tests/rtmap_comm_match_defect_check/rtctrlCtxP_POS.json new file mode 100644 index 0000000..65fb95f --- /dev/null +++ b/tests/rtmap_comm_match_defect_check/rtctrlCtxP_POS.json @@ -0,0 +1 @@ +[{"rtctrlCtxP":{"attributes":{"action":"permit","annotation":"","childAction":"","descr":"","dn":"uni/tn-bw/prof-test/ctx-test","extMngdBy":"","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","name":"test","nameAlias":"","order":"0","status":"","uid":"15374","userdom":":all:"},"children":[{"rtctrlScope":{"attributes":{"annotation":"","childAction":"","descr":"","extMngdBy":"","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","name":"","nameAlias":"","rn":"scp","status":"","uid":"15374","userdom":":all:"},"children":[{"rtctrlRsScopeToAttrP":{"attributes":{"annotation":"","childAction":"","extMngdBy":"","forceResolve":"yes","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","rType":"mo","rn":"rsScopeToAttrP","state":"formed","stateQual":"none","status":"","tCl":"rtctrlAttrP","tContextDn":"","tDn":"uni/tn-bw/attr-set-as-path","tRn":"attr-set-as-path","tType":"name","tnRtctrlAttrPName":"set-as-path","uid":"0","userdom":":all:"}}}]}},{"rtctrlRsCtxPToSubjP":{"attributes":{"annotation":"","childAction":"","extMngdBy":"","forceResolve":"yes","lcOwn":"local","modTs":"2024-05-23T12:33:59.880-04:00","monPolDn":"uni/tn-common/monepg-default","rType":"mo","rn":"rsctxPToSubjP-deny-all-routes","state":"formed","stateQual":"none","status":"","tCl":"rtctrlSubjP","tContextDn":"","tDn":"uni/tn-bw/subj-deny-all-routes","tRn":"subj-deny-all-routes","tType":"name","tnRtctrlSubjPName":"deny-all-routes","uid":"15374","userdom":":all:"}}}]}}] diff --git a/tests/rtmap_comm_match_defect_check/rtctrlSubjP_NEG.json b/tests/rtmap_comm_match_defect_check/rtctrlSubjP_NEG.json new file mode 100644 index 0000000..5d63acc --- /dev/null +++ b/tests/rtmap_comm_match_defect_check/rtctrlSubjP_NEG.json @@ -0,0 +1 @@ +[{"rtctrlSubjP":{"attributes":{"annotation":"","childAction":"","descr":"","dn":"uni/tn-bw/subj-deny-all-routes","extMngdBy":"","lcOwn":"local","modTs":"2022-07-26T09:49:02.638-04:00","name":"deny-all-routes","nameAlias":"","status":"","uid":"15374","userdom":"all"},"children":[{"rtctrlMatchCommTerm":{"attributes":{"annotation":"","childAction":"","descr":"","extMngdBy":"","lcOwn":"local","modTs":"2024-05-21T12:29:17.075-04:00","name":"test","nameAlias":"","rn":"commtrm-test","status":"","type":"community","uid":"15374","userdom":":all:"},"children":[{"rtctrlMatchCommFactor":{"attributes":{"annotation":"","childAction":"","community":"regular:as2-nn2:4:15","descr":"","extMngdBy":"","lcOwn":"local","modTs":"2024-05-21T12:29:17.075-04:00","name":"","nameAlias":"","rn":"commfct-regular:as2-nn2:4:15","scope":"transitive","status":"","type":"community","uid":"15374","userdom":":all:"}}}]}},{"rtctrlMatchRtDest":{"attributes":{"aggregate":"yes","annotation":"","childAction":"","descr":"","extMngdBy":"","fromPfxLen":"0","ip":"0.0.0.0/0","lcOwn":"local","modTs":"2024-05-21T16:53:49.801-04:00","name":"","nameAlias":"","rn":"dest-[0.0.0.0/0]","status":"","toPfxLen":"0","type":"rt-dst","uid":"15374","userdom":":all:"}}}]}}] diff --git a/tests/rtmap_comm_match_defect_check/rtctrlSubjP_POS.json b/tests/rtmap_comm_match_defect_check/rtctrlSubjP_POS.json new file mode 100644 index 0000000..9350dff --- /dev/null +++ b/tests/rtmap_comm_match_defect_check/rtctrlSubjP_POS.json @@ -0,0 +1 @@ +[{"rtctrlSubjP":{"attributes":{"annotation":"","childAction":"","descr":"","dn":"uni/tn-bw/subj-deny-all-routes","extMngdBy":"","lcOwn":"local","modTs":"2022-07-26T09:49:02.638-04:00","name":"deny-all-routes","nameAlias":"","status":"","uid":"15374","userdom":"all"},"children":[{"rtctrlMatchCommTerm":{"attributes":{"annotation":"","childAction":"","descr":"","extMngdBy":"","lcOwn":"local","modTs":"2024-05-21T12:29:17.075-04:00","name":"test","nameAlias":"","rn":"commtrm-test","status":"","type":"community","uid":"15374","userdom":":all:"},"children":[{"rtctrlMatchCommFactor":{"attributes":{"annotation":"","childAction":"","community":"regular:as2-nn2:4:15","descr":"","extMngdBy":"","lcOwn":"local","modTs":"2024-05-21T12:29:17.075-04:00","name":"","nameAlias":"","rn":"commfct-regular:as2-nn2:4:15","scope":"transitive","status":"","type":"community","uid":"15374","userdom":":all:"}}}]}}]}}] diff --git a/tests/rtmap_comm_match_defect_check/test_rtmap_comm_match_defect_check.py b/tests/rtmap_comm_match_defect_check/test_rtmap_comm_match_defect_check.py new file mode 100644 index 0000000..c090d50 --- /dev/null +++ b/tests/rtmap_comm_match_defect_check/test_rtmap_comm_match_defect_check.py @@ -0,0 +1,76 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + + +# icurl queries +rtctrlSubjPs = "rtctrlSubjP.json?rsp-subtree=full&rsp-subtree-class=rtctrlMatchCommFactor,rtctrlMatchRtDest&rsp-subtree-include=required" +rtctrlCtxPs = "rtctrlCtxP.json?rsp-subtree=full&rsp-subtree-class=rtctrlRsCtxPToSubjP,rtctrlRsScopeToAttrP&rsp-subtree-include=required" + +@pytest.mark.parametrize( + "icurl_outputs, tversion, expected_result", + [ + ( + { + rtctrlSubjPs: read_data(dir, "rtctrlSubjP_NEG.json"), + rtctrlCtxPs: read_data(dir,"rtctrlCtxP_NEG.json") + }, + None, + script.MANUAL, + ), + ( + { + rtctrlSubjPs: [], + rtctrlCtxPs: [] + }, + "5.2(4d)", + script.PASS, + ), + ( + { + rtctrlSubjPs: read_data(dir, "rtctrlSubjP_NEG.json"), + rtctrlCtxPs: read_data(dir,"rtctrlCtxP_NEG.json") + }, + "5.2(5e)", + script.PASS, + ), + ( + { + rtctrlSubjPs: read_data(dir, "rtctrlSubjP_POS.json"), + rtctrlCtxPs: read_data(dir,"rtctrlCtxP_POS.json") + }, + "5.2(6a)", + script.FAIL_O, + ), + ( + { + rtctrlSubjPs: read_data(dir, "rtctrlSubjP_POS.json"), + rtctrlCtxPs: read_data(dir,"rtctrlCtxP_POS.json") + }, + "5.2(8d)", + script.PASS, + ), + ( + { + rtctrlSubjPs: read_data(dir, "rtctrlSubjP_POS.json"), + rtctrlCtxPs: read_data(dir,"rtctrlCtxP_POS.json") + }, + "6.0(3d)", + script.PASS, + ), + ], +) +def test_logic(mock_icurl, tversion, expected_result): + result = script.rtmap_comm_match_defect_check( + 1, + 1, + script.AciVersion(tversion) if tversion else None, + ) + assert result == expected_result From 453917b2a35c6ed809dd0e7927d635bae436f3d3 Mon Sep 17 00:00:00 2001 From: wilsonbc2 Date: Mon, 8 Jul 2024 13:20:57 -0400 Subject: [PATCH 08/15] 137 newvalidation ieee rs fec support for only certain switches (#138) * Issue #137: Added new check unsupported_fec_configuration_ex_check and updated validations.md * Added unit tests for unsupported_fec_configuration_ex_check and changed cversion to sw_cversion * Trimmed topSystem json for unit tests * Fixed empty data test case and removed redundant boolean vars --- aci-preupgrade-validation-script.py | 43 +++++++++ docs/docs/validations.md | 35 +++++++ ..._unsupported_fec_configuration_ex_check.py | 61 ++++++++++++ .../topSystem_neg.json | 40 ++++++++ .../topSystem_pos.json | 92 +++++++++++++++++++ 5 files changed, 271 insertions(+) create mode 100644 tests/unsupported_fec_configuration_ex_check/test_unsupported_fec_configuration_ex_check.py create mode 100644 tests/unsupported_fec_configuration_ex_check/topSystem_neg.json create mode 100644 tests/unsupported_fec_configuration_ex_check/topSystem_pos.json diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index d69e40a..e75db39 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3530,6 +3530,48 @@ def lldp_custom_int_description_defect_check(index, total_checks, tversion, **kw return result +def unsupported_fec_configuration_ex_check(index, total_checks, sw_cversion, tversion, **kwargs): + title = 'Unsupported FEC Configuration For N9K-C93180YC-EX' + result = PASS + msg = '' + headers = ["Pod ID", "Node ID", "Switch Model", "Interface", "FEC Mode"] + data = [] + recommended_action = 'Nexus C93180YC-EX switches do not support IEEE-RS-FEC or CONS16-RS-FEC mode. Misconfigured ports will be hardware disabled upon upgrade. Remove unsupported FEC configuration prior to upgrade.' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#unsupported-fec-configuration-for-n9k-c93180yc-ex' + print_title(title, index, total_checks) + + if not tversion: + print_result(title, MANUAL, "Target version not supplied. Skipping.") + return MANUAL + + if sw_cversion.older_than('5.0(1a)') and tversion.newer_than("5.0(1a)"): + api = 'topSystem.json' + api += '?rsp-subtree=children&rsp-subtree-class=l1PhysIf,eqptCh' + api += '&rsp-subtree-filter=or(eq(l1PhysIf.fecMode,"ieee-rs-fec"),eq(l1PhysIf.fecMode,"cons16-rs-fec"),eq(eqptCh.model,"N9K-C93180YC-EX"))' + api += '&rsp-subtree-include=required' + topSystems = icurl('class', api) + for topSystem in topSystems: + model = None + l1PhysIfs = [] + for child in topSystem['topSystem']['children']: + if child.get("eqptCh"): + model = child['eqptCh']['attributes']['model'] + elif child.get("l1PhysIf"): + interface = child['l1PhysIf']['attributes']['id'] + fecMode = child['l1PhysIf']['attributes']['fecMode'] + l1PhysIfs.append({"interface":interface,"fecMode":fecMode}) + if model and l1PhysIfs: + pod_id = topSystem['topSystem']['attributes']['podId'] + node_id = topSystem['topSystem']['attributes']['id'] + for l1PhysIf in l1PhysIfs: + data.append([pod_id,node_id,model,l1PhysIf['interface'],l1PhysIf['fecMode']]) + if data: + result = FAIL_O + + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result + + if __name__ == "__main__": prints(' ==== %s%s, Script Version %s ====\n' % (ts, tz, SCRIPT_VERSION)) prints('!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!\n') @@ -3608,6 +3650,7 @@ def lldp_custom_int_description_defect_check(index, total_checks, tversion, **kw oob_mgmt_security_check, eecdh_cipher_check, subnet_scope_check, + unsupported_fec_configuration_ex_check, # Bugs ep_announce_check, diff --git a/docs/docs/validations.md b/docs/docs/validations.md index c0fcea6..8cfc561 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -116,6 +116,7 @@ Items | Faults | This Script [OoB Mgmt Security][c13] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: [EECDH SSL Cipher Disabled][c14] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: [BD and EPG Subnet must have matching scopes][c15] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: +[Unsupported FEC Configuration for N9K-C93180YC-EX][c16] | :white_check_mark: | :no_entry_sign: | :no_entry_sign: [c1]: #vpc-paired-leaf-switches @@ -133,6 +134,7 @@ Items | Faults | This Script [c13]: #oob-mgmt-security [c14]: #eecdh-ssl-cipher [c15]: #bd-and-epg-subnet-must-have-matching-scopes +[c16]: #unsupported-fec-configuration-for-n9k-c93180yc-ex ### Defect Condition Checks @@ -1641,6 +1643,38 @@ Before the fix implemented in [CSCvv30303][21], it was possible for a BD and an [CSCvv30303][21] introduced policy validations to prevent this configuration and enforce that matching subnets defined in both the BD and related EPG have the same scope. It is imperative that identified mismatching subnet scopes are corrected within an ACI fabric to prevent unexpected traffic pattern issues in the future. +### Unsupported FEC Configuration for N9K-C93180YC-EX + +Nexus C93180YC-EX switches [do not support CONS16-RS-FEC or IEEE-RS-FEC][26] mode. In older versions a FEC mode misconfiguration does not cause the interface to be down. However after upgrading to 5.0(1) or later the port will become hardware disabled until the misconfiguration is removed. + +It is important to remove any unsupported configuration prior to ugprade to avoid any unexpected downtime. + +!!! example + On each N9K-C93180YC-EX switch, you can check the FEC mode for each interface with the following query: + ``` + leaf101# moquery -c l1PhysIf -x query-target-filter=or\(eq\(l1PhysIf.fecMode,\"ieee-rs-fec\"\),eq\(l1PhysIf.fecMode,\"cons16-rs-fec\"\)\) + Total Objects shown: 1 + + # l1.PhysIf + id : eth1/1 + adminSt : up + autoNeg : on + breakT : nonbroken + bw : 0 + childAction : + delay : 1 + descr : + dfeDelayMs : 0 + dn : sys/phys-[eth1/1] + dot1qEtherType : 0x8100 + emiRetrain : disable + enablePoap : no + ethpmCfgFailedBmp : + ethpmCfgFailedTs : 00:00:00:00.000 + ethpmCfgState : 2 + fcotChannelNumber : Channel32 + fecMode : ieee-rs-fec <<< + ``` ## Defect Check Details @@ -1910,3 +1944,4 @@ It is recommended if you are upgrading to an affected release to add a prefix li [23]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwh68103 [24]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwf00416 [25]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwb08081 +[26]: https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/kb/b_Cisco_ACI_and_Forward_Error_Correction.html#Cisco_Reference.dita_5cef69b3-b7fa-4bde-ba60-38129c9e7d82 diff --git a/tests/unsupported_fec_configuration_ex_check/test_unsupported_fec_configuration_ex_check.py b/tests/unsupported_fec_configuration_ex_check/test_unsupported_fec_configuration_ex_check.py new file mode 100644 index 0000000..50d9035 --- /dev/null +++ b/tests/unsupported_fec_configuration_ex_check/test_unsupported_fec_configuration_ex_check.py @@ -0,0 +1,61 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + + +# icurl queries +topSystems = 'topSystem.json' +topSystems += '?rsp-subtree=children&rsp-subtree-class=l1PhysIf,eqptCh' +topSystems += '&rsp-subtree-filter=or(eq(l1PhysIf.fecMode,"ieee-rs-fec"),eq(l1PhysIf.fecMode,"cons16-rs-fec"),eq(eqptCh.model,"N9K-C93180YC-EX"))' +topSystems += '&rsp-subtree-include=required' + +@pytest.mark.parametrize( + "icurl_outputs, sw_cversion, tversion, expected_result", + [ + ( + {topSystems: read_data(dir, "topSystem_pos.json")}, + "4.2(3d)", + "4.2(7f)", + script.PASS, + ), + ( + {topSystems: read_data(dir, "topSystem_pos.json")}, + "5.2(6d)", + "6.0(3c)", + script.PASS, + ), + ( + {topSystems: read_data(dir, "topSystem_pos.json")}, + "4.2(7f)", + "5.2(5c)", + script.FAIL_O, + ), + ( + {topSystems: read_data(dir, "topSystem_neg.json")}, + "4.2(7f)", + "5.2(5c)", + script.PASS, + ), + ( + {topSystems: []}, + "4.2(7f)", + "5.2(5c)", + script.PASS, + ), + ], +) +def test_logic(mock_icurl, sw_cversion, tversion, expected_result): + result = script.unsupported_fec_configuration_ex_check( + 1, + 1, + script.AciVersion(sw_cversion), + script.AciVersion(tversion), + ) + assert result == expected_result \ No newline at end of file diff --git a/tests/unsupported_fec_configuration_ex_check/topSystem_neg.json b/tests/unsupported_fec_configuration_ex_check/topSystem_neg.json new file mode 100644 index 0000000..865b925 --- /dev/null +++ b/tests/unsupported_fec_configuration_ex_check/topSystem_neg.json @@ -0,0 +1,40 @@ +[ + { + "topSystem": { + "attributes": { + "dn": "topology/pod-1/node-104/sys", + "id": "104", + "podId": "1" + }, + "children": [ + { + "l1PhysIf": { + "attributes": { + "fecMode": "ieee-rs-fec", + "id": "eth1/1" + } + } + } + ] + } + }, + { + "topSystem": { + "attributes": { + "dn": "topology/pod-1/node-103/sys", + "id": "103", + "podId": "1" + }, + "children": [ + { + "l1PhysIf": { + "attributes": { + "fecMode": "ieee-rs-fec", + "id": "eth1/1" + } + } + } + ] + } + } +] \ No newline at end of file diff --git a/tests/unsupported_fec_configuration_ex_check/topSystem_pos.json b/tests/unsupported_fec_configuration_ex_check/topSystem_pos.json new file mode 100644 index 0000000..392b573 --- /dev/null +++ b/tests/unsupported_fec_configuration_ex_check/topSystem_pos.json @@ -0,0 +1,92 @@ +[ + { + "topSystem": { + "attributes": { + "dn": "topology/pod-1/node-104/sys", + "id": "104", + "podId": "1" + }, + "children": [ + { + "l1PhysIf": { + "attributes": { + "fecMode": "ieee-rs-fec", + "id": "eth1/1" + } + } + } + ] + } + }, + { + "topSystem": { + "attributes": { + "dn": "topology/pod-1/node-101/sys", + "id": "101", + "podId": "1" + }, + "children": [ + { + "eqptCh": { + "attributes": { + "model": "N9K-C93180YC-EX" + } + } + }, + { + "l1PhysIf": { + "attributes": { + "fecMode": "ieee-rs-fec", + "id": "eth1/1" + } + } + } + ] + } + }, + { + "topSystem": { + "attributes": { + "dn": "topology/pod-1/node-102/sys", + "id": "102", + "podId": "1" + }, + "children": [ + { + "eqptCh": { + "attributes": { + "model": "N9K-C93180YC-EX" + } + } + }, + { + "l1PhysIf": { + "attributes": { + "fecMode": "ieee-rs-fec", + "id": "eth1/1" + } + } + } + ] + } + }, + { + "topSystem": { + "attributes": { + "dn": "topology/pod-1/node-103/sys", + "id": "103", + "podId": "1" + }, + "children": [ + { + "l1PhysIf": { + "attributes": { + "fecMode": "ieee-rs-fec", + "id": "eth1/1" + } + } + } + ] + } + } +] \ No newline at end of file From a872016f4221b1ce0961f3f7ae2ff62b46f804c2 Mon Sep 17 00:00:00 2001 From: wilsonbc2 Date: Wed, 24 Jul 2024 12:55:29 -0400 Subject: [PATCH 09/15] fix 133: Remove ssh-dss from ssh arguments --- aci-preupgrade-validation-script.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index e75db39..877d382 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -180,7 +180,6 @@ def connect(self): logging.debug( "spawning new pexpect connection: ssh %s@%s -p %d" % (self.username, self.hostname, self.port)) no_verify = " -o StrictHostKeyChecking=no -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null" - no_verify += " -o HostKeyAlgorithms=+ssh-dss" if self.verify: no_verify = "" self.child = pexpect.spawn("ssh %s %s@%s -p %d" % (no_verify, self.username, self.hostname, self.port), searchwindowsize=self.searchwindowsize) From 7a39ee68cfe096ffb676027646f96d5b195a4344 Mon Sep 17 00:00:00 2001 From: GM Date: Thu, 8 Aug 2024 17:57:22 -0400 Subject: [PATCH 10/15] invalid_fex_rs_check; check fex_ id >= 101 (#146) * invalid_fex_rs_check; check fex_ id >= 101 * review changes --- aci-preupgrade-validation-script.py | 5 +- .../infraRsHPathAtt_neg.json | 44 +++++++++++++ .../infraRsHPathAtt_pos.json | 66 +++++++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 877d382..def6e61 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3491,10 +3491,11 @@ def invalid_fex_rs_check(index, total_checks, **kwargs): for rs in infraRsHPathAtt: dn = rs["infraRsHPathAtt"]["attributes"]["dn"] - m = re.search(r'eth(?P\d+)\/\d\/\d', dn) + m = re.search(r'eth(?P\d{3})\/\d\/\d', dn) if m: fex_id = m.group('fex') - data.append([fex_id, dn]) + if int(fex_id) >= 101: + data.append([fex_id, dn]) if data: result = FAIL_UF diff --git a/tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json b/tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json index 7ab519b..561c93c 100644 --- a/tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json +++ b/tests/invalid_fex_rs_check/infraRsHPathAtt_neg.json @@ -42,5 +42,49 @@ "userdom": "" } } + }, + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth100/1/7]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2021-10-23T08:33:12.722+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } + }, + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth1/30/11]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2021-10-23T08:33:12.722+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } } ] \ No newline at end of file diff --git a/tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json b/tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json index 71fc3bd..c79d139 100644 --- a/tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json +++ b/tests/invalid_fex_rs_check/infraRsHPathAtt_pos.json @@ -21,6 +21,28 @@ } } }, + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth101/1/20]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2021-10-23T08:33:12.722+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } +}, { "infraRsHPathAtt": { "attributes": { @@ -42,5 +64,49 @@ "userdom": "" } } + }, + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth13/1/4]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2021-10-23T08:33:12.722+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } + }, + { + "infraRsHPathAtt": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/infra/hpaths-105_eth198_1_7/rsHPathAtt-[topology/pod-1/paths-105/pathep-[eth1/11/11]]", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2021-10-23T08:33:12.722+09:00", + "rType": "mo", + "state": "unformed", + "stateQual": "none", + "status": "", + "tCl": "fabricPathEp", + "tDn": "topology/pod-1/paths-105/pathep-[eth198/1/7]", + "tType": "mo", + "uid": "15374", + "userdom": "" + } + } } ] \ No newline at end of file From 76513f4f9af9bfdc5950cf79ff0262dc8ce3d319 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 12 Aug 2024 10:19:10 -0400 Subject: [PATCH 11/15] doc + review --- aci-preupgrade-validation-script.py | 173 +++++++----------- docs/docs/validations.md | 11 ++ ...uteP-notFound.json => ipRouteP_empty.json} | 0 ...pRouteP-outside.json => ipRouteP_neg.json} | 0 .../{ipRouteP.json => ipRouteP_pos.json} | 0 .../test_static_route_overlap_check.py | 29 +-- 6 files changed, 93 insertions(+), 120 deletions(-) rename tests/static_route_overlap_check/{ipRouteP-notFound.json => ipRouteP_empty.json} (100%) rename tests/static_route_overlap_check/{ipRouteP-outside.json => ipRouteP_neg.json} (100%) rename tests/static_route_overlap_check/{ipRouteP.json => ipRouteP_pos.json} (100%) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 8e35c0e..b665b4b 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3200,45 +3200,6 @@ def n9k_c93108tc_fx3p_interface_down_check(index, total_checks, tversion, **kwar print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) return result -def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs): - title = 'Static Route Subnet and BD Subnet Overlap' - result = PASS - msg = '' - headers = ["Node ID", "Node Name", "Recommended Action"] - data = [] - recommended_action = 'Do not use /32 routes that overlap with a BD subnet range ' - doc_url = 'https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwb91766' - print_title(title, index, total_checks) - iproute_regex = r'uni/tn-(?P[^/]+)/out-(?P[^/]+)/lnodep-(?P[^/]+)/rsnodeL3OutAtt-\[topology/pod-(?P[^/]+)/node-(?P\d{3,4})\]/rt-\[(?P[^/]+)/(?P\d{1,2})\]' - bd_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/rsctx' - subnet_regex = r'uni/tn-(?P[^/]+/BD-(?P[^/]+)/subnet-\[(?P[^/]+/\d{2})\])' - - if (cversion.older_than("5.0(1a)") and tversion.newer_than("5.0(1a)") ): - staticRoutes = icurl('class', 'ipRouteP.json') - for staticRoute in staticRoutes: - staticroute_array = re.search(iproute_regex, staticRoute['ipRouteP']['attributes']['dn']) - if staticroute_array and staticroute_array.group("netmask") == "32": - filter_vrf = 'l3extRsEctx.json?query-target-filter=and(wcard(l3extRsEctx.dn,"tn-'+ staticroute_array.group("tenant")+ '.*.' + staticroute_array.group("l3out") + '"))' - route_vrf = icurl('class', filter_vrf) - #Get BDs from the VRF - filter_bds = 'fvRsCtx.json?query-target-filter=and(eq(fvRsCtx.tDn,"'+ route_vrf[0]['l3extRsEctx']['attributes']['tDn'] + '"))' - bds_in_vrf = icurl('class', filter_bds) - for bd in bds_in_vrf: - bd_array = re.search(bd_regex, bd['fvRsCtx']['attributes']['dn']) - filter_subnet = 'fvSubnet.json?query-target-filter=and(wcard(fvSubnet.dn,"uni/tn-' + bd_array.group("tenant") + '/BD-' + bd_array.group("bd") + '"))' - subnets_in_bd = icurl('class', filter_subnet) - for subnet in subnets_in_bd: - subnet_array = re.search(subnet_regex, subnet['fvSubnet']['attributes']['dn']) - bdsubnet = subnet_array.group("subnet") - slash32 = staticroute_array.group("addr") - if IPAddress.ip_in_subnet(slash32, bdsubnet): - result = FAIL_O - error_message = 'Overlapping between Static Route ' + staticroute_array.group("addr") + 'and BD Subnet' + subnet['fvSubnet']['attributes']['dn'] - data.append([error_message, recommended_action]) - - print_result(title, result, msg, headers, data, doc_url=doc_url) - return result - def subnet_scope_check(index, total_checks, cversion, **kwargs): title = 'BD and EPG Subnet Scope Check' @@ -3302,78 +3263,72 @@ def subnet_scope_check(index, total_checks, cversion, **kwargs): print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) return result + def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs): - title = 'Static Route Subnet and BD Subnet Overlap' - result = PASS - msg = '' - headers = ["Node ID", "Node Name", "Recommended Action"] - data = [] - recommended_action = 'Do not use /32 routes that overlap with a BD subnet range ' - doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script' - print_title(title, index, total_checks) - iproute_regex = r'uni/tn-(?P[^/]+)/out-(?P[^/]+)/lnodep-(?P[^/]+)/rsnodeL3OutAtt-\[topology/pod-(?P[^/]+)/node-(?P\d{3,4})\]/rt-\[(?P[^/]+)/(?P\d{1,2})\]' - bd_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/rsctx' - subnet_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/subnet-\[(?P[^/]+/\d{2})\]' - - if (cversion.older_than("5.0(1a)") and tversion.newer_than("5.2(4a)") ): - #4 API Calls, one for each class - # Static Route (ipRouteP), L3out to Ctx (l3extRsEctx), - # BD to Ctx (fvRsCtx) and BD Subnet (fvSubnet) - slash32filter = 'ipRouteP.json?query-target-filter=and(wcard(ipRouteP.dn,"/32"))' - staticRoutes = icurl('class', slash32filter) - #Static Route Dictionary with VRF and L3out keys - #{"staticRoute_IP": {"vrf" : vrf_dn, "l3out": l3out_dn}} - staticroute_vrf = icurl('class', 'l3extRsEctx.json') - staticR_to_vrf = {} - for staticRoute in staticRoutes: - staticroute_array = re.search(iproute_regex, staticRoute['ipRouteP']['attributes']['dn']) - l3out_dn = 'uni/tn-' + staticroute_array.group("tenant") + '/out-' + staticroute_array.group("l3out")+ '/rsectx' - - for l3outCtx in staticroute_vrf: - l3outCtx_Vrf = {} - if l3outCtx['l3extRsEctx']['attributes']['dn'] == l3out_dn: - l3outCtx_Vrf['vrf'] = l3outCtx['l3extRsEctx']['attributes']['tDn'] - l3outCtx_Vrf['l3out'] = l3outCtx['l3extRsEctx']['attributes']['dn'].replace('/rsectx', '') - staticR_to_vrf[staticroute_array.group("addr")] = l3outCtx_Vrf - - #VRF Dictionary with BD List - #{"vrf1_dn" : [bd1_dn, bd1_dn ], } - bds_in_vrf = icurl('class', 'fvRsCtx.json') - vrf_to_bd = {} - for bd_ref in bds_in_vrf: - vrf_name = bd_ref['fvRsCtx']['attributes']['tDn'] - bd_list = vrf_to_bd.get(vrf_name, []) - bd_name = bd_ref['fvRsCtx']['attributes']['dn'].replace('/rsctx','') - bd_list.append(bd_name) - vrf_to_bd[vrf_name] = bd_list - - # BD Dictionary with Subnet List - # {"bd1_dn" : [ subnet1 , subnet2] } - subnets_in_bd = icurl('class', 'fvSubnet.json') - bd_to_subnet = {} - for subnet in subnets_in_bd: - try: - subnet_array = re.search(subnet_regex, subnet['fvSubnet']['attributes']['dn']) - bd_dn = 'uni/tn-' + subnet_array.group("tenant") + '/BD-' + subnet_array.group("bd") - subnet_list = bd_to_subnet.get(bd_dn, []) - subnet_list.append(subnet_array.group("subnet")) - bd_to_subnet[bd_dn] = subnet_list - except: - continue - - for static_route, info in staticR_to_vrf.items(): - for bd in vrf_to_bd[info['vrf']]: - for subnet in bd_to_subnet[bd]: - if IPAddress.ip_in_subnet(static_route, subnet): - error_message = 'Overlapping between Static Route ' + static_route + ' in L3out '+ info['l3out'] + ' and BD Subnet ' + subnet + ' in BD ' + bd - data.append([error_message]) - - if data: - result = FAIL_O - + title = 'L3out /32 Static Route and BD Subnet Overlap' + result = PASS + msg = '' + headers = ['L3out', '/32 Static Route', 'BD', 'BD Subnet'] + data = [] + recommended_action = 'Change /32 static route design or target a fixed version' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#l3out-32-overlap-with-bd-subnet' + print_title(title, index, total_checks) + iproute_regex = r'uni/tn-(?P[^/]+)/out-(?P[^/]+)/lnodep-(?P[^/]+)/rsnodeL3OutAtt-\[topology/pod-(?P[^/]+)/node-(?P\d{3,4})\]/rt-\[(?P[^/]+)/(?P\d{1,2})\]' + # bd_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/rsctx' + subnet_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/subnet-\[(?P[^/]+/\d{2})\]' + + if (cversion.older_than("5.2(6e)") and tversion.newer_than("5.0(1a)") and tversion.older_than("5.2(6e)") ): + slash32filter = 'ipRouteP.json?query-target-filter=and(wcard(ipRouteP.dn,"/32"))' + staticRoutes = icurl('class', slash32filter) + if staticRoutes: + staticroute_vrf = icurl('class', 'l3extRsEctx.json') + staticR_to_vrf = {} + for staticRoute in staticRoutes: + staticroute_array = re.search(iproute_regex, staticRoute['ipRouteP']['attributes']['dn']) + l3out_dn = 'uni/tn-' + staticroute_array.group("tenant") + '/out-' + staticroute_array.group("l3out")+ '/rsectx' + + for l3outCtx in staticroute_vrf: + l3outCtx_Vrf = {} + if l3outCtx['l3extRsEctx']['attributes']['dn'] == l3out_dn: + l3outCtx_Vrf['vrf'] = l3outCtx['l3extRsEctx']['attributes']['tDn'] + l3outCtx_Vrf['l3out'] = l3outCtx['l3extRsEctx']['attributes']['dn'].replace('/rsectx', '') + staticR_to_vrf[staticroute_array.group("addr")] = l3outCtx_Vrf + + + bds_in_vrf = icurl('class', 'fvRsCtx.json') + vrf_to_bd = {} + for bd_ref in bds_in_vrf: + vrf_name = bd_ref['fvRsCtx']['attributes']['tDn'] + bd_list = vrf_to_bd.get(vrf_name, []) + bd_name = bd_ref['fvRsCtx']['attributes']['dn'].replace('/rsctx','') + bd_list.append(bd_name) + vrf_to_bd[vrf_name] = bd_list + + subnets_in_bd = icurl('class', 'fvSubnet.json') + bd_to_subnet = {} + for subnet in subnets_in_bd: + try: + subnet_array = re.search(subnet_regex, subnet['fvSubnet']['attributes']['dn']) + bd_dn = 'uni/tn-' + subnet_array.group("tenant") + '/BD-' + subnet_array.group("bd") + subnet_list = bd_to_subnet.get(bd_dn, []) + subnet_list.append(subnet_array.group("subnet")) + bd_to_subnet[bd_dn] = subnet_list + except: + continue + + for static_route, info in staticR_to_vrf.items(): + for bd in vrf_to_bd[info['vrf']]: + for subnet in bd_to_subnet[bd]: + if IPAddress.ip_in_subnet(static_route, subnet): + # error_message = 'Overlapping between Static Route ' + static_route + ' in L3out '+ info['l3out'] + ' and BD Subnet ' + subnet + ' in BD ' + bd + data.append([info['l3out'], static_route, bd, subnet]) + + if data: + result = FAIL_O - print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) - return result + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result + if __name__ == "__main__": prints(' ==== %s%s, Script Version %s ====\n' % (ts, tz, SCRIPT_VERSION)) diff --git a/docs/docs/validations.md b/docs/docs/validations.md index eafebf5..cfd13b2 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -150,6 +150,8 @@ Items | Defect | This Script [VMM Uplink Container with empty Actives][d11] | CSCvr96408 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [CoS 3 with Dynamic Packet Prioritization][d12] | CSCwf05073 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [N9K-C93108TC-FX3P/FX3H Interface Down][d13] | CSCwh81430 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: +[L3out /32 overlap with BD Subnet][d14] | CSCwb91766 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: + [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -164,6 +166,7 @@ Items | Defect | This Script [d11]: #vmm-uplink-container-with-empty-actives [d12]: #cos-3-with-dynamic-packet-prioritization [d13]: #n9k-c93108tc-fx3pfx3h-interface-down +[d14]: #l3out-32-overlap-with-bd-subnet ## General Check Details @@ -1747,6 +1750,13 @@ Because of this, the target version of your upgrade must be a version with a fix +### L3out /32 overlap with BD Subnet + +Due to defect [CSCwb91766][22], L3out /32 Static Routes that overlap with BD Subnets within the same VRF will be programmed into RIB but not FIB of the relevant switches in the forwarding path. This will cause traffic loss as packets will not be able to take the /32 route, resulting in unexpecteded forwarding issues. + +This check will look for any such subnet overlaps and flag them for correction. + + [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script [1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html [2]: https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-release-notes-list.html @@ -1769,3 +1779,4 @@ Because of this, the target version of your upgrade must be a version with a fix [19]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/5x/security-configuration/cisco-apic-security-configuration-guide-release-52x/https-access-52x.html [20]: https://www.cisco.com/c/en/us/support/docs/field-notices/740/fn74085.html [21]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvv30303 +[22]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwb91766 \ No newline at end of file diff --git a/tests/static_route_overlap_check/ipRouteP-notFound.json b/tests/static_route_overlap_check/ipRouteP_empty.json similarity index 100% rename from tests/static_route_overlap_check/ipRouteP-notFound.json rename to tests/static_route_overlap_check/ipRouteP_empty.json diff --git a/tests/static_route_overlap_check/ipRouteP-outside.json b/tests/static_route_overlap_check/ipRouteP_neg.json similarity index 100% rename from tests/static_route_overlap_check/ipRouteP-outside.json rename to tests/static_route_overlap_check/ipRouteP_neg.json diff --git a/tests/static_route_overlap_check/ipRouteP.json b/tests/static_route_overlap_check/ipRouteP_pos.json similarity index 100% rename from tests/static_route_overlap_check/ipRouteP.json rename to tests/static_route_overlap_check/ipRouteP_pos.json diff --git a/tests/static_route_overlap_check/test_static_route_overlap_check.py b/tests/static_route_overlap_check/test_static_route_overlap_check.py index e080e62..0ef53fb 100644 --- a/tests/static_route_overlap_check/test_static_route_overlap_check.py +++ b/tests/static_route_overlap_check/test_static_route_overlap_check.py @@ -20,39 +20,46 @@ @pytest.mark.parametrize( "icurl_outputs, cversion, tversion, expected_result", [ - ##FAILING = AFFECTED VERSION + AFFECTED MO + ##FAIL = AFFECTED VERSION + AFFECTED MO ( - {staticRoutes: read_data(dir, "ipRouteP.json"), + {staticRoutes: read_data(dir, "ipRouteP_pos.json"), staticroute_vrf: read_data(dir, "l3extRsEctx.json"), bds_in_vrf: read_data(dir, "fvRsCtx.json"), subnets_in_bd: read_data(dir, "fvSubnet.json")}, "4.2(7f)", "5.2(4d)", script.FAIL_O, ), - - ##PASSING = AFFECTED VERSION + NON-AFFECTED MO + ##FAIL = AFFECTED VERSION + AFFECTED MO ( - {staticRoutes: read_data(dir, "ipRouteP-outside.json"), + {staticRoutes: read_data(dir, "ipRouteP_pos.json"), staticroute_vrf: read_data(dir, "l3extRsEctx.json"), bds_in_vrf: read_data(dir, "fvRsCtx.json"), subnets_in_bd: read_data(dir, "fvSubnet.json")}, - "4.2(7f)", "5.2(4d)", script.PASS, + "5.1(1a)", "5.2(4d)", script.FAIL_O, ), - ##PASSING = NON-AFFECTED VERSION + AFFECTED MO + ##PASS = AFFECTED VERSION + NON-AFFECTED MO ( - {staticRoutes: read_data(dir, "ipRouteP.json"), + {staticRoutes: read_data(dir, "ipRouteP_neg.json"), staticroute_vrf: read_data(dir, "l3extRsEctx.json"), bds_in_vrf: read_data(dir, "fvRsCtx.json"), subnets_in_bd: read_data(dir, "fvSubnet.json")}, - "5.1(1a)", "5.2(4d)", script.PASS, + "4.2(7f)", "5.2(4d)", script.PASS, ), - ## PASSING = AFFECTED VERSION + AFFECTED MO NON EXISTING + ## PASS = AFFECTED VERSION + AFFECTED MO NON EXISTING ( - {staticRoutes: read_data(dir, "ipRouteP-notFound.json"), + {staticRoutes: read_data(dir, "ipRouteP_empty.json"), staticroute_vrf: read_data(dir, "l3extRsEctx.json"), bds_in_vrf: read_data(dir, "fvRsCtx.json"), subnets_in_bd: read_data(dir, "fvSubnet.json")}, "4.2(7f)", "5.2(4d)", script.PASS, ), + ## PASS = NON-AFFECTED VERSION + AFFECTED MO + ( + {staticRoutes: read_data(dir, "ipRouteP_pos.json"), + staticroute_vrf: read_data(dir, "l3extRsEctx.json"), + bds_in_vrf: read_data(dir, "fvRsCtx.json"), + subnets_in_bd: read_data(dir, "fvSubnet.json")}, + "4.2(7f)", "5.2(6e)", script.PASS, + ), ], ) def test_logic(mock_icurl, cversion, tversion, expected_result): From c50410031776dc078338c807d158cf8c1fd10c86 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 12 Aug 2024 10:40:27 -0400 Subject: [PATCH 12/15] fix doc --- docs/docs/validations.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/docs/validations.md b/docs/docs/validations.md index cfd13b2..2be7df7 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -1754,8 +1754,7 @@ Because of this, the target version of your upgrade must be a version with a fix Due to defect [CSCwb91766][22], L3out /32 Static Routes that overlap with BD Subnets within the same VRF will be programmed into RIB but not FIB of the relevant switches in the forwarding path. This will cause traffic loss as packets will not be able to take the /32 route, resulting in unexpecteded forwarding issues. -This check will look for any such subnet overlaps and flag them for correction. - +If found, the target version of your upgrade should be a version with a fix for CSCwb91766. Otherwise, the other option is to change the routing design of the affected fabric. [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script [1]: https://www.cisco.com/c/dam/en/us/td/docs/Website/datacenter/apicmatrix/index.html From f8ed033fd141a72ae89963c8bf5b3b220a7ec22a Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 12 Aug 2024 10:50:27 -0400 Subject: [PATCH 13/15] remove generic try --- aci-preupgrade-validation-script.py | 12 ++--- .../static_route_overlap_check/fvSubnet.json | 48 +++++++++++-------- .../test_static_route_overlap_check.py | 4 +- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index b665b4b..ee9f1ec 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3275,7 +3275,7 @@ def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs print_title(title, index, total_checks) iproute_regex = r'uni/tn-(?P[^/]+)/out-(?P[^/]+)/lnodep-(?P[^/]+)/rsnodeL3OutAtt-\[topology/pod-(?P[^/]+)/node-(?P\d{3,4})\]/rt-\[(?P[^/]+)/(?P\d{1,2})\]' # bd_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/rsctx' - subnet_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/subnet-\[(?P[^/]+/\d{2})\]' + bd_subnet_regex = r'uni/tn-(?P[^/]+)/BD-(?P[^/]+)/subnet-\[(?P[^/]+/\d{2})\]' if (cversion.older_than("5.2(6e)") and tversion.newer_than("5.0(1a)") and tversion.older_than("5.2(6e)") ): slash32filter = 'ipRouteP.json?query-target-filter=and(wcard(ipRouteP.dn,"/32"))' @@ -3307,14 +3307,12 @@ def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs subnets_in_bd = icurl('class', 'fvSubnet.json') bd_to_subnet = {} for subnet in subnets_in_bd: - try: - subnet_array = re.search(subnet_regex, subnet['fvSubnet']['attributes']['dn']) - bd_dn = 'uni/tn-' + subnet_array.group("tenant") + '/BD-' + subnet_array.group("bd") + bd_subnet_re = re.search(bd_subnet_regex, subnet['fvSubnet']['attributes']['dn']) + if bd_subnet_re: + bd_dn = 'uni/tn-' + bd_subnet_re.group("tenant") + '/BD-' + bd_subnet_re.group("bd") subnet_list = bd_to_subnet.get(bd_dn, []) - subnet_list.append(subnet_array.group("subnet")) + subnet_list.append(bd_subnet_re.group("subnet")) bd_to_subnet[bd_dn] = subnet_list - except: - continue for static_route, info in staticR_to_vrf.items(): for bd in vrf_to_bd[info['vrf']]: diff --git a/tests/static_route_overlap_check/fvSubnet.json b/tests/static_route_overlap_check/fvSubnet.json index 155681f..2b135c9 100644 --- a/tests/static_route_overlap_check/fvSubnet.json +++ b/tests/static_route_overlap_check/fvSubnet.json @@ -1,23 +1,31 @@ [ - { - "fvSubnet": { - "attributes": { - "annotation": "", - "childAction": "", - "configIssues": "", - "ctrl": "", - "debugMessage": "", - "descr": "", - "dn": "uni/tn-AA/BD-bd1/subnet-[81.81.81.1/24]", - "extMngdBy": "", - "ip": "81.81.81.1/24", - "ipDPLearning": "enabled", - "scope": "private", - "status": "", - "uid": "15374", - "userdom": ":all:", - "virtual": "no" - } + { + "fvSubnet": { + "attributes": { + "dn": "uni/tn-AA/BD-bd1/subnet-[81.81.81.1/24]", + "extMngdBy": "", + "ip": "81.81.81.1/24", + "ipDPLearning": "enabled", + "scope": "private" } } - ] + }, + { + "fvSubnet": { + "attributes": { + "dn": "uni/tn-bcg1/ap-ap1/epg-epg-dhcpserver/subnet-[10.1.126.1/24]", + "extMngdBy": "", + "ip": "10.1.126.1/24", + "ipDPLearning": "enabled", + "lcOwn": "local", + "modTs": "2022-11-18T22:09:03.879+00:00", + "monPolDn": "uni/tn-common/monepg-default", + "name": "", + "nameAlias": "", + "preferred": "no", + "rn": "subnet-[10.1.126.1/24]", + "scope": "public" + } + } + } +] \ No newline at end of file diff --git a/tests/static_route_overlap_check/test_static_route_overlap_check.py b/tests/static_route_overlap_check/test_static_route_overlap_check.py index 0ef53fb..270641e 100644 --- a/tests/static_route_overlap_check/test_static_route_overlap_check.py +++ b/tests/static_route_overlap_check/test_static_route_overlap_check.py @@ -50,7 +50,7 @@ staticroute_vrf: read_data(dir, "l3extRsEctx.json"), bds_in_vrf: read_data(dir, "fvRsCtx.json"), subnets_in_bd: read_data(dir, "fvSubnet.json")}, - "4.2(7f)", "5.2(4d)", script.PASS, + "4.2(7f)", "5.2(4d)", script.PASS, ), ## PASS = NON-AFFECTED VERSION + AFFECTED MO ( @@ -58,7 +58,7 @@ staticroute_vrf: read_data(dir, "l3extRsEctx.json"), bds_in_vrf: read_data(dir, "fvRsCtx.json"), subnets_in_bd: read_data(dir, "fvSubnet.json")}, - "4.2(7f)", "5.2(6e)", script.PASS, + "4.2(7f)", "5.2(6e)", script.PASS, ), ], ) From 023cc2cf742d74fa7cd3f695a1ebac9a39f93bfc Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 12 Aug 2024 11:59:48 -0400 Subject: [PATCH 14/15] finish master merge --- aci-preupgrade-validation-script.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index b2535df..9a9d998 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3714,11 +3714,7 @@ def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs oob_mgmt_security_check, eecdh_cipher_check, subnet_scope_check, -<<<<<<< HEAD - static_route_overlap_check, -======= unsupported_fec_configuration_ex_check, ->>>>>>> master # Bugs ep_announce_check, @@ -3737,6 +3733,7 @@ def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs invalid_fex_rs_check, lldp_custom_int_description_defect_check, rtmap_comm_match_defect_check, + static_route_overlap_check ] summary = {PASS: 0, FAIL_O: 0, FAIL_UF: 0, ERROR: 0, MANUAL: 0, POST: 0, NA: 0, 'TOTAL': len(checks)} From ee2ead10578df2e0a2fdebf4aa695777fc225268 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 12 Aug 2024 12:02:35 -0400 Subject: [PATCH 15/15] remove comment --- aci-preupgrade-validation-script.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 9a9d998..9529c1b 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3626,7 +3626,6 @@ def static_route_overlap_check(index, total_checks, cversion, tversion, **kwargs for bd in vrf_to_bd[info['vrf']]: for subnet in bd_to_subnet[bd]: if IPAddress.ip_in_subnet(static_route, subnet): - # error_message = 'Overlapping between Static Route ' + static_route + ' in L3out '+ info['l3out'] + ' and BD Subnet ' + subnet + ' in BD ' + bd data.append([info['l3out'], static_route, bd, subnet]) if data: