Skip to content

Commit

Permalink
welkin-issue-79 (#82)
Browse files Browse the repository at this point in the history
* Rebase welkin-issue-79 on master

* Apply suggestions from code review

* Add version, Use fabricNode, Add pytest

---------

Co-authored-by: takishida <38262981+takishida@users.noreply.github.com>
Co-authored-by: tkishida <tkishida@cisco.com>
  • Loading branch information
3 people authored May 8, 2024
1 parent 766ff1f commit 4271899
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 3 deletions.
38 changes: 37 additions & 1 deletion aci-preupgrade-validation-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3160,6 +3160,42 @@ def fabric_dpp_check(index, total_checks, tversion, **kwargs):
return result


def n9k_c93108tc_fx3p_interface_down_check(index, total_checks, tversion, **kwargs):
title = 'N9K-C93108TC-FX3P/FX3H Interface Down'
result = PASS
msg = ''
headers = ["Node ID", "Node Name", "Product ID"]
data = []
recommended_action = 'Change the target version to the fixed version of CSCwh81430'
doc_url = 'https://www.cisco.com/c/en/us/support/docs/field-notices/740/fn74085.html'
print_title(title, index, total_checks)

if not tversion:
print_result(title, MANUAL, "Target version not supplied. Skipping.")
return MANUAL

if (
tversion.older_than("5.2(8h)")
or tversion.same_as("5.3(1d)")
or (tversion.major1 == "6" and tversion.older_than("6.0(4a)"))
):
api = 'fabricNode.json'
api += '?query-target-filter=or('
api += 'eq(fabricNode.model,"N9K-C93108TC-FX3P"),'
api += 'eq(fabricNode.model,"N9K-C93108TC-FX3H"))'
nodes = icurl('class', api)
for node in nodes:
nodeid = node["fabricNode"]["attributes"]["id"]
name = node["fabricNode"]["attributes"]["name"]
pid = node["fabricNode"]["attributes"]["model"]
data.append([nodeid, name, pid])

if data:
result = FAIL_O
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')
Expand Down Expand Up @@ -3250,7 +3286,7 @@ def fabric_dpp_check(index, total_checks, tversion, **kwargs):
sup_a_high_memory_check,
vmm_active_uplinks_check,
fabric_dpp_check,

n9k_c93108tc_fx3p_interface_down_check,
]
summary = {PASS: 0, FAIL_O: 0, FAIL_UF: 0, ERROR: 0, MANUAL: 0, POST: 0, NA: 0, 'TOTAL': len(checks)}
for idx, check in enumerate(checks):
Expand Down
19 changes: 17 additions & 2 deletions docs/docs/validations.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ 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:
[CoS 3 with Dynamic Packet Prioritization][d12] | CSCwf05073 | :white_check_mark: | :no_entry_sign: |:no_entry_sign:
[N9K-C93108TC-FX3P/FX3H Interface Down][d13] | CSCwh81430 | :white_check_mark: | :no_entry_sign: |:no_entry_sign:

[d1]: #ep-announce-compatibility
[d2]: #eventmgr-db-size
Expand All @@ -159,7 +160,7 @@ Items | Defect | This Script
[d10]: #sup-aa-high-memory-usage
[d11]: #vmm-uplink-container-with-empty-actives
[d12]: #cos-3-with-dynamic-packet-prioritization

[d13]: #n9k-c93108tc-fx3pfx3h-interface-down


## General Check Details
Expand Down Expand Up @@ -1712,6 +1713,19 @@ The example shows a correctly defined `fvUplinkOrderCont`, with uplinks under th
userdom : :all:common:
```


### N9K-C93108TC-FX3P/FX3H Interface Down

Due to the defect CSCwh81430, some RJ45 interfaces on Cisco Nexus N9K-C93108TC-FX3P and N9K-C93108TC-FX3H Switches might not come up, even when connected.

This issue can be triggered by a switch reload that occurs for any reason, including a software upgrade, software reset, system crash, or the power being turned up or down.

The problem is related only to the front-panel interfaces Ethernet 1/1- 1/48. Optical ports Ethernet 1/49 - 54 and MGMT0 port are not affected.

Because of this, the target version of your upgrade must be a version with a fix of CSCwh81430 when your fabric includes those switches mentioned above. See the Field Notice [FN74085][20] for details.



[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
Expand All @@ -1732,3 +1746,4 @@ The example shows a correctly defined `fvUplinkOrderCont`, with uplinks under th
[17]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/6x/release-notes/cisco-apic-release-notes-605.html
[18]: https://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/kb/cisco-mini-aci-fabric.html#Cisco_Task_in_List_GUI.dita_2d9ca023-714c-4341-9112-d96a7a598ee6
[19]: https://www.cisco.com/c/en/us/td/docs/dcn/aci/apic/5x/security-configuration/cisco-apic-security-configuration-guide-release-52x/https-access-52x.html
[20]: https://www.cisco.com/c/en/us/support/docs/field-notices/740/fn74085.html
26 changes: 26 additions & 0 deletions tests/n9k_c93108tc_fx3p_interface_down_check/fabricNode_FX3H.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-2/node-113",
"fabricSt": "active",
"id": "113",
"model": "N9K-C93108TC-FX3H",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf113"
}
}
},
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-2/node-114",
"fabricSt": "active",
"id": "114",
"model": "N9K-C93108TC-FX3H",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf114"
}
}
}
]
26 changes: 26 additions & 0 deletions tests/n9k_c93108tc_fx3p_interface_down_check/fabricNode_FX3P.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-102",
"fabricSt": "active",
"id": "101",
"model": "N9K-C93108TC-FX3P",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf101"
}
}
},
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-102",
"fabricSt": "active",
"id": "102",
"model": "N9K-C93108TC-FX3P",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf102"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-102",
"fabricSt": "active",
"id": "101",
"model": "N9K-C93108TC-FX3P",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf101"
}
}
},
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-1/node-102",
"fabricSt": "active",
"id": "102",
"model": "N9K-C93108TC-FX3P",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf102"
}
}
},
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-2/node-113",
"fabricSt": "active",
"id": "113",
"model": "N9K-C93108TC-FX3H",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf113"
}
}
},
{
"fabricNode": {
"attributes": {
"dn": "topology/pod-2/node-114",
"fabricSt": "active",
"id": "114",
"model": "N9K-C93108TC-FX3H",
"monPolDn": "uni/fabric/monfab-default",
"name": "leaf114"
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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
api = 'fabricNode.json?query-target-filter=or(eq(fabricNode.model,"N9K-C93108TC-FX3P"),eq(fabricNode.model,"N9K-C93108TC-FX3H"))'


@pytest.mark.parametrize(
"icurl_outputs, tversion, expected_result",
[
# Version not supplied
({api: []}, None, script.MANUAL),
# Version not affected
({api: read_data(dir, "fabricNode_FX3P3H.json")}, "5.2(8h)", script.PASS),
({api: read_data(dir, "fabricNode_FX3P3H.json")}, "5.3(2b)", script.PASS),
({api: read_data(dir, "fabricNode_FX3P3H.json")}, "6.0(4c)", script.PASS),
# Affected version, no FX3P or FX3H
({api: []}, "5.2(8g)", script.PASS),
({api: []}, "5.3(1d)", script.PASS),
({api: []}, "6.0(2h)", script.PASS),
# Affected version, FX3P
({api: read_data(dir, "fabricNode_FX3P.json")}, "5.2(8g)", script.FAIL_O),
({api: read_data(dir, "fabricNode_FX3P.json")}, "5.3(1d)", script.FAIL_O),
({api: read_data(dir, "fabricNode_FX3P.json")}, "6.0(2h)", script.FAIL_O),
# Affected version, FX3H
({api: read_data(dir, "fabricNode_FX3H.json")}, "5.2(8g)", script.FAIL_O),
({api: read_data(dir, "fabricNode_FX3H.json")}, "5.3(1d)", script.FAIL_O),
({api: read_data(dir, "fabricNode_FX3H.json")}, "6.0(2h)", script.FAIL_O),
# Affected version, FX3P and FX3H
({api: read_data(dir, "fabricNode_FX3P3H.json")}, "5.2(8g)", script.FAIL_O),
({api: read_data(dir, "fabricNode_FX3P3H.json")}, "5.3(1d)", script.FAIL_O),
({api: read_data(dir, "fabricNode_FX3P3H.json")}, "6.0(2h)", script.FAIL_O),
],
)
def test_logic(mock_icurl, tversion, expected_result):
result = script.n9k_c93108tc_fx3p_interface_down_check(
1,
1,
script.AciVersion(tversion) if tversion else None,
)
assert result == expected_result

0 comments on commit 4271899

Please sign in to comment.