From 6a56948c6f9f817a28d28ce652048eb4ed30073d Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Wed, 24 Dec 2025 12:27:41 +0000 Subject: [PATCH 1/8] check for CSCwq28721 --- aci-preupgrade-validation-script.py | 37 ++++++++ docs/docs/validations.md | 16 +++- .../datetimePol_ntp_sync_issue.json | 29 ++++++ .../datetimePol_ntp_sync_issue_2.json | 29 ++++++ .../datetimePol_ntp_sync_no_issue.json | 29 ++++++ .../datetimePol_ntp_sync_no_issue_2.json | 29 ++++++ .../fabricRsTimePol_no_podgroup.json | 1 + .../fabricRsTimePol_ntp_sync_1pod.json | 28 ++++++ .../fabricRsTimePol_ntp_sync_2pod.json | 54 +++++++++++ .../test_leaf_ntp_sync_check.py | 94 +++++++++++++++++++ 10 files changed, 345 insertions(+), 1 deletion(-) create mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json create mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json create mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json create mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json create mode 100644 tests/checks/leaf_ntp_sync_check/fabricRsTimePol_no_podgroup.json create mode 100644 tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json create mode 100644 tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json create mode 100644 tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index ebe0477..94c1541 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6007,6 +6007,42 @@ def apic_vmm_inventory_sync_faults_check(**kwargs): recommended_action=recommended_action, doc_url=doc_url) + +@check_wrapper(check_title='NTP sync issue in Leaf as NTP server') +def leaf_ntp_sync_check(cversion, tversion, **kwargs): + result = PASS + headers = ['policy dn', 'pod group name', 'policy name'] + data = [] + recommended_action = 'NTP wont sync between leaf as NTP server and host. makesure to use in-band ip for NTP server in leaf or checkout the bug CSCwp92030 for fixed version details' + doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#ntp-sync-issue-in-leaf-as-ntp-server' + + fabricRsTimePol_api = 'fabricRsTimePol.json' + + if not tversion: + return Result(result=MANUAL, msg=TVER_MISSING) + + if tversion.newer_than('6.1(4.28)'): + return Result(result=NA, msg=VER_NOT_AFFECTED) + + if (cversion.newer_than('1.1(1a)') and cversion.older_than('6.1(4.20)')) or (tversion.newer_than('1.1(1a)') and tversion.older_than('6.1(4.20)')): + fabricRsTimePol = icurl('class', fabricRsTimePol_api) + for rstimepol in fabricRsTimePol: + rstimepol_attr = rstimepol['fabricRsTimePol']['attributes'] + pol_dn = rstimepol_attr['tDn'] + pol_name = rstimepol_attr['tnDatetimePolName'] + match = re.search(r'podpgrp-([^/]+)', rstimepol_attr['dn']) + pod_group = match.group(1) if match else None + pol_res = icurl('mo', pol_dn + '.json') + pol_attr = pol_res[0]['datetimePol']['attributes'] + if pol_attr['serverState'] == 'enabled' and pol_attr['masterMode'] == 'enabled': + data.append([pol_attr['dn'], pod_group, pol_name]) + + if data: + result = FAIL_O + + return Result(result=result, headers=headers, data=data, recommended_action=recommended_action, doc_url=doc_url) + + # ---- Script Execution ---- @@ -6168,6 +6204,7 @@ class CheckManager: standby_sup_sync_check, isis_database_byte_check, configpush_shard_check, + leaf_ntp_sync_check, ] ssh_checks = [ diff --git a/docs/docs/validations.md b/docs/docs/validations.md index fa1fc0e..4790930 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -191,6 +191,7 @@ Items | Defect | This Script [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: | +[NTP sync issue in Leaf as NTP server][d29] | CSCwq28721 | :white_check_mark: | [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size-defect-susceptibility @@ -220,7 +221,7 @@ Items | Defect | This Script [d26]: #stale-pconsra-object [d27]: #isis-dteps-byte-size [d28]: #policydist-configpushshardcont-crash - +[d29]: #NTP-sync-issue-in-Leaf-as-NTP-server ## General Check Details @@ -2614,6 +2615,18 @@ 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. +### NTP sync issue in Leaf as NTP server + +RCA: +After the ACI fabric upgraded to affected version, In setup which has leaf switch as NTP server, Destination Ip of NTP request coming from Host(NTP client) is not stored and resused as Source when reply back from leaf side. +Details information => Sendpkt in NTP(3rd party) code supports only the immediate source interface ip.Mechanism to store the starting source ip address must be present so that packets can be send to the starting source ip addr. + +IMPACT: +After the upgrade, NTP stopped working correctly between the endpoints and the master node (leaf switches). NTP request is being sent with the BD SVI IP as expected, but the leaf switch is responding with a different BD IP in the same VRF, leading to NTP response rejected from the endpoints. + +Suggestion: +Use IP address from a VRF which only has one IP address on the switch, example would be inband VRF(in-band ip) which would usually have only one IP address or move to fixed version refer [CSCwp92030][62]. + [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 +2689,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://bst.cloudapps.cisco.com/bugsearch/bug/CSCwp92030 \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json new file mode 100644 index 0000000..e2b8a82 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json @@ -0,0 +1,29 @@ +[ + { + "datetimePol": { + "attributes": { + "StratumValue": "8", + "adminSt": "enabled", + "annotation": "", + "authSt": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "dn": "uni/fabric/time-default", + "extMngdBy": "", + "lcOwn": "local", + "masterMode": "enabled", + "modTs": "2024-12-20T07:45:21.917+00:00", + "monPolDn": "", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "serverState": "enabled", + "status": "", + "uid": "0", + "userdom": "all" + } + } + } + ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json new file mode 100644 index 0000000..fe1ac1a --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json @@ -0,0 +1,29 @@ +[ + { + "datetimePol": { + "attributes": { + "StratumValue": "8", + "adminSt": "enabled", + "annotation": "", + "authSt": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "dn": "uni/fabric/time-NEW1", + "extMngdBy": "", + "lcOwn": "local", + "masterMode": "enabled", + "modTs": "2024-12-20T07:45:21.917+00:00", + "monPolDn": "", + "name": "NEW1", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "serverState": "enabled", + "status": "", + "uid": "15374", + "userdom": ":all:" + } + } + } + ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json new file mode 100644 index 0000000..c808568 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json @@ -0,0 +1,29 @@ +[ + { + "datetimePol": { + "attributes": { + "StratumValue": "8", + "adminSt": "enabled", + "annotation": "", + "authSt": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "dn": "uni/fabric/time-default", + "extMngdBy": "", + "lcOwn": "local", + "masterMode": "disabled", + "modTs": "2024-12-20T07:45:21.917+00:00", + "monPolDn": "", + "name": "default", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "serverState": "disabled", + "status": "", + "uid": "0", + "userdom": "all" + } + } + } + ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json new file mode 100644 index 0000000..383582c --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json @@ -0,0 +1,29 @@ +[ + { + "datetimePol": { + "attributes": { + "StratumValue": "8", + "adminSt": "enabled", + "annotation": "", + "authSt": "disabled", + "childAction": "", + "configIssues": "", + "descr": "", + "dn": "uni/fabric/time-NEW1", + "extMngdBy": "", + "lcOwn": "local", + "masterMode": "disabled", + "modTs": "2024-12-20T07:45:21.917+00:00", + "monPolDn": "", + "name": "NEW1", + "nameAlias": "", + "ownerKey": "", + "ownerTag": "", + "serverState": "disabled", + "status": "", + "uid": "15374", + "userdom": ":all:" + } + } + } + ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_no_podgroup.json b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_no_podgroup.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_no_podgroup.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json new file mode 100644 index 0000000..302532f --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json @@ -0,0 +1,28 @@ +[ + { + "fabricRsTimePol": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/fabric/funcprof/podpgrp-default/rsTimePol", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2025-12-23T07:43:09.740+00:00", + "monPolDn": "", + "rType": "mo", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "datetimePol", + "tContextDn": "", + "tDn": "uni/fabric/time-default", + "tRn": "time-default", + "tType": "name", + "tnDatetimePolName": "default", + "uid": "0", + "userdom": "all" + } + } + } + ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json new file mode 100644 index 0000000..0a8ab87 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json @@ -0,0 +1,54 @@ +[ + { + "fabricRsTimePol": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/fabric/funcprof/podpgrp-default/rsTimePol", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2025-12-23T07:43:09.740+00:00", + "monPolDn": "", + "rType": "mo", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "datetimePol", + "tContextDn": "", + "tDn": "uni/fabric/time-default", + "tRn": "time-default", + "tType": "name", + "tnDatetimePolName": "default", + "uid": "0", + "userdom": "all" + } + } + }, + { + "fabricRsTimePol": { + "attributes": { + "annotation": "", + "childAction": "", + "dn": "uni/fabric/funcprof/podpgrp-TESt2/rsTimePol", + "extMngdBy": "", + "forceResolve": "yes", + "lcOwn": "local", + "modTs": "2025-12-23T07:41:09.236+00:00", + "monPolDn": "", + "rType": "mo", + "state": "formed", + "stateQual": "none", + "status": "", + "tCl": "datetimePol", + "tContextDn": "", + "tDn": "uni/fabric/time-NEW1", + "tRn": "time-NEW1", + "tType": "name", + "tnDatetimePolName": "NEW1", + "uid": "0", + "userdom": ":all:" + } + } + } + ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py new file mode 100644 index 0000000..afaeb00 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py @@ -0,0 +1,94 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + +test_function = "leaf_ntp_sync_check" + +fabricRsTimePol_api = "fabricRsTimePol.json" +datetimePol_mo1 = "uni/fabric/time-default.json" +datetimePol_mo2 = "uni/fabric/time-NEW1.json" + +@pytest.mark.parametrize( + "icurl_outputs, cversion, tversion, expected_result", + [ + # no pod group scenario + ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_no_podgroup.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, + "6.1(4.10)", + "6.1(4.15)", + script.PASS, + ), + # single pod scenario + # Version not affected + ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, + "6.1(4.28)", + "6.1(4.30)", + script.NA, + ), + # Affected version, no NTP sync issue + ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_no_issue.json")}, + "6.1(4.10)", + "6.1(4.15)", + script.PASS, + ), + # Affected version, NTP sync issue + ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, + "6.1(4.10)", + "6.1(4.15)", + script.FAIL_O, + ), + # multi pod scenario + # Version not affected + ( + { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), + datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_issue_2.json")}, + "6.1(4.28)", + "6.1(4.30)", + script.NA, + ), + # Affected version, no NTP sync issue + ( + { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_no_issue.json"), + datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_no_issue_2.json")}, + "6.1(4.10)", + "6.1(4.15)", + script.PASS, + ), + # Affected version, one NTP sync issue + ( + { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), + datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_no_issue_2.json")}, + "6.1(4.10)", + "6.1(4.15)", + script.FAIL_O, + ), + # Affected version, multiple NTP sync issues + ( + { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), + datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), + datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_issue_2.json")}, + "6.1(4.10)", + "6.1(4.15)", + script.FAIL_O, + ), + ], +) +def test_leaf_ntp_sync_check(run_check, mock_icurl, cversion, tversion, expected_result): + result = run_check( + cversion=script.AciVersion(cversion) if cversion else None, + tversion=script.AciVersion(tversion) if tversion else None, + ) + assert result.result == expected_result \ No newline at end of file From c61b927dec7fd56bba315cc6dda8f3070c186133 Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Mon, 5 Jan 2026 09:40:21 +0530 Subject: [PATCH 2/8] Update aci-preupgrade-validation-script.py Addressing PR comments --- aci-preupgrade-validation-script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 94c1541..0264007 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6034,7 +6034,7 @@ def leaf_ntp_sync_check(cversion, tversion, **kwargs): pod_group = match.group(1) if match else None pol_res = icurl('mo', pol_dn + '.json') pol_attr = pol_res[0]['datetimePol']['attributes'] - if pol_attr['serverState'] == 'enabled' and pol_attr['masterMode'] == 'enabled': + if pol_attr['serverState'] == 'enabled': data.append([pol_attr['dn'], pod_group, pol_name]) if data: From 274b9d57c15d751c5382f13f34675bff8b66fc6e Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Mon, 12 Jan 2026 11:23:02 +0530 Subject: [PATCH 3/8] Update affected version in aci-preupgrade-validation-script.py --- aci-preupgrade-validation-script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 0264007..a315954 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6024,7 +6024,7 @@ def leaf_ntp_sync_check(cversion, tversion, **kwargs): if tversion.newer_than('6.1(4.28)'): return Result(result=NA, msg=VER_NOT_AFFECTED) - if (cversion.newer_than('1.1(1a)') and cversion.older_than('6.1(4.20)')) or (tversion.newer_than('1.1(1a)') and tversion.older_than('6.1(4.20)')): + if (cversion.newer_than('6.1(1f)') and cversion.older_than('6.1(4.28)')) or (tversion.newer_than('6.1(1f)') and tversion.older_than('6.1(4.28)')): fabricRsTimePol = icurl('class', fabricRsTimePol_api) for rstimepol in fabricRsTimePol: rstimepol_attr = rstimepol['fabricRsTimePol']['attributes'] From e3bbb54b12f23e339dfd35da8fc4fc84374daf5c Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Wed, 18 Feb 2026 05:10:53 +0000 Subject: [PATCH 4/8] updated version check as per cco version --- .../test_leaf_ntp_sync_check.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py index afaeb00..08027d5 100644 --- a/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py +++ b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py @@ -21,30 +21,30 @@ # no pod group scenario ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_no_podgroup.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, - "6.1(4.10)", - "6.1(4.15)", + "6.1(3f)", + "6.1(4b)", script.PASS, ), # single pod scenario # Version not affected ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, - "6.1(4.28)", - "6.1(4.30)", + "6.1(3f)", + "6.1(5e)", script.NA, ), # Affected version, no NTP sync issue ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_no_issue.json")}, - "6.1(4.10)", - "6.1(4.15)", + "6.1(3f)", + "6.1(4b)", script.PASS, ), # Affected version, NTP sync issue ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, - "6.1(4.10)", - "6.1(4.15)", + "6.1(3f)", + "6.1(4b)", script.FAIL_O, ), # multi pod scenario @@ -53,8 +53,8 @@ { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_issue_2.json")}, - "6.1(4.28)", - "6.1(4.30)", + "6.1(3f)", + "6.1(5e)", script.NA, ), # Affected version, no NTP sync issue @@ -62,8 +62,8 @@ { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_no_issue.json"), datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_no_issue_2.json")}, - "6.1(4.10)", - "6.1(4.15)", + "6.1(3f)", + "6.1(4b)", script.PASS, ), # Affected version, one NTP sync issue @@ -71,8 +71,8 @@ { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_no_issue_2.json")}, - "6.1(4.10)", - "6.1(4.15)", + "6.1(3f)", + "6.1(4b)", script.FAIL_O, ), # Affected version, multiple NTP sync issues @@ -80,8 +80,8 @@ { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_issue_2.json")}, - "6.1(4.10)", - "6.1(4.15)", + "6.1(3f)", + "6.1(4b)", script.FAIL_O, ), ], From 3be1893abb2d31c61d09d26a57ea236b740dbdbd Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Wed, 18 Feb 2026 05:11:52 +0000 Subject: [PATCH 5/8] updated Pytest --- aci-preupgrade-validation-script.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 8deceae..cb3846c 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6039,10 +6039,10 @@ def leaf_ntp_sync_check(cversion, tversion, **kwargs): if not tversion: return Result(result=MANUAL, msg=TVER_MISSING) - if tversion.newer_than('6.1(4.28)'): + if tversion.newer_than('6.1(4h)') or tversion.same_as('6.0(9e)'): return Result(result=NA, msg=VER_NOT_AFFECTED) - if (cversion.newer_than('6.1(1f)') and cversion.older_than('6.1(4.28)')) or (tversion.newer_than('6.1(1f)') and tversion.older_than('6.1(4.28)')): + if (cversion.newer_than('6.0(9e)') and cversion.older_than('6.1(4h)')) or (tversion.newer_than('6.0(9e)') and tversion.older_than('6.1(4h)')): fabricRsTimePol = icurl('class', fabricRsTimePol_api) for rstimepol in fabricRsTimePol: rstimepol_attr = rstimepol['fabricRsTimePol']['attributes'] From e9ffdb92f2a8c9cc3b81b154c693ac102af5fdc6 Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Fri, 20 Mar 2026 07:36:42 +0000 Subject: [PATCH 6/8] Updated PR as per updated esc detection logic --- aci-preupgrade-validation-script.py | 49 ++++++---- ...p.json => datetimeClkPol_no_podgroup.json} | 0 .../datetimeClkPol_ntp_sync_1pod.json | 9 ++ .../datetimeClkPol_ntp_sync_2pod.json | 16 ++++ .../datetimePol_ntp_sync_issue.json | 29 ------ .../datetimePol_ntp_sync_issue_2.json | 29 ------ .../datetimePol_ntp_sync_no_issue.json | 29 ------ .../datetimePol_ntp_sync_no_issue_2.json | 29 ------ .../fabricRsTimePol_ntp_sync_1pod.json | 28 ------ .../fabricRsTimePol_ntp_sync_2pod.json | 54 ----------- .../ipv4_ntp_sync_issue.json | 26 ++++++ .../ipv4_ntp_sync_issue_1.json | 42 +++++++++ .../ipv4_ntp_sync_issue_2.json | 42 +++++++++ .../ipv4_ntp_sync_no_issue.json | 26 ++++++ .../ipv4_ntp_sync_no_issue_2.json | 42 +++++++++ .../ipv6_ntp_sync_issue.json | 26 ++++++ .../ipv6_ntp_sync_issue_1.json | 42 +++++++++ .../ipv6_ntp_sync_issue_2.json | 42 +++++++++ .../ipv6_ntp_sync_no_issue.json | 26 ++++++ .../ipv6_ntp_sync_no_issue_2.json | 42 +++++++++ .../test_leaf_ntp_sync_check.py | 91 +++++++++++++------ 21 files changed, 477 insertions(+), 242 deletions(-) rename tests/checks/leaf_ntp_sync_check/{fabricRsTimePol_no_podgroup.json => datetimeClkPol_no_podgroup.json} (100%) create mode 100644 tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_1pod.json create mode 100644 tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_2pod.json delete mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json delete mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json delete mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json delete mode 100644 tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json delete mode 100644 tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json delete mode 100644 tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_1.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_2.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue_2.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_1.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_2.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue.json create mode 100644 tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue_2.json diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 904a054..5f50856 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6057,28 +6057,45 @@ def auto_firmware_update_on_switch_check(cversion, tversion, **kwargs): @check_wrapper(check_title='NTP sync issue in Leaf as NTP server') def leaf_ntp_sync_check(cversion, tversion, **kwargs): result = PASS - headers = ['policy dn', 'pod group name', 'policy name'] + headers = ['Pod', 'Node', 'VRF'] data = [] - recommended_action = 'NTP wont sync between leaf as NTP server and host. makesure to use in-band ip for NTP server in leaf or checkout the bug CSCwp92030 for fixed version details' + recommended_action = 'Use in-band ip for NTP server on leaf or upgrade to fix version of CSCwp92030' doc_url = 'https://datacenter.github.io/ACI-Pre-Upgrade-Validation-Script/validations/#ntp-sync-issue-in-leaf-as-ntp-server' - fabricRsTimePol_api = 'fabricRsTimePol.json' + datetimeClkPol_api = 'datetimeClkPol.json?query-target-filter=and(eq(datetimeClkPol.serverState,"enabled"))&rsp-prop-include=naming-only' + ipv4Addr_api = 'ipv4Addr.json?query-target-filter=or(wcard(ipv4Addr.dn,":"))&rsp-prop-include=naming-only' + ipv6Addr_api = 'ipv6Addr.json?&rsp-prop-include=naming-only' - if tversion.newer_than('6.1(4h)') or tversion.same_as('6.0(9e)'): + if tversion.newer_than('6.1(4h)'): return Result(result=NA, msg=VER_NOT_AFFECTED) - if (cversion.newer_than('6.0(9e)') and cversion.older_than('6.1(4h)')) or (tversion.newer_than('6.0(9e)') and tversion.older_than('6.1(4h)')): - fabricRsTimePol = icurl('class', fabricRsTimePol_api) - for rstimepol in fabricRsTimePol: - rstimepol_attr = rstimepol['fabricRsTimePol']['attributes'] - pol_dn = rstimepol_attr['tDn'] - pol_name = rstimepol_attr['tnDatetimePolName'] - match = re.search(r'podpgrp-([^/]+)', rstimepol_attr['dn']) - pod_group = match.group(1) if match else None - pol_res = icurl('mo', pol_dn + '.json') - pol_attr = pol_res[0]['datetimePol']['attributes'] - if pol_attr['serverState'] == 'enabled': - data.append([pol_attr['dn'], pod_group, pol_name]) + def check_ip_entries_in_vrf(ipAddr_api, affected_pod_groups): + pod_vrf_tuple_set = set() + icurl_ips = icurl('class', ipAddr_api) + ip_type = list(icurl_ips[0].keys())[0] if icurl_ips else None + for ip in icurl_ips: + ip_dn = ip[ip_type]['attributes']['dn'] + pod_vrf_regex = re.search(node_regex + r'.*dom-(?P[^/]+)', ip_dn) + pod = pod_vrf_regex.group("pod") if pod_vrf_regex else None + if pod in affected_pod_groups: + node = pod_vrf_regex.group("node") if pod_vrf_regex else None + vrf = pod_vrf_regex.group("vrf") if pod_vrf_regex else None + if (pod, vrf, node) not in pod_vrf_tuple_set: + pod_vrf_tuple_set.add((pod, vrf, node)) + else: + data.append(['pod-{}'.format(pod), 'node-{}'.format(node), vrf]) + + if (cversion.newer_than('6.0(9e)') and cversion.older_than('6.1(5e)')) or (tversion.newer_than('6.0(9e)') and tversion.older_than('6.1(5e)')): + datetimeClkPol = icurl('class', datetimeClkPol_api) + affected_pod_groups = set() + for clkpol in datetimeClkPol: + clkpol_attr = clkpol['datetimeClkPol']['attributes'] + dn = re.search(node_regex, clkpol_attr['dn']) + pod_id = dn.group("pod") if dn else None + affected_pod_groups.add(pod_id) + affected_pod_groups = sorted(affected_pod_groups) + check_ip_entries_in_vrf(ipv4Addr_api, affected_pod_groups) + check_ip_entries_in_vrf(ipv6Addr_api, affected_pod_groups) if data: result = FAIL_O diff --git a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_no_podgroup.json b/tests/checks/leaf_ntp_sync_check/datetimeClkPol_no_podgroup.json similarity index 100% rename from tests/checks/leaf_ntp_sync_check/fabricRsTimePol_no_podgroup.json rename to tests/checks/leaf_ntp_sync_check/datetimeClkPol_no_podgroup.json diff --git a/tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_1pod.json b/tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_1pod.json new file mode 100644 index 0000000..6de67b8 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_1pod.json @@ -0,0 +1,9 @@ +[ + { + "datetimeClkPol": { + "attributes": { + "dn": "topology/pod-1/node-1105/sys/time" + } + } + } +] diff --git a/tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_2pod.json b/tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_2pod.json new file mode 100644 index 0000000..ed4ec3f --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/datetimeClkPol_ntp_sync_2pod.json @@ -0,0 +1,16 @@ +[ + { + "datetimeClkPol": { + "attributes": { + "dn": "topology/pod-1/node-1105/sys/time" + } + } + }, + { + "datetimeClkPol": { + "attributes": { + "dn": "topology/pod-2/node-1109/sys/time" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json deleted file mode 100644 index e2b8a82..0000000 --- a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "datetimePol": { - "attributes": { - "StratumValue": "8", - "adminSt": "enabled", - "annotation": "", - "authSt": "disabled", - "childAction": "", - "configIssues": "", - "descr": "", - "dn": "uni/fabric/time-default", - "extMngdBy": "", - "lcOwn": "local", - "masterMode": "enabled", - "modTs": "2024-12-20T07:45:21.917+00:00", - "monPolDn": "", - "name": "default", - "nameAlias": "", - "ownerKey": "", - "ownerTag": "", - "serverState": "enabled", - "status": "", - "uid": "0", - "userdom": "all" - } - } - } - ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json deleted file mode 100644 index fe1ac1a..0000000 --- a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_issue_2.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "datetimePol": { - "attributes": { - "StratumValue": "8", - "adminSt": "enabled", - "annotation": "", - "authSt": "disabled", - "childAction": "", - "configIssues": "", - "descr": "", - "dn": "uni/fabric/time-NEW1", - "extMngdBy": "", - "lcOwn": "local", - "masterMode": "enabled", - "modTs": "2024-12-20T07:45:21.917+00:00", - "monPolDn": "", - "name": "NEW1", - "nameAlias": "", - "ownerKey": "", - "ownerTag": "", - "serverState": "enabled", - "status": "", - "uid": "15374", - "userdom": ":all:" - } - } - } - ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json deleted file mode 100644 index c808568..0000000 --- a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "datetimePol": { - "attributes": { - "StratumValue": "8", - "adminSt": "enabled", - "annotation": "", - "authSt": "disabled", - "childAction": "", - "configIssues": "", - "descr": "", - "dn": "uni/fabric/time-default", - "extMngdBy": "", - "lcOwn": "local", - "masterMode": "disabled", - "modTs": "2024-12-20T07:45:21.917+00:00", - "monPolDn": "", - "name": "default", - "nameAlias": "", - "ownerKey": "", - "ownerTag": "", - "serverState": "disabled", - "status": "", - "uid": "0", - "userdom": "all" - } - } - } - ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json b/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json deleted file mode 100644 index 383582c..0000000 --- a/tests/checks/leaf_ntp_sync_check/datetimePol_ntp_sync_no_issue_2.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "datetimePol": { - "attributes": { - "StratumValue": "8", - "adminSt": "enabled", - "annotation": "", - "authSt": "disabled", - "childAction": "", - "configIssues": "", - "descr": "", - "dn": "uni/fabric/time-NEW1", - "extMngdBy": "", - "lcOwn": "local", - "masterMode": "disabled", - "modTs": "2024-12-20T07:45:21.917+00:00", - "monPolDn": "", - "name": "NEW1", - "nameAlias": "", - "ownerKey": "", - "ownerTag": "", - "serverState": "disabled", - "status": "", - "uid": "15374", - "userdom": ":all:" - } - } - } - ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json deleted file mode 100644 index 302532f..0000000 --- a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_1pod.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "fabricRsTimePol": { - "attributes": { - "annotation": "", - "childAction": "", - "dn": "uni/fabric/funcprof/podpgrp-default/rsTimePol", - "extMngdBy": "", - "forceResolve": "yes", - "lcOwn": "local", - "modTs": "2025-12-23T07:43:09.740+00:00", - "monPolDn": "", - "rType": "mo", - "state": "formed", - "stateQual": "none", - "status": "", - "tCl": "datetimePol", - "tContextDn": "", - "tDn": "uni/fabric/time-default", - "tRn": "time-default", - "tType": "name", - "tnDatetimePolName": "default", - "uid": "0", - "userdom": "all" - } - } - } - ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json b/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json deleted file mode 100644 index 0a8ab87..0000000 --- a/tests/checks/leaf_ntp_sync_check/fabricRsTimePol_ntp_sync_2pod.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "fabricRsTimePol": { - "attributes": { - "annotation": "", - "childAction": "", - "dn": "uni/fabric/funcprof/podpgrp-default/rsTimePol", - "extMngdBy": "", - "forceResolve": "yes", - "lcOwn": "local", - "modTs": "2025-12-23T07:43:09.740+00:00", - "monPolDn": "", - "rType": "mo", - "state": "formed", - "stateQual": "none", - "status": "", - "tCl": "datetimePol", - "tContextDn": "", - "tDn": "uni/fabric/time-default", - "tRn": "time-default", - "tType": "name", - "tnDatetimePolName": "default", - "uid": "0", - "userdom": "all" - } - } - }, - { - "fabricRsTimePol": { - "attributes": { - "annotation": "", - "childAction": "", - "dn": "uni/fabric/funcprof/podpgrp-TESt2/rsTimePol", - "extMngdBy": "", - "forceResolve": "yes", - "lcOwn": "local", - "modTs": "2025-12-23T07:41:09.236+00:00", - "monPolDn": "", - "rType": "mo", - "state": "formed", - "stateQual": "none", - "status": "", - "tCl": "datetimePol", - "tContextDn": "", - "tDn": "uni/fabric/time-NEW1", - "tRn": "time-NEW1", - "tType": "name", - "tnDatetimePolName": "NEW1", - "uid": "0", - "userdom": ":all:" - } - } - } - ] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue.json b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue.json new file mode 100644 index 0000000..6033e4e --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue.json @@ -0,0 +1,26 @@ +[ + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.1/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan302]/addr-[192.168.1.1/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.2/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.3/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan371]/addr-[192.168.1.3/24]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_1.json b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_1.json new file mode 100644 index 0000000..371ff86 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_1.json @@ -0,0 +1,42 @@ +[ + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.1/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan302]/addr-[192.168.1.1/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.2/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx2/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.3/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx3/if-[vlan371]/addr-[192.168.1.3/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.6/24", + "dn": "topology/pod-2/node-1109/sys/ipv4/inst/dom-t0:ctx1/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.7/24", + "dn": "topology/pod-2/node-1109/sys/ipv4/inst/dom-t0:ctx1/if-[vlan372]/addr-[192.168.1.4/24]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_2.json b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_2.json new file mode 100644 index 0000000..ca2051c --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_issue_2.json @@ -0,0 +1,42 @@ +[ + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.1/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan302]/addr-[192.168.1.1/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.2/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.3/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan371]/addr-[192.168.1.3/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.6/24", + "dn": "topology/pod-2/node-1109/sys/ipv4/inst/dom-t0:ctx1/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.7/24", + "dn": "topology/pod-2/node-1109/sys/ipv4/inst/dom-t0:ctx1/if-[vlan372]/addr-[192.168.1.4/24]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue.json b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue.json new file mode 100644 index 0000000..57f7b53 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue.json @@ -0,0 +1,26 @@ +[ + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.1/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan302]/addr-[192.168.1.1/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.2/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx2/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.3/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx3/if-[vlan371]/addr-[192.168.1.3/24]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue_2.json b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue_2.json new file mode 100644 index 0000000..22325f9 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv4_ntp_sync_no_issue_2.json @@ -0,0 +1,42 @@ +[ + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.1/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx1/if-[vlan302]/addr-[192.168.1.1/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.2/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx2/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.3/24", + "dn": "topology/pod-1/node-1105/sys/ipv4/inst/dom-t0:ctx3/if-[vlan371]/addr-[192.168.1.3/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.6/24", + "dn": "topology/pod-2/node-1109/sys/ipv4/inst/dom-t0:ctx1/if-[vlan50]/addr-[192.168.1.2/24]" + } + } + }, + { + "ipv4Addr": { + "attributes": { + "addr": "192.168.1.7/24", + "dn": "topology/pod-2/node-1109/sys/ipv4/inst/dom-t0:ctx2/if-[vlan372]/addr-[192.168.1.4/24]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue.json b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue.json new file mode 100644 index 0000000..ebf5b8e --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue.json @@ -0,0 +1,26 @@ +[ + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:29::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan302]/addr-[2001:56:29::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_1.json b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_1.json new file mode 100644 index 0000000..e956d36 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_1.json @@ -0,0 +1,42 @@ +[ + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:29::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan302]/addr-[2001:56:29::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx2/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx3/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-2/node-1109/sys/ipv6/inst/dom-t0:ctx1/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-2/node-1109/sys/ipv6/inst/dom-t0:ctx1/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_2.json b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_2.json new file mode 100644 index 0000000..cffcde2 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_issue_2.json @@ -0,0 +1,42 @@ +[ + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:29::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan302]/addr-[2001:56:29::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-2/node-1109/sys/ipv6/inst/dom-t0:ctx1/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-2/node-1109/sys/ipv6/inst/dom-t0:ctx1/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue.json b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue.json new file mode 100644 index 0000000..209a14a --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue.json @@ -0,0 +1,26 @@ +[ + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:29::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan302]/addr-[2001:56:29::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx2/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx3/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue_2.json b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue_2.json new file mode 100644 index 0000000..e991631 --- /dev/null +++ b/tests/checks/leaf_ntp_sync_check/ipv6_ntp_sync_no_issue_2.json @@ -0,0 +1,42 @@ +[ + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:29::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx1/if-[vlan302]/addr-[2001:56:29::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx2/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-1/node-1105/sys/ipv6/inst/dom-t0:ctx3/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2001:56:28::1/64", + "dn": "topology/pod-2/node-1109/sys/ipv6/inst/dom-t0:ctx1/if-[vlan50]/addr-[2001:56:28::1/64]" + } + } + }, + { + "ipv6Addr": { + "attributes": { + "addr": "2002:1:1:b::1/64", + "dn": "topology/pod-2/node-1109/sys/ipv6/inst/dom-t0:ctx2/if-[vlan371]/addr-[2002:1:1:b::1/64]" + } + } + } +] \ No newline at end of file diff --git a/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py index 08027d5..97b3dff 100644 --- a/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py +++ b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py @@ -5,44 +5,61 @@ from helpers.utils import read_data script = importlib.import_module("aci-preupgrade-validation-script") - log = logging.getLogger(__name__) dir = os.path.dirname(os.path.abspath(__file__)) - test_function = "leaf_ntp_sync_check" - -fabricRsTimePol_api = "fabricRsTimePol.json" -datetimePol_mo1 = "uni/fabric/time-default.json" -datetimePol_mo2 = "uni/fabric/time-NEW1.json" +datetimeClkPol_api = 'datetimeClkPol.json?query-target-filter=and(eq(datetimeClkPol.serverState,"enabled"))&rsp-prop-include=naming-only' +ipv4Addr_api = 'ipv4Addr.json?query-target-filter=or(wcard(ipv4Addr.dn,":"))&rsp-prop-include=naming-only' +ipv6Addr_api = 'ipv6Addr.json?&rsp-prop-include=naming-only' @pytest.mark.parametrize( "icurl_outputs, cversion, tversion, expected_result", [ # no pod group scenario - ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_no_podgroup.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, + ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_no_podgroup.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue.json")}, "6.1(3f)", "6.1(4b)", script.PASS, ), # single pod scenario # Version not affected - ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, + ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue.json")}, "6.1(3f)", "6.1(5e)", script.NA, ), # Affected version, no NTP sync issue - ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_no_issue.json")}, + ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_no_issue.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_no_issue.json")}, "6.1(3f)", "6.1(4b)", script.PASS, ), # Affected version, NTP sync issue - ( { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_1pod.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json")}, + ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue.json")}, + "6.1(3f)", + "6.1(4b)", + script.FAIL_O, + ), + # Affected version, only ipv4 NTP sync issue + ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_no_issue.json")}, + "6.1(3f)", + "6.1(4b)", + script.FAIL_O, + ), + # Affected version, only ipv6 NTP sync issue + ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_no_issue.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue.json")}, "6.1(3f)", "6.1(4b)", script.FAIL_O, @@ -50,36 +67,54 @@ # multi pod scenario # Version not affected ( - { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), - datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_issue_2.json")}, + { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_2pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue_2.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue_2.json")}, "6.1(3f)", "6.1(5e)", script.NA, ), # Affected version, no NTP sync issue ( - { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_no_issue.json"), - datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_no_issue_2.json")}, + { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_2pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_no_issue_2.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_no_issue_2.json")}, "6.1(3f)", "6.1(4b)", script.PASS, ), - # Affected version, one NTP sync issue + # Affected version, one pod NTP sync issue + ( + { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_2pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue_1.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue_1.json")}, + "6.1(3f)", + "6.1(4b)", + script.FAIL_O, + ), + # Affected version, multiple pod NTP sync issues + ( + { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_2pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue_2.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue_2.json")}, + "6.1(3f)", + "6.1(4b)", + script.FAIL_O, + ), + # Affected version, only ipv4 NTP sync issues ( - { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), - datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_no_issue_2.json")}, + { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_2pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_issue_2.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_no_issue_2.json")}, "6.1(3f)", "6.1(4b)", script.FAIL_O, ), - # Affected version, multiple NTP sync issues + # Affected version, only ipv6 NTP sync issues ( - { fabricRsTimePol_api: read_data(dir, "fabricRsTimePol_ntp_sync_2pod.json"), - datetimePol_mo1: read_data(dir, "datetimePol_ntp_sync_issue.json"), - datetimePol_mo2: read_data(dir, "datetimePol_ntp_sync_issue_2.json")}, + { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_2pod.json"), + ipv4Addr_api: read_data(dir, "ipv4_ntp_sync_no_issue_2.json"), + ipv6Addr_api: read_data(dir, "ipv6_ntp_sync_issue_2.json")}, "6.1(3f)", "6.1(4b)", script.FAIL_O, From 4f3a02bd2779a81f6582bb07c0002a32d18f95fc Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Sun, 22 Mar 2026 17:00:44 +0000 Subject: [PATCH 7/8] Removed dup entries in output[data] --- aci-preupgrade-validation-script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 5f50856..8a197bc 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6082,7 +6082,7 @@ def check_ip_entries_in_vrf(ipAddr_api, affected_pod_groups): vrf = pod_vrf_regex.group("vrf") if pod_vrf_regex else None if (pod, vrf, node) not in pod_vrf_tuple_set: pod_vrf_tuple_set.add((pod, vrf, node)) - else: + elif ['pod-{}'.format(pod), 'node-{}'.format(node), vrf] not in data: data.append(['pod-{}'.format(pod), 'node-{}'.format(node), vrf]) if (cversion.newer_than('6.0(9e)') and cversion.older_than('6.1(5e)')) or (tversion.newer_than('6.0(9e)') and tversion.older_than('6.1(5e)')): From c50124391faece694f0e8dc8d9f9ee61e6ec90d0 Mon Sep 17 00:00:00 2001 From: sudharson-soundrapandiyan Date: Mon, 23 Mar 2026 05:02:06 +0000 Subject: [PATCH 8/8] added expected data in pytest check and optimized check run --- aci-preupgrade-validation-script.py | 5 +++-- .../test_leaf_ntp_sync_check.py | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 8a197bc..459548f 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -6094,8 +6094,9 @@ def check_ip_entries_in_vrf(ipAddr_api, affected_pod_groups): pod_id = dn.group("pod") if dn else None affected_pod_groups.add(pod_id) affected_pod_groups = sorted(affected_pod_groups) - check_ip_entries_in_vrf(ipv4Addr_api, affected_pod_groups) - check_ip_entries_in_vrf(ipv6Addr_api, affected_pod_groups) + if affected_pod_groups: + check_ip_entries_in_vrf(ipv4Addr_api, affected_pod_groups) + check_ip_entries_in_vrf(ipv6Addr_api, affected_pod_groups) if data: result = FAIL_O diff --git a/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py index 97b3dff..69572e1 100644 --- a/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py +++ b/tests/checks/leaf_ntp_sync_check/test_leaf_ntp_sync_check.py @@ -13,7 +13,7 @@ ipv6Addr_api = 'ipv6Addr.json?&rsp-prop-include=naming-only' @pytest.mark.parametrize( - "icurl_outputs, cversion, tversion, expected_result", + "icurl_outputs, cversion, tversion, expected_result, expected_data", [ # no pod group scenario ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_no_podgroup.json"), @@ -22,6 +22,7 @@ "6.1(3f)", "6.1(4b)", script.PASS, + [], ), # single pod scenario # Version not affected @@ -31,6 +32,7 @@ "6.1(3f)", "6.1(5e)", script.NA, + [], ), # Affected version, no NTP sync issue ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), @@ -39,6 +41,7 @@ "6.1(3f)", "6.1(4b)", script.PASS, + [], ), # Affected version, NTP sync issue ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), @@ -47,6 +50,7 @@ "6.1(3f)", "6.1(4b)", script.FAIL_O, + [['pod-1', 'node-1105', 't0:ctx1']], ), # Affected version, only ipv4 NTP sync issue ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), @@ -55,6 +59,7 @@ "6.1(3f)", "6.1(4b)", script.FAIL_O, + [['pod-1', 'node-1105', 't0:ctx1']], ), # Affected version, only ipv6 NTP sync issue ( { datetimeClkPol_api: read_data(dir, "datetimeClkPol_ntp_sync_1pod.json"), @@ -63,6 +68,7 @@ "6.1(3f)", "6.1(4b)", script.FAIL_O, + [['pod-1', 'node-1105', 't0:ctx1']], ), # multi pod scenario # Version not affected @@ -73,6 +79,7 @@ "6.1(3f)", "6.1(5e)", script.NA, + [], ), # Affected version, no NTP sync issue ( @@ -82,6 +89,7 @@ "6.1(3f)", "6.1(4b)", script.PASS, + [], ), # Affected version, one pod NTP sync issue ( @@ -91,6 +99,7 @@ "6.1(3f)", "6.1(4b)", script.FAIL_O, + [['pod-2', 'node-1109', 't0:ctx1']], ), # Affected version, multiple pod NTP sync issues ( @@ -100,6 +109,7 @@ "6.1(3f)", "6.1(4b)", script.FAIL_O, + [['pod-1', 'node-1105', 't0:ctx1'], ['pod-2', 'node-1109', 't0:ctx1']], ), # Affected version, only ipv4 NTP sync issues ( @@ -109,6 +119,7 @@ "6.1(3f)", "6.1(4b)", script.FAIL_O, + [['pod-1', 'node-1105', 't0:ctx1'], ['pod-2', 'node-1109', 't0:ctx1']], ), # Affected version, only ipv6 NTP sync issues ( @@ -118,12 +129,14 @@ "6.1(3f)", "6.1(4b)", script.FAIL_O, + [['pod-1', 'node-1105', 't0:ctx1'], ['pod-2', 'node-1109', 't0:ctx1']], ), ], ) -def test_leaf_ntp_sync_check(run_check, mock_icurl, cversion, tversion, expected_result): +def test_leaf_ntp_sync_check(run_check, mock_icurl, cversion, tversion, expected_result, expected_data): result = run_check( cversion=script.AciVersion(cversion) if cversion else None, tversion=script.AciVersion(tversion) if tversion else None, ) - assert result.result == expected_result \ No newline at end of file + assert result.result == expected_result + assert result.data == expected_data \ No newline at end of file