From a5676fd736d4d9d9648170dbc6727de8dfa6ba03 Mon Sep 17 00:00:00 2001 From: joelebla Date: Tue, 3 Jun 2025 10:15:50 -0700 Subject: [PATCH 1/5] Add ISIS DTEP Check --- aci-preupgrade-validation-script.py | 65 +++ docs/docs/validations.md | 18 +- .../isisDTEp_NEG.json | 422 ++++++++++++++++++ .../isisDTEp_POS.json | 242 ++++++++++ .../test_isis_database_byte_check.py | 67 +++ 5 files changed, 813 insertions(+), 1 deletion(-) create mode 100644 tests/isis_database_byte_check/isisDTEp_NEG.json create mode 100644 tests/isis_database_byte_check/isisDTEp_POS.json create mode 100644 tests/isis_database_byte_check/test_isis_database_byte_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 7ccd3134..bc893be2 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -5101,6 +5101,69 @@ def ave_eol_check(index, total_checks, tversion, **kwargs): return result +def isis_database_byte_check(index, total_checks, tversion, **kwargs): + title = 'ISIS DTEPs Byte Check' + result = PASS + msg = '' + headers = ["ISIS DTEPs Byte Count", "Recommended Action"] + data = [] + recommended_action = 'Upgrade to a version with the fix for CSCwp15375. Current target version is affected.' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#isis-dteps-byte-check' + print_title(title, index, total_checks) + + if not tversion: + print_result(title, MANUAL, "Target version not supplied. Skipping.") + return MANUAL + + affected_versions = ["6.1(1f)", "6.1(2f)", "6.1(2g)", "6.1(3f)"] + is_affected = False + for version in affected_versions: + if tversion.same_as(version): + is_affected = True + break + + if not is_affected: + print_result(title, NA, "Target version not affected") + return NA + + isisDTEp_api = 'isisDTEp.json' + isisDTEp_api += '?query-target-filter=eq(isisDTEp.role,"spine")' + + isisDTEps = icurl('class', isisDTEp_api) + + physical_ids = set() + proxy_acast_mac_ids = set() + proxy_acast_v4_ids = set() + proxy_acast_v6_ids = set() + + for entry in isisDTEps: + dtep_type = entry['isisDTEp']['attributes']['type'] + dtep_id = entry['isisDTEp']['attributes']['id'] + + if dtep_type == "physical": + physical_ids.add(dtep_id) + elif dtep_type == "physical,proxy-acast-mac": + proxy_acast_mac_ids.add(dtep_id) + elif dtep_type == "physical,proxy-acast-v4": + proxy_acast_v4_ids.add(dtep_id) + elif dtep_type == "physical,proxy-acast-v6": + proxy_acast_v6_ids.add(dtep_id) + + for physical_id in physical_ids: + proxy_mac_id = next(iter(proxy_acast_mac_ids)) if proxy_acast_mac_ids else "" + proxy_v4_id = next(iter(proxy_acast_v4_ids)) if proxy_acast_v4_ids else "" + proxy_v6_id = next(iter(proxy_acast_v6_ids)) if proxy_acast_v6_ids else "" + + total_bytes = len(physical_id) + len(proxy_mac_id) + len(proxy_v4_id) + len(proxy_v6_id) + + if total_bytes >= 58: + result = FAIL_O + data.append([str(total_bytes), recommended_action]) + break + + print_result(title, result, msg, headers, data, 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') @@ -5216,6 +5279,7 @@ def ave_eol_check(index, total_checks, tversion, **kwargs): pbr_high_scale_check, standby_sup_sync_check, observer_db_size_check, + isis_database_byte_check, ] summary = {PASS: 0, FAIL_O: 0, FAIL_UF: 0, ERROR: 0, MANUAL: 0, POST: 0, NA: 0, 'TOTAL': len(checks)} @@ -5261,3 +5325,4 @@ def ave_eol_check(index, total_checks, tversion, **kwargs): prints('==== Script Version %s FIN ====' % (SCRIPT_VERSION)) subprocess.check_output(['rm', '-rf', DIR]) + diff --git a/docs/docs/validations.md b/docs/docs/validations.md index 19e2efad..c77cc4c4 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -184,6 +184,8 @@ Items | Defect | This Script [PBR High Scale][d23] | CSCwi66348 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [Standby Sup Image Sync][d24] | CSCwi66348 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [Observer Database Size][d25] | CSCvw45531 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: +[ISIS DTEPs Byte Check][d26] | CSCwp15375 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: + [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -210,6 +212,7 @@ Items | Defect | This Script [d23]: #pbr-high-scale [d24]: #standby-sup-image-sync [d25]: #observer-database-size +[d26]: #isis-dteps-byte-check ## General Check Details @@ -2541,6 +2544,18 @@ This check logs in to each APIC, checks the contents of the `/data2/dbstats/` di Certain high churn logging configurations have been found to grow this DB exceptionally large while on a non-fixed version. 'Contract Permit Logging' is one such configuration. +### ISIS DTEPs Byte Check + +Due to [CSCwp15375][57], tech support generation will result in a switch crash under the following conditions: +- The `isisDTEp` address for a given spine + PROXY-ACAST-MAC address + PROXY-ACAST-V4 address + PROXY-ACAST-V6 address equals 58 bytes or more +- The ACI software version is 6.1(1f), 6.1(2f), 6.1(2g), or 6.1(3f) + +Do not upgrade to any affected ACI software release if this check fails. + +!!! note + NDI integration can cause tech support generation to happen automatically, resulting in switch crash without user intervention. + + [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 @@ -2597,4 +2612,5 @@ This check logs in to each APIC, checks the contents of the `/data2/dbstats/` di [53]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvw45531 [54]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvt47850 [55]: https://www.cisco.com/c/en/us/products/collateral/cloud-systems-management/application-policy-infrastructure-controller-apic/eol-apic-virtual-edge-pod-pb.html -[56]: https://www.cisco.com/c/en/us/td/docs/dcn/whitepapers/cisco-aci-virtual-edge-migration.html \ No newline at end of file +[56]: https://www.cisco.com/c/en/us/td/docs/dcn/whitepapers/cisco-aci-virtual-edge-migration.html +[57]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp15375 diff --git a/tests/isis_database_byte_check/isisDTEp_NEG.json b/tests/isis_database_byte_check/isisDTEp_NEG.json new file mode 100644 index 00000000..b73a62f2 --- /dev/null +++ b/tests/isis_database_byte_check/isisDTEp_NEG.json @@ -0,0 +1,422 @@ +[ + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.65]", + "encapt": "unknown", + "id": "10.0.184.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.66]", + "encapt": "unknown", + "id": "10.0.184.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.64]", + "encapt": "unknown", + "id": "10.0.184.64", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.66]", + "encapt": "unknown", + "id": "10.0.128.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.65]", + "encapt": "unknown", + "id": "10.0.128.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.65]", + "encapt": "unknown", + "id": "10.0.184.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.66]", + "encapt": "unknown", + "id": "10.0.184.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.64]", + "encapt": "unknown", + "id": "10.0.184.64", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.66]", + "encapt": "unknown", + "id": "10.0.128.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.65]", + "encapt": "unknown", + "id": "10.0.128.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.65]", + "encapt": "unknown", + "id": "10.0.184.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.66]", + "encapt": "unknown", + "id": "10.0.184.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.64]", + "encapt": "unknown", + "id": "10.0.184.64", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.66]", + "encapt": "unknown", + "id": "10.0.128.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.65]", + "encapt": "unknown", + "id": "10.0.128.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.65]", + "encapt": "unknown", + "id": "10.0.184.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.66]", + "encapt": "unknown", + "id": "10.0.184.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.64]", + "encapt": "unknown", + "id": "10.0.184.64", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.66]", + "encapt": "unknown", + "id": "10.0.128.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.65]", + "encapt": "unknown", + "id": "10.0.128.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-202/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.65]", + "encapt": "unknown", + "id": "10.0.128.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-202/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.64]", + "encapt": "unknown", + "id": "10.0.184.64", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-202/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.66]", + "encapt": "unknown", + "id": "10.0.184.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-202/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.65]", + "encapt": "unknown", + "id": "10.0.184.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-201/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.66]", + "encapt": "unknown", + "id": "10.0.184.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-201/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.65]", + "encapt": "unknown", + "id": "10.0.184.65", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-201/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.128.66]", + "encapt": "unknown", + "id": "10.0.128.66", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-201/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[10.0.184.64]", + "encapt": "unknown", + "id": "10.0.184.64", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + } +] \ No newline at end of file diff --git a/tests/isis_database_byte_check/isisDTEp_POS.json b/tests/isis_database_byte_check/isisDTEp_POS.json new file mode 100644 index 00000000..529d8a60 --- /dev/null +++ b/tests/isis_database_byte_check/isisDTEp_POS.json @@ -0,0 +1,242 @@ +[ + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.129]", + "encapt": "unknown", + "id": "100.100.100.129", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.194]", + "encapt": "unknown", + "id": "100.100.100.194", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.192]", + "encapt": "unknown", + "id": "100.100.100.192", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-101/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.193]", + "encapt": "unknown", + "id": "100.100.100.193", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.194]", + "encapt": "unknown", + "id": "100.100.100.194", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.129]", + "encapt": "unknown", + "id": "100.100.100.129", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.192]", + "encapt": "unknown", + "id": "100.100.100.192", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-102/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.193]", + "encapt": "unknown", + "id": "100.100.100.193", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.129]", + "encapt": "unknown", + "id": "100.100.100.129", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.194]", + "encapt": "unknown", + "id": "100.100.100.194", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.192]", + "encapt": "unknown", + "id": "100.100.100.192", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-104/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.193]", + "encapt": "unknown", + "id": "100.100.100.193", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.194]", + "encapt": "unknown", + "id": "100.100.100.194", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-mac" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.129]", + "encapt": "unknown", + "id": "100.100.100.129", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.192]", + "encapt": "unknown", + "id": "100.100.100.192", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v4" + } + } + }, + { + "isisDTEp": { + "attributes": { + "childAction": "", + "dn": "topology/pod-1/node-103/sys/isis/inst-default/dom-overlay-1/lvl-l1/db-dtep/dtep-[100.100.100.193]", + "encapt": "unknown", + "id": "100.100.100.193", + "modTs": "never", + "name": "default", + "role": "spine", + "status": "", + "type": "physical,proxy-acast-v6" + } + } + } +] \ No newline at end of file diff --git a/tests/isis_database_byte_check/test_isis_database_byte_check.py b/tests/isis_database_byte_check/test_isis_database_byte_check.py new file mode 100644 index 00000000..49900666 --- /dev/null +++ b/tests/isis_database_byte_check/test_isis_database_byte_check.py @@ -0,0 +1,67 @@ +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 +isisDTEp_api = 'isisDTEp.json' +isisDTEp_api += '?query-target-filter=eq(isisDTEp.role,"spine")' + +@pytest.mark.parametrize( + "icurl_outputs, tversion, expected_result", + [ + ## Failure cases + ( + {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, + "6.1(1f)", + script.FAIL_O, + ), + ( + {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, + "6.1(2f)", + script.FAIL_O, + ), + ( + {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, + "6.1(2g)", + script.FAIL_O, + ), + ( + {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, + "6.1(3f)", + script.FAIL_O, + ), + + ## Pass cases + ( + {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, + "6.1(1f)", + script.PASS, + ), + ( + {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, + "6.1(2f)", + script.PASS, + ), + ( + {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, + "6.1(2g)", + script.PASS, + ), + ( + {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, + "6.1(3f)", + script.PASS, + ) + ] +) +def test_logic(mock_icurl, tversion, expected_result): + tversion = script.AciVersion(tversion) if tversion else None + result = script.isis_database_byte_check(1, 1, tversion) + assert result == expected_result From 6fc477c0945554521c1b8a70a04ce9c5d40e91b9 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 11 Jul 2025 12:29:16 -0400 Subject: [PATCH 2/5] verbiage cleanup --- aci-preupgrade-validation-script.py | 28 ++++++++++++++-------------- docs/docs/validations.md | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index bc893be2..b9dd5d0d 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -5102,44 +5102,44 @@ def ave_eol_check(index, total_checks, tversion, **kwargs): def isis_database_byte_check(index, total_checks, tversion, **kwargs): - title = 'ISIS DTEPs Byte Check' + title = 'ISIS DTEPs Byte Size' result = PASS msg = '' - headers = ["ISIS DTEPs Byte Count", "Recommended Action"] + headers = ["ISIS DTEPs Byte Size", "Recommended Action"] data = [] recommended_action = 'Upgrade to a version with the fix for CSCwp15375. Current target version is affected.' - doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#isis-dteps-byte-check' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#isis-dteps-byte-size' print_title(title, index, total_checks) if not tversion: print_result(title, MANUAL, "Target version not supplied. Skipping.") return MANUAL - + affected_versions = ["6.1(1f)", "6.1(2f)", "6.1(2g)", "6.1(3f)"] is_affected = False for version in affected_versions: if tversion.same_as(version): is_affected = True break - + if not is_affected: print_result(title, NA, "Target version not affected") return NA isisDTEp_api = 'isisDTEp.json' isisDTEp_api += '?query-target-filter=eq(isisDTEp.role,"spine")' - + isisDTEps = icurl('class', isisDTEp_api) - + physical_ids = set() proxy_acast_mac_ids = set() proxy_acast_v4_ids = set() proxy_acast_v6_ids = set() - + for entry in isisDTEps: dtep_type = entry['isisDTEp']['attributes']['type'] dtep_id = entry['isisDTEp']['attributes']['id'] - + if dtep_type == "physical": physical_ids.add(dtep_id) elif dtep_type == "physical,proxy-acast-mac": @@ -5148,22 +5148,23 @@ def isis_database_byte_check(index, total_checks, tversion, **kwargs): proxy_acast_v4_ids.add(dtep_id) elif dtep_type == "physical,proxy-acast-v6": proxy_acast_v6_ids.add(dtep_id) - + for physical_id in physical_ids: proxy_mac_id = next(iter(proxy_acast_mac_ids)) if proxy_acast_mac_ids else "" proxy_v4_id = next(iter(proxy_acast_v4_ids)) if proxy_acast_v4_ids else "" proxy_v6_id = next(iter(proxy_acast_v6_ids)) if proxy_acast_v6_ids else "" - + total_bytes = len(physical_id) + len(proxy_mac_id) + len(proxy_v4_id) + len(proxy_v6_id) - + if total_bytes >= 58: result = FAIL_O data.append([str(total_bytes), recommended_action]) - break + break print_result(title, result, msg, headers, data, 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') @@ -5325,4 +5326,3 @@ def isis_database_byte_check(index, total_checks, tversion, **kwargs): prints('==== Script Version %s FIN ====' % (SCRIPT_VERSION)) subprocess.check_output(['rm', '-rf', DIR]) - diff --git a/docs/docs/validations.md b/docs/docs/validations.md index c77cc4c4..a40242d4 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -184,7 +184,7 @@ Items | Defect | This Script [PBR High Scale][d23] | CSCwi66348 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [Standby Sup Image Sync][d24] | CSCwi66348 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [Observer Database Size][d25] | CSCvw45531 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: -[ISIS DTEPs Byte Check][d26] | CSCwp15375 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: +[ISIS DTEPs Byte Size][d26] | CSCwp15375 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [d1]: #ep-announce-compatibility @@ -212,7 +212,7 @@ Items | Defect | This Script [d23]: #pbr-high-scale [d24]: #standby-sup-image-sync [d25]: #observer-database-size -[d26]: #isis-dteps-byte-check +[d26]: #isis-dteps-byte-size ## General Check Details @@ -2544,7 +2544,7 @@ This check logs in to each APIC, checks the contents of the `/data2/dbstats/` di Certain high churn logging configurations have been found to grow this DB exceptionally large while on a non-fixed version. 'Contract Permit Logging' is one such configuration. -### ISIS DTEPs Byte Check +### ISIS DTEPs Byte Size Due to [CSCwp15375][57], tech support generation will result in a switch crash under the following conditions: - The `isisDTEp` address for a given spine + PROXY-ACAST-MAC address + PROXY-ACAST-V4 address + PROXY-ACAST-V6 address equals 58 bytes or more @@ -2553,7 +2553,7 @@ Due to [CSCwp15375][57], tech support generation will result in a switch crash u Do not upgrade to any affected ACI software release if this check fails. !!! note - NDI integration can cause tech support generation to happen automatically, resulting in switch crash without user intervention. + Nexus Dashboard Insights (NDI) integration can cause ACI tech support generation to happen automatically as part of the bug scan feature. [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script From 907b63d13b061dc2c1a7b4438f9c10795a997082 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 11 Jul 2025 14:12:09 -0400 Subject: [PATCH 3/5] NA + MANUAL pytest + doc cleanup --- docs/docs/validations.md | 11 +++++-- .../test_isis_database_byte_check.py | 32 +++++++++++++------ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/docs/docs/validations.md b/docs/docs/validations.md index a40242d4..fcb36204 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -2546,9 +2546,14 @@ This check logs in to each APIC, checks the contents of the `/data2/dbstats/` di ### ISIS DTEPs Byte Size -Due to [CSCwp15375][57], tech support generation will result in a switch crash under the following conditions: -- The `isisDTEp` address for a given spine + PROXY-ACAST-MAC address + PROXY-ACAST-V4 address + PROXY-ACAST-V6 address equals 58 bytes or more -- The ACI software version is 6.1(1f), 6.1(2f), 6.1(2g), or 6.1(3f) +Due to [CSCwp15375][57], running a `show` command that dumps out the ISIS Link State Database under certain conditions, such as `show isis database detail vrf all`, will result in a switch crash. + +As Switch Tech Support generation includes ISIS show command output, Tech Support generation will also result in a switch crash under the same conditions. + +The specific conditions leading to the crash are: + +1. The ACI software version is 6.1(1f), 6.1(2f), 6.1(2g), or 6.1(3f) +2. For any spine; The `isisDTEp` address + `PROXY-ACAST-MAC` address + `PROXY-ACAST-V4` address + `PROXY-ACAST-V6` address equals 58 bytes or more Do not upgrade to any affected ACI software release if this check fails. diff --git a/tests/isis_database_byte_check/test_isis_database_byte_check.py b/tests/isis_database_byte_check/test_isis_database_byte_check.py index 49900666..39003bab 100644 --- a/tests/isis_database_byte_check/test_isis_database_byte_check.py +++ b/tests/isis_database_byte_check/test_isis_database_byte_check.py @@ -16,44 +16,58 @@ @pytest.mark.parametrize( "icurl_outputs, tversion, expected_result", [ - ## Failure cases + + # MANUAL cases + ( + {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, + None, + script.MANUAL, + ), + # Failure cases + ( + {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, + "6.0(1f)", + script.NA, + ), + + # Failure cases ( {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, "6.1(1f)", script.FAIL_O, - ), + ), ( {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, "6.1(2f)", script.FAIL_O, - ), + ), ( {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, "6.1(2g)", script.FAIL_O, - ), + ), ( {isisDTEp_api: read_data(dir, "isisDTEp_POS.json")}, "6.1(3f)", script.FAIL_O, - ), + ), - ## Pass cases + # Pass cases ( {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, "6.1(1f)", script.PASS, - ), + ), ( {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, "6.1(2f)", script.PASS, - ), + ), ( {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, "6.1(2g)", script.PASS, - ), + ), ( {isisDTEp_api: read_data(dir, "isisDTEp_NEG.json")}, "6.1(3f)", From 64980bcb61429835ffd983e8f9f5d5bd2bf98111 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 11 Jul 2025 15:43:53 -0400 Subject: [PATCH 4/5] simplify logic assuming only 3 acast teps --- aci-preupgrade-validation-script.py | 63 +++++++++++------------------ 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index b9dd5d0d..8d50c35c 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -5105,7 +5105,7 @@ def isis_database_byte_check(index, total_checks, tversion, **kwargs): title = 'ISIS DTEPs Byte Size' result = PASS msg = '' - headers = ["ISIS DTEPs Byte Size", "Recommended Action"] + headers = ["ISIS DTEPs Byte Size", "ISIS DTEPs", "Recommended Action"] data = [] recommended_action = 'Upgrade to a version with the fix for CSCwp15375. Current target version is affected.' doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#isis-dteps-byte-size' @@ -5115,51 +5115,36 @@ def isis_database_byte_check(index, total_checks, tversion, **kwargs): print_result(title, MANUAL, "Target version not supplied. Skipping.") return MANUAL - affected_versions = ["6.1(1f)", "6.1(2f)", "6.1(2g)", "6.1(3f)"] - is_affected = False - for version in affected_versions: - if tversion.same_as(version): - is_affected = True - break - - if not is_affected: - print_result(title, NA, "Target version not affected") - return NA - - isisDTEp_api = 'isisDTEp.json' - isisDTEp_api += '?query-target-filter=eq(isisDTEp.role,"spine")' + if tversion.newer_than("6.1(1a)") and tversion.older_than("6.1(3g)"): + isisDTEp_api = 'isisDTEp.json' + isisDTEp_api += '?query-target-filter=eq(isisDTEp.role,"spine")' - isisDTEps = icurl('class', isisDTEp_api) + isisDTEps = icurl('class', isisDTEp_api) - physical_ids = set() - proxy_acast_mac_ids = set() - proxy_acast_v4_ids = set() - proxy_acast_v6_ids = set() + physical_ids = set() + proxy_acast_ids = set() - for entry in isisDTEps: - dtep_type = entry['isisDTEp']['attributes']['type'] - dtep_id = entry['isisDTEp']['attributes']['id'] + for entry in isisDTEps: + dtep_type = entry['isisDTEp']['attributes']['type'] + dtep_id = entry['isisDTEp']['attributes']['id'] - if dtep_type == "physical": - physical_ids.add(dtep_id) - elif dtep_type == "physical,proxy-acast-mac": - proxy_acast_mac_ids.add(dtep_id) - elif dtep_type == "physical,proxy-acast-v4": - proxy_acast_v4_ids.add(dtep_id) - elif dtep_type == "physical,proxy-acast-v6": - proxy_acast_v6_ids.add(dtep_id) + if dtep_type == "physical": + physical_ids.add(dtep_id) + elif "physical,proxy-acast" in dtep_type: + proxy_acast_ids.add(dtep_id) - for physical_id in physical_ids: - proxy_mac_id = next(iter(proxy_acast_mac_ids)) if proxy_acast_mac_ids else "" - proxy_v4_id = next(iter(proxy_acast_v4_ids)) if proxy_acast_v4_ids else "" - proxy_v6_id = next(iter(proxy_acast_v6_ids)) if proxy_acast_v6_ids else "" + for physical_id in physical_ids: + combined_dteps = ",".join([physical_id] + list(proxy_acast_ids)) + total_bytes = len(combined_dteps) - total_bytes = len(physical_id) + len(proxy_mac_id) + len(proxy_v4_id) + len(proxy_v6_id) + if total_bytes > 57: + result = FAIL_O + data.append([total_bytes, combined_dteps, recommended_action]) + break - if total_bytes >= 58: - result = FAIL_O - data.append([str(total_bytes), recommended_action]) - break + else: + print_result(title, NA, "Target version not affected") + return NA print_result(title, result, msg, headers, data, doc_url=doc_url) return result From 4c2046f94a383611fd4aa2b668ddfb26ec1fb45c Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 11 Jul 2025 15:48:15 -0400 Subject: [PATCH 5/5] move recommended action to foter --- aci-preupgrade-validation-script.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 8d50c35c..1b3a18f5 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -5105,7 +5105,7 @@ def isis_database_byte_check(index, total_checks, tversion, **kwargs): title = 'ISIS DTEPs Byte Size' result = PASS msg = '' - headers = ["ISIS DTEPs Byte Size", "ISIS DTEPs", "Recommended Action"] + headers = ["ISIS DTEPs Byte Size", "ISIS DTEPs"] data = [] recommended_action = 'Upgrade to a version with the fix for CSCwp15375. Current target version is affected.' doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#isis-dteps-byte-size' @@ -5139,14 +5139,14 @@ def isis_database_byte_check(index, total_checks, tversion, **kwargs): if total_bytes > 57: result = FAIL_O - data.append([total_bytes, combined_dteps, recommended_action]) + data.append([total_bytes, combined_dteps]) break else: print_result(title, NA, "Target version not affected") return NA - print_result(title, result, msg, headers, data, doc_url=doc_url) + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) return result