From 923489398c23552071413dafafa6f36a4442f5ae Mon Sep 17 00:00:00 2001 From: psureshb Date: Mon, 22 Dec 2025 12:57:10 +0000 Subject: [PATCH 1/6] rogue exception macs detection failure after stateless reload test method added with pytest files. --- aci-preupgrade-validation-script.py | 43 ++ .../no_rogue_mac_response.json | 1 + .../presListener_exceptcont.json | 386 ++++++++++++++++++ .../presListener_exceptcont_31_missing.json | 14 + .../presListener_exceptcont_many_missing.json | 326 +++++++++++++++ .../presListener_exceptcont_one_missing.json | 374 +++++++++++++++++ .../rogue_mac_response.json | 102 +++++ .../test_rogue_ep_coop_exception_mac_check.py | 152 +++++++ 8 files changed, 1398 insertions(+) create mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/no_rogue_mac_response.json create mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont.json create mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_31_missing.json create mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_many_missing.json create mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_one_missing.json create mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/rogue_mac_response.json create mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index ebe04773..a491f60c 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6007,6 +6007,48 @@ def apic_vmm_inventory_sync_faults_check(**kwargs): recommended_action=recommended_action, doc_url=doc_url) +@check_wrapper(check_title='Rogue EP/COOP Exception MACs missing') +def rogue_ep_coop_exception_mac_check(cversion, tversion, **kwargs): + result = PASS + headers = ["Rogue Exception MACs Count", "presListener Count"] + data = [] + recommended_action = 'Add the missing MAC addresses to the rogue EP/COOP exception list before upgrade' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#rogue-epcoop-exception-macs-missing' + + # Target version check + if not tversion: + prints("Target version not provided, skipping check.") + return Result(result=MANUAL, msg=TVER_MISSING) + + # Check applicable only when upgrading from versions newer than 3.1(2v) to versions older than 6.1(3g) + if cversion.newer_than("3.1(2v)") and tversion.older_than("6.1(3g)"): + # endpoint to fetch the rogue exception MACs + exception_mac_api = 'fvRogueExceptionMac.json?query-target-filter=and(wcard(fvRogueExceptionMac.dn,"([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}"))' + + # endpoint to fetch the presListener entries + presListener_api = 'presListener.json?query-target-filter=and(wcard(presListener.dn,"exceptcont"))' + + exception_macs = icurl('class', exception_mac_api) + + if exception_macs: + prints("Found {} exception MACs, checking presListener entries...".format(len(exception_macs))) + presListener_response = icurl('class', presListener_api) + if len(presListener_response) ==0: + prints("No presListener entries found for exception MACs.") + result = FAIL_UF + data.append([len(exception_macs), 0]) + elif len(presListener_response) < 32: + prints("Insufficient presListener entries ({} found) for {} exception MACs.".format(len(presListener_response), len(exception_macs))) + result = FAIL_O + data.append([len(exception_macs), len(presListener_response)]) + + elif not exception_macs: + result = PASS + prints("No exception MACs found, skipping check.") + data.append([0, "Check not performed since exception MAC list is empty"]) + + return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) + # ---- Script Execution ---- @@ -6168,6 +6210,7 @@ class CheckManager: standby_sup_sync_check, isis_database_byte_check, configpush_shard_check, + rogue_ep_coop_exception_mac_check, ] ssh_checks = [ diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/no_rogue_mac_response.json b/tests/checks/rogue_ep_coop_exception_mac_check/no_rogue_mac_response.json new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/tests/checks/rogue_ep_coop_exception_mac_check/no_rogue_mac_response.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont.json b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont.json new file mode 100644 index 00000000..bcaa9881 --- /dev/null +++ b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont.json @@ -0,0 +1,386 @@ +[ + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-20/relnholder/rspresClass-[resregistry/resregistry-20/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.619-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-17/relnholder/rspresClass-[resregistry/resregistry-17/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.509-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-32/relnholder/rspresClass-[resregistry/resregistry-32/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.471-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-27/relnholder/rspresClass-[resregistry/resregistry-27/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.412-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-24/relnholder/rspresClass-[resregistry/resregistry-24/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.382-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-23/relnholder/rspresClass-[resregistry/resregistry-23/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.049-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-29/relnholder/rspresClass-[resregistry/resregistry-29/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.048-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-21/relnholder/rspresClass-[resregistry/resregistry-21/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.035-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-22/relnholder/rspresClass-[resregistry/resregistry-22/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.015-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-18/relnholder/rspresClass-[resregistry/resregistry-18/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.953-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-11/relnholder/rspresClass-[resregistry/resregistry-11/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.945-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-12/relnholder/rspresClass-[resregistry/resregistry-12/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.913-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-2/relnholder/rspresClass-[resregistry/resregistry-2/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.809-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-4/relnholder/rspresClass-[resregistry/resregistry-4/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.802-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-30/relnholder/rspresClass-[resregistry/resregistry-30/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.769-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-14/relnholder/rspresClass-[resregistry/resregistry-14/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.691-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-8/relnholder/rspresClass-[resregistry/resregistry-8/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.685-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-16/relnholder/rspresClass-[resregistry/resregistry-16/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.660-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-6/relnholder/rspresClass-[resregistry/resregistry-6/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.642-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-15/relnholder/rspresClass-[resregistry/resregistry-15/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.629-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-19/relnholder/rspresClass-[resregistry/resregistry-19/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.625-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-25/relnholder/rspresClass-[resregistry/resregistry-25/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.608-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-28/relnholder/rspresClass-[resregistry/resregistry-28/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.604-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-5/relnholder/rspresClass-[resregistry/resregistry-5/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.470-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-7/relnholder/rspresClass-[resregistry/resregistry-7/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.453-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-9/relnholder/rspresClass-[resregistry/resregistry-9/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.437-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-13/relnholder/rspresClass-[resregistry/resregistry-13/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.405-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-1/relnholder/rspresClass-[resregistry/resregistry-1/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.396-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-31/relnholder/rspresClass-[resregistry/resregistry-31/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.373-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-26/relnholder/rspresClass-[resregistry/resregistry-26/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.810-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-10/relnholder/rspresClass-[resregistry/resregistry-10/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.282-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-3/relnholder/rspresClass-[resregistry/resregistry-3/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.248-08:00", + "status": "" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_31_missing.json b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_31_missing.json new file mode 100644 index 00000000..09abfdec --- /dev/null +++ b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_31_missing.json @@ -0,0 +1,14 @@ +[ + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-27/relnholder/rspresClass-[resregistry/resregistry-27/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.412-08:00", + "status": "" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_many_missing.json b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_many_missing.json new file mode 100644 index 00000000..7ecfd0fc --- /dev/null +++ b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_many_missing.json @@ -0,0 +1,326 @@ +[ + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-20/relnholder/rspresClass-[resregistry/resregistry-20/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.619-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-17/relnholder/rspresClass-[resregistry/resregistry-17/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.509-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-32/relnholder/rspresClass-[resregistry/resregistry-32/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.471-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-27/relnholder/rspresClass-[resregistry/resregistry-27/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.412-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-24/relnholder/rspresClass-[resregistry/resregistry-24/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.382-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-23/relnholder/rspresClass-[resregistry/resregistry-23/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.049-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-29/relnholder/rspresClass-[resregistry/resregistry-29/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.048-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-21/relnholder/rspresClass-[resregistry/resregistry-21/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.035-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-22/relnholder/rspresClass-[resregistry/resregistry-22/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.015-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-18/relnholder/rspresClass-[resregistry/resregistry-18/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.953-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-14/relnholder/rspresClass-[resregistry/resregistry-14/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.691-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-8/relnholder/rspresClass-[resregistry/resregistry-8/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.685-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-16/relnholder/rspresClass-[resregistry/resregistry-16/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.660-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-6/relnholder/rspresClass-[resregistry/resregistry-6/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.642-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-15/relnholder/rspresClass-[resregistry/resregistry-15/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.629-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-19/relnholder/rspresClass-[resregistry/resregistry-19/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.625-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-25/relnholder/rspresClass-[resregistry/resregistry-25/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.608-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-28/relnholder/rspresClass-[resregistry/resregistry-28/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.604-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-5/relnholder/rspresClass-[resregistry/resregistry-5/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.470-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-7/relnholder/rspresClass-[resregistry/resregistry-7/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.453-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-9/relnholder/rspresClass-[resregistry/resregistry-9/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.437-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-13/relnholder/rspresClass-[resregistry/resregistry-13/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.405-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-1/relnholder/rspresClass-[resregistry/resregistry-1/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.396-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-31/relnholder/rspresClass-[resregistry/resregistry-31/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.373-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-26/relnholder/rspresClass-[resregistry/resregistry-26/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.810-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-10/relnholder/rspresClass-[resregistry/resregistry-10/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.282-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-3/relnholder/rspresClass-[resregistry/resregistry-3/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.248-08:00", + "status": "" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_one_missing.json b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_one_missing.json new file mode 100644 index 00000000..11ff0fd1 --- /dev/null +++ b/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_one_missing.json @@ -0,0 +1,374 @@ +[ + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-20/relnholder/rspresClass-[resregistry/resregistry-20/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.619-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-17/relnholder/rspresClass-[resregistry/resregistry-17/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.509-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-32/relnholder/rspresClass-[resregistry/resregistry-32/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.471-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-27/relnholder/rspresClass-[resregistry/resregistry-27/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.412-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-24/relnholder/rspresClass-[resregistry/resregistry-24/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:56.382-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-23/relnholder/rspresClass-[resregistry/resregistry-23/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.049-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-29/relnholder/rspresClass-[resregistry/resregistry-29/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.048-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-21/relnholder/rspresClass-[resregistry/resregistry-21/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.035-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-22/relnholder/rspresClass-[resregistry/resregistry-22/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:55.015-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-18/relnholder/rspresClass-[resregistry/resregistry-18/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.953-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-11/relnholder/rspresClass-[resregistry/resregistry-11/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.945-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-12/relnholder/rspresClass-[resregistry/resregistry-12/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.913-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-2/relnholder/rspresClass-[resregistry/resregistry-2/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.809-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-4/relnholder/rspresClass-[resregistry/resregistry-4/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.802-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-30/relnholder/rspresClass-[resregistry/resregistry-30/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.769-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-14/relnholder/rspresClass-[resregistry/resregistry-14/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.691-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-8/relnholder/rspresClass-[resregistry/resregistry-8/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.685-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-16/relnholder/rspresClass-[resregistry/resregistry-16/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.660-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-6/relnholder/rspresClass-[resregistry/resregistry-6/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.642-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-15/relnholder/rspresClass-[resregistry/resregistry-15/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.629-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-19/relnholder/rspresClass-[resregistry/resregistry-19/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.625-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-25/relnholder/rspresClass-[resregistry/resregistry-25/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.608-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-28/relnholder/rspresClass-[resregistry/resregistry-28/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.604-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-5/relnholder/rspresClass-[resregistry/resregistry-5/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.470-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-7/relnholder/rspresClass-[resregistry/resregistry-7/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.453-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-9/relnholder/rspresClass-[resregistry/resregistry-9/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.437-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-13/relnholder/rspresClass-[resregistry/resregistry-13/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.405-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-1/relnholder/rspresClass-[resregistry/resregistry-1/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.396-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-31/relnholder/rspresClass-[resregistry/resregistry-31/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:54.373-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-26/relnholder/rspresClass-[resregistry/resregistry-26/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.810-08:00", + "status": "" + } + } + }, + { + "presListener": { + "attributes": { + "childAction": "", + "dn": "resregistry/resregistry-10/relnholder/rspresClass-[resregistry/resregistry-10/class-19076]/list-[exceptcont]", + "lcOwn": "local", + "lstDn": "exceptcont", + "modTs": "2025-09-22T00:05:53.282-08:00", + "status": "" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/rogue_mac_response.json b/tests/checks/rogue_ep_coop_exception_mac_check/rogue_mac_response.json new file mode 100644 index 00000000..b648d4dc --- /dev/null +++ b/tests/checks/rogue_ep_coop_exception_mac_check/rogue_mac_response.json @@ -0,0 +1,102 @@ +[ + { + "fvRogueExceptionMac": { + "attributes": { + "mac": "10:B3:D5:14:14:29", + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-Exception/BD-Exception_BD/rgexpmac-10:B3:D5:14:14:29", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-07-17T04:57:04.923+00:00", + "name": "", + "nameAlias": "", + "rn": "rgexpmac-10:B3:D5:14:14:29", + "status": "", + "uid": "16222", + "userdom": ":all:" + } + } + }, + { + "fvRogueExceptionMac": { + "attributes": { + "mac": "00:50:56:9A:1B:2C", + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-Production/BD-Prod_BD/rgexpmac-00:50:56:9A:1B:2C", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-07-18T10:22:15.456+00:00", + "name": "", + "nameAlias": "", + "rn": "rgexpmac-00:50:56:9A:1B:2C", + "status": "", + "uid": "16223", + "userdom": ":all:" + } + } + }, + { + "fvRogueExceptionMac": { + "attributes": { + "mac": "AA:BB:CC:DD:EE:FF", + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-Test/BD-Test_BD/rgexpmac-AA:BB:CC:DD:EE:FF", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-07-19T14:35:28.789+00:00", + "name": "", + "nameAlias": "", + "rn": "rgexpmac-AA:BB:CC:DD:EE:FF", + "status": "", + "uid": "16224", + "userdom": ":all:" + } + } + }, + { + "fvRogueExceptionMac": { + "attributes": { + "mac": "F0:1F:AF:2D:3E:4F", + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-Dev/BD-Dev_BD/rgexpmac-F0:1F:AF:2D:3E:4F", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-07-20T08:45:12.321+00:00", + "name": "", + "nameAlias": "", + "rn": "rgexpmac-F0:1F:AF:2D:3E:4F", + "status": "", + "uid": "16225", + "userdom": ":all:" + } + } + }, + { + "fvRogueExceptionMac": { + "attributes": { + "mac": "12:34:56:78:9A:BC", + "annotation": "", + "childAction": "", + "descr": "", + "dn": "uni/tn-Staging/BD-Staging_BD/rgexpmac-12:34:56:78:9A:BC", + "extMngdBy": "", + "lcOwn": "local", + "modTs": "2024-07-21T16:55:33.654+00:00", + "name": "", + "nameAlias": "", + "rn": "rgexpmac-12:34:56:78:9A:BC", + "status": "", + "uid": "16226", + "userdom": ":all:" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py b/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py new file mode 100644 index 00000000..2ec34da0 --- /dev/null +++ b/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py @@ -0,0 +1,152 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + +script = importlib.import_module("aci-preupgrade-validation-script") + +test_function = "rogue_ep_coop_exception_mac_check" + +# icurl queries +exception_mac_api = 'fvRogueExceptionMac.json' +exception_mac_api += '?query-target-filter=and(wcard(fvRogueExceptionMac.dn,"([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}"))' + +presListener_api = 'presListener.json' +presListener_api += '?query-target-filter=and(wcard(presListener.dn,"exceptcont"))' + + +@pytest.mark.parametrize( + "icurl_outputs, tversion, cversion, expected_result", + [ + # PASS cases + # Non affected tversion, affected cversion, no exception MACs + ( + {exception_mac_api: read_data(dir, "no_rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.1(3g)", + "5.2(8e)", + script.PASS, + ), + # Non affected cversion, affected tversion, no exception MACs + ( + {exception_mac_api: read_data(dir, "no_rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.0(8h)", + "3.1(2v)", + script.PASS, + ), + # non affected cversion and tversion, no exception MACs + ( + {exception_mac_api: read_data(dir, "no_rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.1(4h)", + "3.1(2s)", + script.PASS, + ), + # non affected cversion and tversion, with exception MACs + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.1(4h)", + "3.1(2s)", + script.PASS, + ), + # affected edge cversion and tversion, no exception MACs + ( + {exception_mac_api: read_data(dir, "no_rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.1(3f)", + "5.2(7f)", + script.PASS, + ), + # affected cversion and tversion, no exception MACs + ( + {exception_mac_api: read_data(dir, "no_rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.1(2f)", + "5.2(8g)", + script.PASS, + ), + # affected version, exception MACs present but exceptcont listeners present + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.0(3e)", + "5.2(8g)E", + script.PASS, + ), + # affected edge version, exception MACs present but exceptcont listeners present + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "6.1(3f)", + "5.2(7f)", + script.PASS, + ), + # MANUAL cases + # tversion is not provided + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont.json")}, + "", + "5.2(8g)", + script.MANUAL, + ), + # FAIL cases + # affected edge version, exception MACs present, one missing exceptcont presListeners + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont_one_missing.json")}, + "6.1(3f)", + "5.2(7f)", + script.FAIL_O, + ), + # affected version, exception MACs present, 31 exceptcont presListeners missing + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont_31_missing.json")}, + "6.0(3e)", + "5.2(8g)E", + script.FAIL_O, + ), + # affected version, exception MACs present, many exceptcont presListeners missing + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: read_data(dir, "presListener_exceptcont_many_missing.json")}, + "6.1(2f)", + "5.2(8g)", + script.FAIL_O, + ), + # affected version, exception MACs present, no exceptcont presListeners missing + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: []}, + "6.1(2f)", + "5.2(8g)", + script.FAIL_UF, + ), + ], + ids=[ + "PASS_non_affected_tversion_affected_cversion_no_exception_MACs", + "PASS_non_affected_cversion_affected_tversion_no_exception_MACs", + "PASS_non_affected_cversion_tversion_no_exception_MACs", + "PASS_non_affected_cversion_tversion_with_exception_MACs", + "PASS_affected_edge_cversion_tversion_no_exception_MACs", + "PASS_affected_cversion_tversion_no_exception_MACs", + "PASS_affected_cversion_tversion_exception_MACs_with_exceptcont_listeners", + "PASS_affected_edge_cversion_tversion_exception_MACs_with_exceptcont_listeners", + "MANUAL_tversion_not_provided", + "FAIL_affected_edge_cversion_tversion_exception_MACs_one_missing_exceptcont_listener", + "FAIL_affected_cversion_tversion_exception_MACs_31_missing_exceptcont_listeners", + "FAIL_affected_cversion_tversion_exception_MACs_many_missing_exceptcont_listeners", + "FAIL_affected_cversion_tversion_exception_MACs_no_exceptcont_listeners", + ], +) +def test_rogue_ep_coop_exception_mac_check(run_check, mock_icurl, tversion, cversion, expected_result): + """Test rogue_ep_coop_exception_mac_check with various scenarios.""" + result = run_check(cversion=script.AciVersion(cversion), tversion=script.AciVersion(tversion) if tversion else None) + assert result.result == expected_result \ No newline at end of file From 12ba8038d761a9b99e8c4c5a60ae6505d558216e Mon Sep 17 00:00:00 2001 From: psureshb Date: Mon, 22 Dec 2025 13:40:38 +0000 Subject: [PATCH 2/6] added test for rogue exception MACs missing due to missing presListeners of exceptcont tree --- aci-preupgrade-validation-script.py | 11 +---------- .../test_rogue_ep_coop_exception_mac_check.py | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index a491f60c..cb90fa4f 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6033,19 +6033,10 @@ def rogue_ep_coop_exception_mac_check(cversion, tversion, **kwargs): if exception_macs: prints("Found {} exception MACs, checking presListener entries...".format(len(exception_macs))) presListener_response = icurl('class', presListener_api) - if len(presListener_response) ==0: - prints("No presListener entries found for exception MACs.") - result = FAIL_UF - data.append([len(exception_macs), 0]) - elif len(presListener_response) < 32: + if len(presListener_response) >= 0 and len(presListener_response) < 32: prints("Insufficient presListener entries ({} found) for {} exception MACs.".format(len(presListener_response), len(exception_macs))) result = FAIL_O data.append([len(exception_macs), len(presListener_response)]) - - elif not exception_macs: - result = PASS - prints("No exception MACs found, skipping check.") - data.append([0, "Check not performed since exception MAC list is empty"]) return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) diff --git a/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py b/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py index 2ec34da0..2292a0f6 100644 --- a/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py +++ b/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py @@ -127,7 +127,7 @@ presListener_api: []}, "6.1(2f)", "5.2(8g)", - script.FAIL_UF, + script.FAIL_O, ), ], ids=[ From 42f466b98d30b69a5657870e4cc1d13aa29f28cb Mon Sep 17 00:00:00 2001 From: psureshb Date: Wed, 24 Dec 2025 04:41:13 +0000 Subject: [PATCH 3/6] added the defect CSCwp64296 documentation. --- docs/docs/validations.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/docs/validations.md b/docs/docs/validations.md index fa1fc0e4..94a7e18f 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -190,7 +190,8 @@ Items | Defect | This Script [Observer Database Size][d25] | CSCvw45531 | :white_check_mark: | :no_entry_sign: [Stale pconsRA Object][d26] | CSCwp22212 | :warning:{title="Deprecated"} | :no_entry_sign: [ISIS DTEPs Byte Size][d27] | CSCwp15375 | :white_check_mark: | :no_entry_sign: -[Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: | +[Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: | :no_entry_sign: +[Rogue EP/COOP Exception MACs missing][d29] | CSCwp64296 | :white_check_mark: | :no_entry_sign: [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -220,6 +221,7 @@ Items | Defect | This Script [d26]: #stale-pconsra-object [d27]: #isis-dteps-byte-size [d28]: #policydist-configpushshardcont-crash +[d29]: #rogue-epcoop-exception-macs-missing ## General Check Details @@ -2614,6 +2616,15 @@ Due to [CSCwp95515][59], upgrading to an affected version while having any `conf If any instances of `configpushShardCont` are flagged by this script, Cisco TAC must be contacted to identify and resolve the underlying issue before performing the upgrade. +### Rogue EP/COOP Exception MACs missing + +Due to the defect [CSCwp64296][62], rogue endpoint (EP) and COOP exception MAC address configurations may be lost after a stateless reload of spine switches in an ACI fabric. The `presListener` MO, which holds the exception list configuration for the tenant shard, is missing or incomplete on the APIC side. This leads to spine switches not receiving the `rogueBDDef` configuration after reload. + +This script checks if the APIC version is in the affected range, whether rogue MACs are configured in the exception list, and if `presListener` MOs are missing. If all conditions are met, the check will flag the fabric as susceptible to CSCwp64296. + +As a workaround, remove the affected EP exception configurations and re-add them. To permanently resolve the issue, contact Cisco TAC to create the missing `presListener` MOs. + + [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 @@ -2676,3 +2687,4 @@ If any instances of `configpushShardCont` are flagged by this script, Cisco TAC [59]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp95515 [60]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#Inter [61]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#EnablePolicyCompression +[62]: https://cdetsng.cisco.com/summary/#/defect/CSCwp64296 \ No newline at end of file From 37d6c8948c3c6fb6e3722f3fa347fa88f1d6720d Mon Sep 17 00:00:00 2001 From: psureshb Date: Wed, 24 Dec 2025 06:37:02 +0000 Subject: [PATCH 4/6] recommended action edited, cdets link replaced by cloudapps link --- aci-preupgrade-validation-script.py | 2 +- docs/docs/validations.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index cb90fa4f..6fc42e6f 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6012,7 +6012,7 @@ def rogue_ep_coop_exception_mac_check(cversion, tversion, **kwargs): result = PASS headers = ["Rogue Exception MACs Count", "presListener Count"] data = [] - recommended_action = 'Add the missing MAC addresses to the rogue EP/COOP exception list before upgrade' + recommended_action = 'Remove the affected EP exception configurations and re-add them' doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#rogue-epcoop-exception-macs-missing' # Target version check diff --git a/docs/docs/validations.md b/docs/docs/validations.md index 94a7e18f..605df7e1 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -2687,4 +2687,4 @@ As a workaround, remove the affected EP exception configurations and re-add them [59]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp95515 [60]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#Inter [61]: https://www.cisco.com/c/en/us/solutions/collateral/data-center-virtualization/application-centric-infrastructure/white-paper-c11-743951.html#EnablePolicyCompression -[62]: https://cdetsng.cisco.com/summary/#/defect/CSCwp64296 \ No newline at end of file +[62]: https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp64296 \ No newline at end of file From 35de39ee42459606d6b1e918a06a68702c11b6b0 Mon Sep 17 00:00:00 2001 From: psureshb Date: Wed, 24 Dec 2025 10:46:44 +0000 Subject: [PATCH 5/6] added log files --- ...ade_validator_2025-12-24T10-42-44+0000.tgz | Bin 0 -> 2299 bytes pytest_logs.txt | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 preupgrade_validator_2025-12-24T10-42-44+0000.tgz create mode 100644 pytest_logs.txt diff --git a/preupgrade_validator_2025-12-24T10-42-44+0000.tgz b/preupgrade_validator_2025-12-24T10-42-44+0000.tgz new file mode 100644 index 0000000000000000000000000000000000000000..d2c9b56fa71844133bd0b15704cc31927466979d GIT binary patch literal 2299 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 VfdT~z6ezF~{{_;`mzMxg005 Date: Wed, 24 Dec 2025 12:48:14 +0000 Subject: [PATCH 6/6] removed the log files in the directory --- ...ade_validator_2025-12-24T10-42-44+0000.tgz | Bin 2299 -> 0 bytes pytest_logs.txt | 103 ------------------ 2 files changed, 103 deletions(-) delete mode 100644 preupgrade_validator_2025-12-24T10-42-44+0000.tgz delete mode 100644 pytest_logs.txt diff --git a/preupgrade_validator_2025-12-24T10-42-44+0000.tgz b/preupgrade_validator_2025-12-24T10-42-44+0000.tgz deleted file mode 100644 index d2c9b56fa71844133bd0b15704cc31927466979d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2299 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 VfdT~z6ezF~{{_;`mzMxg005