From e1de09fa2c29888ef74e1951a22d0f444b1fbfeb Mon Sep 17 00:00:00 2001 From: kshcheku <142834037+kshcheku@users.noreply.github.com> Date: Tue, 7 May 2024 21:43:10 +0100 Subject: [PATCH] 59 fabric dpp check (#76) * new validation for CSCwf05073 * cosmetic change * Update aci-preupgrade-validation-script.py Co-authored-by: takishida <38262981+takishida@users.noreply.github.com> * Update aci-preupgrade-validation-script.py Co-authored-by: takishida <38262981+takishida@users.noreply.github.com> * Update docs/docs/validations.md Co-authored-by: takishida <38262981+takishida@users.noreply.github.com> * Update docs/docs/validations.md Co-authored-by: takishida <38262981+takishida@users.noreply.github.com> * Update docs/docs/validations.md Co-authored-by: takishida <38262981+takishida@users.noreply.github.com> * Update docs/docs/validations.md Co-authored-by: takishida <38262981+takishida@users.noreply.github.com> * modify affected versions * query for dpp on + update tests --------- Co-authored-by: takishida <38262981+takishida@users.noreply.github.com> Co-authored-by: gmonroy --- aci-preupgrade-validation-script.py | 30 ++++++++ docs/docs/validations.md | 10 +++ tests/fabric_dpp_check/lbpPol_NEG.json | 1 + tests/fabric_dpp_check/lbpPol_POS.json | 14 ++++ .../fabric_dpp_check/test_fabric_dpp_check.py | 69 +++++++++++++++++++ 5 files changed, 124 insertions(+) create mode 100644 tests/fabric_dpp_check/lbpPol_NEG.json create mode 100644 tests/fabric_dpp_check/lbpPol_POS.json create mode 100644 tests/fabric_dpp_check/test_fabric_dpp_check.py diff --git a/aci-preupgrade-validation-script.py b/aci-preupgrade-validation-script.py index 1775d38..1c98fd0 100644 --- a/aci-preupgrade-validation-script.py +++ b/aci-preupgrade-validation-script.py @@ -3056,6 +3056,34 @@ def fabric_port_down_check(index, total_checks, **kwargs): return result +def fabric_dpp_check(index, total_checks, tversion, **kwargs): + title = 'CoS 3 with Dynamic Packet Prioritization' + result = PASS + msg = '' + headers = ["Potential Defect", "Reason"] + data = [] + recommended_action = 'Change the target version to the fixed version of CSCwf05073' + doc_url = 'https://bst.cloudapps.cisco.com/bugsearch/bug/CSCwf05073' + print_title(title, index, total_checks) + + if not tversion: + print_result(title, MANUAL, "Target version not supplied. Skipping.") + return MANUAL + + lbpol_api = 'lbpPol.json' + lbpol_api += '?query-target-filter=eq(lbpPol.pri,"on")' + + lbpPol = icurl('class', lbpol_api) + if lbpPol: + if ((tversion.newer_than("5.1(1h)") and tversion.older_than("5.2(8e)")) or + (tversion.major1 == "6" and tversion.older_than("6.0(3d)"))): + result = FAIL_O + data.append(["CSCwf05073", "Target Version susceptible to Defect"]) + + print_result(title, result, msg, headers, data, recommended_action=recommended_action, doc_url=doc_url) + return result + + if __name__ == "__main__": prints(' ==== %s%s, Script Version %s ====\n' % (ts, tz, SCRIPT_VERSION)) prints('!!!! Check https://github.com/datacenter/ACI-Pre-Upgrade-Validation-Script for Latest Release !!!!\n') @@ -3144,6 +3172,8 @@ def fabric_port_down_check(index, total_checks, **kwargs): sup_hwrev_check, sup_a_high_memory_check, vmm_active_uplinks_check, + fabric_dpp_check, + ] summary = {PASS: 0, FAIL_O: 0, FAIL_UF: 0, ERROR: 0, MANUAL: 0, NA: 0, 'TOTAL': len(checks)} for idx, check in enumerate(checks): diff --git a/docs/docs/validations.md b/docs/docs/validations.md index eb8d8d3..3632dfc 100644 --- a/docs/docs/validations.md +++ b/docs/docs/validations.md @@ -142,6 +142,7 @@ Items | Defect | This Script [Spine SUP HW Revision Check][d9] | CSCwb86706 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [SUP-A/A+ High Memory Usage][d10] | CSCwh39489 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [VMM Uplink Container with empty Actives][d11] | CSCvr96408 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: +[CoS 3 with Dynamic Packet Prioritization][d12] | CSCwf05073 | :white_check_mark: | :no_entry_sign: |:no_entry_sign: [d1]: #ep-announce-compatibility [d2]: #eventmgr-db-size @@ -154,6 +155,7 @@ Items | Defect | This Script [d9]: #spine-sup-hw-revision [d10]: #sup-aa-high-memory-usage [d11]: #vmm-uplink-container-with-empty-actives +[d12]: #cos-3-with-dynamic-packet-prioritization @@ -1604,7 +1606,15 @@ Due to the defect CSCwb86706, ACI modular spine switches may not be able to boot The script checks if the version and the SUP modules are susceptible to the defect. +### CoS 3 with Dynamic Packet Prioritization +Due to the defect CSCwf05073, ACI unexpectedly assigning a COS3 value to traffic egressing front ports. + +In certain cases, such as when frames goes through FCoE supported devices, these get classified into the no drop FCoE class. In FCoE devices, this can cause drop of packets when the packet length is higher than the allowed 2184 bytes. + +For example, on the UCS Fabric Interconnect COS3 value is hardcoded for fiber channel (FC) or fiber channel over ethernet (FCoE) traffic. FC/FCoE traffic is highly sensitive and is treated as non-droppable, and cannot exceed MTU of 2184 bytes long. + +This script checks if the target version is susceptible to CSCwf05073 and dynamic packet prioritization feature is set to "on". ### SUP-A/A+ High Memory Usage Due to the increased memory utilization from 6.0(3), N9K-SUP-A or N9K-SUP-A+ will likely experience constant high memory utilization. diff --git a/tests/fabric_dpp_check/lbpPol_NEG.json b/tests/fabric_dpp_check/lbpPol_NEG.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/tests/fabric_dpp_check/lbpPol_NEG.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/tests/fabric_dpp_check/lbpPol_POS.json b/tests/fabric_dpp_check/lbpPol_POS.json new file mode 100644 index 0000000..7d60c53 --- /dev/null +++ b/tests/fabric_dpp_check/lbpPol_POS.json @@ -0,0 +1,14 @@ +[ + { + "lbpPol": { + "attributes": { + "dlbMode": "off", + "dn": "uni/fabric/lbp-default", + "hashGtp": "no", + "mode": "traditional", + "name": "default", + "pri": "on" + } + } + } +] \ No newline at end of file diff --git a/tests/fabric_dpp_check/test_fabric_dpp_check.py b/tests/fabric_dpp_check/test_fabric_dpp_check.py new file mode 100644 index 0000000..9eacfb7 --- /dev/null +++ b/tests/fabric_dpp_check/test_fabric_dpp_check.py @@ -0,0 +1,69 @@ +import os +import pytest +import logging +import importlib +from helpers.utils import read_data + +script = importlib.import_module("aci-preupgrade-validation-script") + +log = logging.getLogger(__name__) +dir = os.path.dirname(os.path.abspath(__file__)) + + +# icurl queries +lbpPol = 'lbpPol.json' +lbpPol += '?query-target-filter=eq(lbpPol.pri,"on")' + +@pytest.mark.parametrize( + "icurl_outputs, tversion, expected_result", + [ + # DPP is on + ( + {lbpPol: read_data(dir, "lbpPol_POS.json")}, + "5.2(2h)", + script.FAIL_O, + ), + ( + {lbpPol: read_data(dir, "lbpPol_POS.json")}, + "5.2(8e)", + script.PASS, + ), + ( + {lbpPol: read_data(dir, "lbpPol_POS.json")}, + "6.0(2h)", + script.FAIL_O, + ), + ( + {lbpPol: read_data(dir, "lbpPol_POS.json")}, + "6.0(3d)", + script.PASS, + ), + # DPP is off + ( + {lbpPol: read_data(dir, "lbpPol_NEG.json")}, + "5.0(2h)", + script.PASS, + ), + ( + {lbpPol: read_data(dir, "lbpPol_NEG.json")}, + "5.2(8e)", + script.PASS, + ), + ( + {lbpPol: read_data(dir, "lbpPol_NEG.json")}, + "6.0(2h)", + script.PASS, + ), + ( + {lbpPol: read_data(dir, "lbpPol_NEG.json")}, + "6.0(3d)", + script.PASS, + ), + + ], +) +def test_logic(mock_icurl, tversion, expected_result): + result = script.fabric_dpp_check( + 1, 1, script.AciVersion(tversion) + ) + assert result == expected_result