From 3fc5ebfd461559ac36300591bd3bca3e4c9187bc Mon Sep 17 00:00:00 2001 From: psureshb Date: Fri, 19 Dec 2025 13:35:37 +0000 Subject: [PATCH 01/11] Added rogue ep/coop exception mac check for the CFD CSCwp64296 --- 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 ebe0477..a491f60 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 0000000..0637a08 --- /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 0000000..bcaa988 --- /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 0000000..09abfde --- /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 0000000..7ecfd0f --- /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 0000000..11ff0fd --- /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 0000000..b648d4d --- /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 0000000..2ec34da --- /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 923489398c23552071413dafafa6f36a4442f5ae Mon Sep 17 00:00:00 2001 From: psureshb Date: Mon, 22 Dec 2025 12:57:10 +0000 Subject: [PATCH 02/11] 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 ebe0477..a491f60 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 0000000..0637a08 --- /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 0000000..bcaa988 --- /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 0000000..09abfde --- /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 0000000..7ecfd0f --- /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 0000000..11ff0fd --- /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 0000000..b648d4d --- /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 0000000..2ec34da --- /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 4a06b4f545fabc93d0bb2db9b7bc0f6a40f53dfd Mon Sep 17 00:00:00 2001 From: psureshb Date: Mon, 22 Dec 2025 13:03:19 +0000 Subject: [PATCH 03/11] Revert "Added rogue ep/coop exception mac check for the CFD CSCwp64296" This reverts commit 3fc5ebfd461559ac36300591bd3bca3e4c9187bc. --- 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 deletions(-) delete mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/no_rogue_mac_response.json delete mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont.json delete mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_31_missing.json delete mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_many_missing.json delete mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_one_missing.json delete mode 100644 tests/checks/rogue_ep_coop_exception_mac_check/rogue_mac_response.json delete 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 a491f60..ebe0477 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6007,48 +6007,6 @@ 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 ---- @@ -6210,7 +6168,6 @@ 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 deleted file mode 100644 index 0637a08..0000000 --- a/tests/checks/rogue_ep_coop_exception_mac_check/no_rogue_mac_response.json +++ /dev/null @@ -1 +0,0 @@ -[] \ 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 deleted file mode 100644 index bcaa988..0000000 --- a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont.json +++ /dev/null @@ -1,386 +0,0 @@ -[ - { - "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 deleted file mode 100644 index 09abfde..0000000 --- a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_31_missing.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "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 deleted file mode 100644 index 7ecfd0f..0000000 --- a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_many_missing.json +++ /dev/null @@ -1,326 +0,0 @@ -[ - { - "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 deleted file mode 100644 index 11ff0fd..0000000 --- a/tests/checks/rogue_ep_coop_exception_mac_check/presListener_exceptcont_one_missing.json +++ /dev/null @@ -1,374 +0,0 @@ -[ - { - "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 deleted file mode 100644 index b648d4d..0000000 --- a/tests/checks/rogue_ep_coop_exception_mac_check/rogue_mac_response.json +++ /dev/null @@ -1,102 +0,0 @@ -[ - { - "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 deleted file mode 100644 index 2ec34da..0000000 --- a/tests/checks/rogue_ep_coop_exception_mac_check/test_rogue_ep_coop_exception_mac_check.py +++ /dev/null @@ -1,152 +0,0 @@ -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 04/11] 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 a491f60..cb90fa4 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 2ec34da..2292a0f 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 05/11] 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 fa1fc0e..94a7e18 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 06/11] 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 cb90fa4..6fc42e6 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 94a7e18..605df7e 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 07/11] 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 zcmVZiwFP!000001MOPtZsWKW&Tl^js|9uwG_pnNVp~8^cx)$|-CSH>GP|7_ z7>q>Q+RBnDQOTs4{O=R=0sAC9loZGDM80H>q zeYRM@9k5TSHMAzo`g>Wp=d>XvIGNX{=O1IDKVJW&sv9u>%1aEucRv5OC4{6fcGX9qZy&86Ge_UPHWgKvO*`Zii&Ar$Y?bG zJBlxdi)A6R{OOc=HnWG+y0715Q~!z~K4FNCM$F>OhA_}9U}X8;$Qj2W6~7`xJsX8g zrnW8WOtYALYY@8Pb`#En$gEU={?uX~XJL8l@JW1GcKk}Cc`SFJ@*rI&@)H{S&MPF5cS0LX65~xfX#*#$|ejt6GF*{Pg#lR{rvAZ z3kn8z__g=EbygEhccr`6CUt?ek)QvkK%!+?eSNIR|B6P)g8r*wkOW2ke*xUir}NH? z49$mJ4?LLo$>snf<=NErJ%-X`o~2RB8F$h<5QXS6CNk0bSdld%Yuca16laMmsWpVO z7iD?;N-Ha6oLa59a-)oQb+(rp_<{kCGDCDd%&kNNXXtyb$gU&mMrnQ&VfrzLGDA_) z5}#8y-P%OH#NS);%3uFaT5NV1kIP`+q>bh4A8VK_JpU0DP^|x#z=wwwi?Cv9#MHF1 zrWwhqMaO4{=VG%*j_2^~VZg+=Ms`oB`Sdl!AkkEP{^)RVI>Vf2ARsj`A7Zu9|kyRPd%h0jT ze48ch|0SSfcA)$y{>c$^@c<{ZeL5~ea2i*u{cdpdIIe|3gJB3jFftQe{&bt>p{5^u zkesBNv@bc+R8)Pql^!CJ%v%W*SLj^EoJGkmyC-Tu0^Emd8*U245*9tHl?_dldLG<6 zRf>}M9XM911tl=ZGzeVBqL(fMn>BGJ3tkY6&&lS-mo*tsA0Fs(P0 zz_(>w@gP7ME0E14_L-l0WBc7rdY7~VNuWZ)Ux}t1JBd?x!?1IqblItI_eJ>kBa5qj zrDp0?Q?HdZRfmx^#a1G@*7>yv!1XPmmZj;_^=hVOlxw&?s|S7z^uBaf|5a|*Rjqc^ zln;OFBo?pZyDf3k*mE)tRG<{DWSfmBFc#d>jZ!*nyd&}n&I%f?L!-2#VhFOajlC#f zmNRmMYKP}4R}{L8j^I}Wx}S^I`B}&_nYF~-QE7Psf6p~b;v|EA`@9bCX7v0 zHFc$2uWOr-DXUj4*Q>QWGO32(5_u+<$WktGhlMhcGxjXylB&Ev{pIa*Nq+?{sT*-g zUBxA!LETjJa$T=)#HFO3ZopQN%cXBjOzO50ld4=CHr_s&j8`C&wh@`M)nrnMscO(4 zWkWJSJs?w6C3$2bn)3U%q$X`kY*JOlP>$X{o2swCCVe9|>FcMajWp9kYSPr)ZH~0$ zqup$Rg_=O-ZYtNud&OKjpR33DZhad#1QfutF;ZOM5=;H1~Kxf)O;R` zde2baQQ&y&>m3d&gI4FQ)9B^*H?ooNCaZ<_EF&4@nPN%bK8==(?hR>l^tM%Z@|JZO zi^S!2cC)3-5g+r!M=;+@hBe*M)?yE+BV%q~T9Z9B!8%e?zG6?KbKI1B?e0apE1#+x zGe`{AGt!XddmJuZ7S5CC{ogw2qucM@t&?buJ)iDAdOzj8w|as1X`OcPoL6dzB;M*P zwPgcQCyN6iUJ&ykPZ}{X$gjtZ?yh`~xrch<7LGSY>0QcsZ7)v3bqI-_g(glc0VX`oywzzeE8{>+?ji~`rYFqX>aexjo7CeWC{D$8IvWXRMsS=YAg~X4#Zct zhd1(dyjCoSj+ecrPit=fZT)M1&nU1NHvImV_kFj_Kl9u+R($^lZMXRSPcyV?@%`^5 zAd<-e0Oif>K1vTcp^H>fp!Ab{TB}t0696Tr1p^+b=6Ub^2 zM_mR_{Siar?xj-SN1%QXMIJb3N(`O&V@O^te+ql?K1$j^LX`c`IzMe3pMCr|0C9KL zIBl1XD4&4Rg56h$5D-YSqgLf|xm0S#VF=Zc5QO)g1Vg5qN+)^QCZap-ilsf0V{;d9jTjFq5Y2?M2I<&jp^DfGwddi`H z-iHvDbn|tyNl^M4}Ah{JEmiMX7E0(NEI z{#8DiIXsz9X4WOiWab0;WOjX@I%Wk)s`ws{>J=zZpg@5F1qu`>P@q780tE^bC{Un4 VfdT~z6ezF~{{_;`mzMxg005 Date: Wed, 24 Dec 2025 12:48:14 +0000 Subject: [PATCH 08/11] 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 zcmVZiwFP!000001MOPtZsWKW&Tl^js|9uwG_pnNVp~8^cx)$|-CSH>GP|7_ z7>q>Q+RBnDQOTs4{O=R=0sAC9loZGDM80H>q zeYRM@9k5TSHMAzo`g>Wp=d>XvIGNX{=O1IDKVJW&sv9u>%1aEucRv5OC4{6fcGX9qZy&86Ge_UPHWgKvO*`Zii&Ar$Y?bG zJBlxdi)A6R{OOc=HnWG+y0715Q~!z~K4FNCM$F>OhA_}9U}X8;$Qj2W6~7`xJsX8g zrnW8WOtYALYY@8Pb`#En$gEU={?uX~XJL8l@JW1GcKk}Cc`SFJ@*rI&@)H{S&MPF5cS0LX65~xfX#*#$|ejt6GF*{Pg#lR{rvAZ z3kn8z__g=EbygEhccr`6CUt?ek)QvkK%!+?eSNIR|B6P)g8r*wkOW2ke*xUir}NH? z49$mJ4?LLo$>snf<=NErJ%-X`o~2RB8F$h<5QXS6CNk0bSdld%Yuca16laMmsWpVO z7iD?;N-Ha6oLa59a-)oQb+(rp_<{kCGDCDd%&kNNXXtyb$gU&mMrnQ&VfrzLGDA_) z5}#8y-P%OH#NS);%3uFaT5NV1kIP`+q>bh4A8VK_JpU0DP^|x#z=wwwi?Cv9#MHF1 zrWwhqMaO4{=VG%*j_2^~VZg+=Ms`oB`Sdl!AkkEP{^)RVI>Vf2ARsj`A7Zu9|kyRPd%h0jT ze48ch|0SSfcA)$y{>c$^@c<{ZeL5~ea2i*u{cdpdIIe|3gJB3jFftQe{&bt>p{5^u zkesBNv@bc+R8)Pql^!CJ%v%W*SLj^EoJGkmyC-Tu0^Emd8*U245*9tHl?_dldLG<6 zRf>}M9XM911tl=ZGzeVBqL(fMn>BGJ3tkY6&&lS-mo*tsA0Fs(P0 zz_(>w@gP7ME0E14_L-l0WBc7rdY7~VNuWZ)Ux}t1JBd?x!?1IqblItI_eJ>kBa5qj zrDp0?Q?HdZRfmx^#a1G@*7>yv!1XPmmZj;_^=hVOlxw&?s|S7z^uBaf|5a|*Rjqc^ zln;OFBo?pZyDf3k*mE)tRG<{DWSfmBFc#d>jZ!*nyd&}n&I%f?L!-2#VhFOajlC#f zmNRmMYKP}4R}{L8j^I}Wx}S^I`B}&_nYF~-QE7Psf6p~b;v|EA`@9bCX7v0 zHFc$2uWOr-DXUj4*Q>QWGO32(5_u+<$WktGhlMhcGxjXylB&Ev{pIa*Nq+?{sT*-g zUBxA!LETjJa$T=)#HFO3ZopQN%cXBjOzO50ld4=CHr_s&j8`C&wh@`M)nrnMscO(4 zWkWJSJs?w6C3$2bn)3U%q$X`kY*JOlP>$X{o2swCCVe9|>FcMajWp9kYSPr)ZH~0$ zqup$Rg_=O-ZYtNud&OKjpR33DZhad#1QfutF;ZOM5=;H1~Kxf)O;R` zde2baQQ&y&>m3d&gI4FQ)9B^*H?ooNCaZ<_EF&4@nPN%bK8==(?hR>l^tM%Z@|JZO zi^S!2cC)3-5g+r!M=;+@hBe*M)?yE+BV%q~T9Z9B!8%e?zG6?KbKI1B?e0apE1#+x zGe`{AGt!XddmJuZ7S5CC{ogw2qucM@t&?buJ)iDAdOzj8w|as1X`OcPoL6dzB;M*P zwPgcQCyN6iUJ&ykPZ}{X$gjtZ?yh`~xrch<7LGSY>0QcsZ7)v3bqI-_g(glc0VX`oywzzeE8{>+?ji~`rYFqX>aexjo7CeWC{D$8IvWXRMsS=YAg~X4#Zct zhd1(dyjCoSj+ecrPit=fZT)M1&nU1NHvImV_kFj_Kl9u+R($^lZMXRSPcyV?@%`^5 zAd<-e0Oif>K1vTcp^H>fp!Ab{TB}t0696Tr1p^+b=6Ub^2 zM_mR_{Siar?xj-SN1%QXMIJb3N(`O&V@O^te+ql?K1$j^LX`c`IzMe3pMCr|0C9KL zIBl1XD4&4Rg56h$5D-YSqgLf|xm0S#VF=Zc5QO)g1Vg5qN+)^QCZap-ilsf0V{;d9jTjFq5Y2?M2I<&jp^DfGwddi`H z-iHvDbn|tyNl^M4}Ah{JEmiMX7E0(NEI z{#8DiIXsz9X4WOiWab0;WOjX@I%Wk)s`ws{>J=zZpg@5F1qu`>P@q780tE^bC{Un4 VfdT~z6ezF~{{_;`mzMxg005 Date: Wed, 11 Feb 2026 05:02:38 +0000 Subject: [PATCH 09/11] refactor: Update rogue_ep_coop_exception_mac_check logic and test cases for version compatibility --- aci-preupgrade-validation-script.py | 12 ++- .../test_rogue_ep_coop_exception_mac_check.py | 94 +++++++++++++------ 2 files changed, 75 insertions(+), 31 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 47f40b7..d1ba3b2 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6021,8 +6021,16 @@ def rogue_ep_coop_exception_mac_check(cversion, tversion, **kwargs): 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)"): + # Affected source version is in range [5.2(3):6.0(3)] . Fixed on 6.0(9e)+ and 6.1(4)+. + # if cversion.newer_than("3.1(2v)") and tversion.older_than("6.1(3g)"): + if ( + (cversion.same_as("5.2(3e)") or cversion.newer_than("5.2(3e)")) and + (cversion.same_as("6.0(3g)") or cversion.older_than("6.0(3g)")) and + ( + tversion.older_than("6.0(9e)") or + ((tversion.same_as("6.1(1f)") or tversion.newer_than("6.1(1f)")) and tversion.older_than("6.1(4h)")) + ) + ): # 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}"))' 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 2292a0f..94b4ce9 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 @@ -23,47 +23,71 @@ "icurl_outputs, tversion, cversion, expected_result", [ # PASS cases - # Non affected tversion, affected cversion, no exception MACs + # Non affected tversion (fixed 6.1(4h)), 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)", + "6.1(4h)", + "5.2(5e)", script.PASS, ), - # Non affected cversion, affected tversion, no exception MACs + # Non affected tversion (fixed 6.0(9e)), 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.0(8h)", - "3.1(2v)", + "6.0(9e)", + "6.0(1h)", + script.PASS, + ), + # Non affected cversion (too old), 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(5h)", + "5.2(1a)", script.PASS, ), - # non affected cversion and tversion, no exception MACs + # Non affected cversion (too new), 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(5h)", + "6.0(5h)", + 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)", + "5.2(1a)", script.PASS, ), - # non affected cversion and tversion, with exception MACs + # 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)", + "5.2(1a)", script.PASS, ), - # affected edge cversion and tversion, no exception MACs + # Affected edge cversion (5.2(3e)) and tversion (6.1(3f)), 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)", + "5.2(3e)", + script.PASS, + ), + # Affected edge cversion (6.0(3g)) and tversion (6.0(8h)), 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)", + "6.0(3g)", script.PASS, ), - # affected cversion and tversion, no exception MACs + # 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")}, @@ -71,20 +95,20 @@ "5.2(8g)", script.PASS, ), - # affected version, exception MACs present but exceptcont listeners present + # Affected cversion and tversion, exception MACs present but 32+ 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", + "5.2(8g)", script.PASS, ), - # affected edge version, exception MACs present but exceptcont listeners present + # Affected edge cversion and tversion, exception MACs present but 32+ 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)", + "5.2(3e)", script.PASS, ), # MANUAL cases @@ -97,23 +121,23 @@ script.MANUAL, ), # FAIL cases - # affected edge version, exception MACs present, one missing exceptcont presListeners + # Affected edge cversion (5.2(3e)) and tversion (6.1(3f)), exception MACs present, one missing exceptcont presListener ( {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)", + "5.2(3e)", script.FAIL_O, ), - # affected version, exception MACs present, 31 exceptcont presListeners missing + # Affected cversion and tversion, exception MACs present, 31 exceptcont presListeners (missing 1) ( {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", + "5.2(8g)", script.FAIL_O, ), - # affected version, exception MACs present, many exceptcont presListeners missing + # Affected cversion and tversion, 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")}, @@ -121,7 +145,7 @@ "5.2(8g)", script.FAIL_O, ), - # affected version, exception MACs present, no exceptcont presListeners missing + # Affected cversion and tversion, exception MACs present, no exceptcont presListeners ( {exception_mac_api: read_data(dir, "rogue_mac_response.json"), presListener_api: []}, @@ -129,21 +153,33 @@ "5.2(8g)", script.FAIL_O, ), + # Affected edge cversion (6.0(3g)) and tversion (6.0(8h)), exception MACs present, no exceptcont presListeners + ( + {exception_mac_api: read_data(dir, "rogue_mac_response.json"), + presListener_api: []}, + "6.0(8h)", + "6.0(3g)", + script.FAIL_O, + ), ], ids=[ - "PASS_non_affected_tversion_affected_cversion_no_exception_MACs", - "PASS_non_affected_cversion_affected_tversion_no_exception_MACs", + "PASS_non_affected_tversion_6.1(4h)_fixed_affected_cversion_no_exception_MACs", + "PASS_non_affected_tversion_6.0(9e)_fixed_affected_cversion_no_exception_MACs", + "PASS_non_affected_cversion_too_old_affected_tversion_no_exception_MACs", + "PASS_non_affected_cversion_too_new_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_edge_cversion_5.2(3e)_tversion_6.1(3f)_no_exception_MACs", + "PASS_affected_edge_cversion_6.0(3g)_tversion_6.0(8h)_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", + "PASS_affected_cversion_tversion_exception_MACs_with_32plus_exceptcont_listeners", + "PASS_affected_edge_cversion_tversion_exception_MACs_with_32plus_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_31_exceptcont_listeners", "FAIL_affected_cversion_tversion_exception_MACs_many_missing_exceptcont_listeners", "FAIL_affected_cversion_tversion_exception_MACs_no_exceptcont_listeners", + "FAIL_affected_edge_cversion_6.0(3g)_tversion_6.0(8h)_exception_MACs_no_exceptcont_listeners", ], ) def test_rogue_ep_coop_exception_mac_check(run_check, mock_icurl, tversion, cversion, expected_result): From 51ab0b7b18d5779d9a1b0d3cd418e01456ff79f0 Mon Sep 17 00:00:00 2001 From: psureshb Date: Wed, 11 Feb 2026 10:15:20 +0000 Subject: [PATCH 10/11] doc update --- docs/docs/validations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/validations.md b/docs/docs/validations.md index 297ad5c..dc0f357 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -192,7 +192,7 @@ 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: | :no_entry_sign: +[Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: | [Rogue EP/COOP Exception MACs missing][d29] | CSCwp64296 | :white_check_mark: | :no_entry_sign: [d1]: #ep-announce-compatibility From d94df421a914b818519e12a94cd9f94497829831 Mon Sep 17 00:00:00 2001 From: tkishida Date: Wed, 4 Mar 2026 23:08:57 -0800 Subject: [PATCH 11/11] doc: Update the doc with proper conditions to check --- aci-preupgrade-validation-script.py | 4 ++-- docs/docs/validations.md | 34 ++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index ba8b369..34ab7c4 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6012,13 +6012,13 @@ def apic_vmm_inventory_sync_faults_check(**kwargs): doc_url=doc_url) -@check_wrapper(check_title='Rogue EP/COOP Exception MACs missing') +@check_wrapper(check_title='Rogue/COOP Exception List missing on switches') def rogue_ep_coop_exception_mac_check(cversion, tversion, **kwargs): result = PASS headers = ["Rogue Exception MACs Count", "presListener Count"] data = [] 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' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#roguecoop-exception-list-missing-on-switches' # Target version check if not tversion: diff --git a/docs/docs/validations.md b/docs/docs/validations.md index a42e557..91ab1c5 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -194,7 +194,7 @@ Items | Defect | This Script [ISIS DTEPs Byte Size][d27] | CSCwp15375 | :white_check_mark: | :no_entry_sign: [Policydist configpushShardCont Crash][d28] | CSCwp95515 | :white_check_mark: | :no_entry_sign: [Auto Firmware Update on Switch Discovery][d29] | CSCwe83941 | :white_check_mark: | :no_entry_sign: -[Rogue EP/COOP Exception MACs missing][d30] | CSCwp64296 | :white_check_mark: | :no_entry_sign: +[Rogue/COOP Exception List missing on switches][d30] | CSCwp64296 | :white_check_mark: | :no_entry_sign: [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -225,7 +225,7 @@ Items | Defect | This Script [d27]: #isis-dteps-byte-size [d28]: #policydist-configpushshardcont-crash [d29]: #auto-firmware-update-on-switch-discovery -[d30]: #rogue-epcoop-exception-macs-missing +[d30]: #roguecoop-exception-list-missing-on-switches ## General Check Details @@ -2672,13 +2672,35 @@ To avoid this risk, consider disabling Auto Firmware Update before upgrading to This issue occurs because older switch firmware versions are not compatible with switch images 6.0(3) or newer. The APIC version is not a factor. -### Rogue EP/COOP Exception MACs missing +### Rogue/COOP Exception List missing on switches -Due to the defect [CSCwp64296][64], 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. +Rogue Endpoint Control and COOP Dampening are features that mitigate the impact of flapping endpoints by temporarily pausing the learning of such endpoints. However, in some environments, certain MAC or IP addresses are expected to move frequently. -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. +The **Rogue/COOP Exception List** feature, introduced in 5.2(3), allows you to exclude specific MAC addresses from Rogue Endpoint Control and COOP Dampening. Initially, each MAC address had to be configured individually in each bridge domain. In 6.0(3), this feature was enhanced to support fabric-wide exception lists with wildcard options per bridge domain and the ability to exclude MAC addresses in L3Outs. -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. +However, due to [CSCwp64296][64], when upgrading spine switches to version 6.0(3)+ from an older version with **Rogue/COOP Exception List**s configured, some exception lists may not be pushed to the spine switches. As a result, the feature may stop functioning after the upgrade. + +!!! info + The root cause is that internal objects called `presListener` for **Rogue/COOP Exception List**, which publish the configuration from APICs to switches, may be missing on the APICs after an upgrade. This is due to [CSCwp64296][64], introduced with the enhancement in 6.0(3). + + The total number of `presListener` for **Rogue/COOP Exception List** on APICs should be 32, but APICs may fail to create all of them when upgrading from an older version to 6.0(3)+. If the spine switches are then upgraded while some `presListener`s are missing on APICs, they cannot retrieve the complete lists. + +This rule alerts you to [CSCwp64296][64] if: + +* Your current version is between 5.2(3) and 6.0(2). +* Your target version is affected by [CSCwp64296][64]. +* **Rogue/COOP Exception List** for bridge domains are configured. + +OR + +* Both your current and target APIC versions are the same and affected by [CSCwp64296][64]. +* The oldest current switch version is between 5.2(3) and 6.0(2). +* **Rogue/COOP Exception List** for bridge domains are configured. +* The total number of `presListener` for **Rogue/COOP Exception List** is less than 32. + +If the first set of conditions is met, you should change your target version to one with the fix for [CSCwp64296][64]. + +If the second set of conditions is met, it means that the APICs were already upgraded and affected by [CSCwp64296][64], but some switches have yet to be upgraded. In this case, you need to contact Cisco TAC to resolve the issue of missing `presListener` objects on APICs (see info above) to prevent the switches from failing to retrieve the exception lists. [0]: https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script