-
Notifications
You must be signed in to change notification settings - Fork 45
Added pre-upgrade validation for N9K-C9408 with more than 6 N9K-X9400-16W LEM's for the bug CSCws82819 #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Harinadh-Saladi
wants to merge
16
commits into
datacenter:master
Choose a base branch
from
Harinadh-Saladi:CSCws82819-c9408-boot-loop-check
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
338af6c
Added a new check for the bug 'CSCws82819N9K-C9408 boot loop on 16.1.…
Harinadh-Saladi 1712888
Removed if conditio for model check and modified the recommended actions
Harinadh-Saladi ae38859
Updated recommended action message, method name and pytest file names
Harinadh-Saladi 7bc42c4
Updated pytest file names in python file
Harinadh-Saladi 6f82308
Updated the if condition for maintenance release,6.1(5e) and variable…
Harinadh-Saladi 1bea834
Addressed comments:recommended message,doc_url and rebased the code w…
Harinadh-Saladi 5390298
Updated bugs section with the checks post rebase
Harinadh-Saladi 49aabe5
Removed unwanted additional spaces
Harinadh-Saladi 31accd8
Removed duplicate check entries
Harinadh-Saladi 609d89f
Update aci-preupgrade-validation-script.py
Harinadh-Saladi 029e735
Update validations.md
Harinadh-Saladi f3f41ff
Updated validations.md file by removing unwanted space
Harinadh-Saladi fb8476b
Updated validations.md file
Harinadh-Saladi 2483b35
Updated validations.md
Harinadh-Saladi fb7b313
Updated aci-preupgrade-validation-script.py
Harinadh-Saladi ef1282f
Updated validations.md
Harinadh-Saladi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
tests/checks/n9k_c9408_model_lem_count_check/eqptLC_5_node.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [ | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-1/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-2/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-3/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-4/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-5/lc", "model": "N9K-X9400-16W"}}} | ||
| ] |
8 changes: 8 additions & 0 deletions
8
tests/checks/n9k_c9408_model_lem_count_check/eqptLC_6_node.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [ | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-1/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-2/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-3/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-4/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-5/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-6/lc", "model": "N9K-X9400-16W"}}} | ||
| ] |
58 changes: 58 additions & 0 deletions
58
tests/checks/n9k_c9408_model_lem_count_check/eqptLC_7_node.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| [ | ||
| { | ||
| "eqptLC": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/ch/lcslot-1/lc", | ||
| "model": "N9K-X9400-16W" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "eqptLC": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/ch/lcslot-2/lc", | ||
| "model": "N9K-X9400-16W" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "eqptLC": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/ch/lcslot-3/lc", | ||
| "model": "N9K-X9400-16W" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "eqptLC": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/ch/lcslot-4/lc", | ||
| "model": "N9K-X9400-16W" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "eqptLC": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/ch/lcslot-5/lc", | ||
| "model": "N9K-X9400-16W" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "eqptLC": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/ch/lcslot-6/lc", | ||
| "model": "N9K-X9400-16W" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "eqptLC": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/ch/lcslot-7/lc", | ||
| "model": "N9K-X9400-16W" | ||
| } | ||
| } | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [] |
15 changes: 15 additions & 0 deletions
15
tests/checks/n9k_c9408_model_lem_count_check/eqptLC_mixed.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [ | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-1/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-2/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-3/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-4/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-5/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-101/sys/ch/lcslot-6/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-102/sys/ch/lcslot-1/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-102/sys/ch/lcslot-2/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-102/sys/ch/lcslot-3/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-102/sys/ch/lcslot-4/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-102/sys/ch/lcslot-5/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-102/sys/ch/lcslot-6/lc", "model": "N9K-X9400-16W"}}}, | ||
| {"eqptLC": {"attributes": {"dn": "topology/pod-1/node-201/sys/ch/lcslot-1/lc", "model": "N9K-X9400-16W"}}} | ||
| ] |
26 changes: 26 additions & 0 deletions
26
tests/checks/n9k_c9408_model_lem_count_check/fabricNode_mixed.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [ | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "id": "101", | ||
| "model": "N9K-C9408" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "id": "102", | ||
| "model": "N9K-C9408" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "id": "201", | ||
| "model": "N9K-C93180YC-FX" | ||
| } | ||
| } | ||
| } | ||
| ] |
10 changes: 10 additions & 0 deletions
10
tests/checks/n9k_c9408_model_lem_count_check/fabricNode_n9k_c9408.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [ | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "id": "101", | ||
| "model": "N9K-C9408" | ||
| } | ||
| } | ||
| } | ||
| ] |
10 changes: 10 additions & 0 deletions
10
tests/checks/n9k_c9408_model_lem_count_check/fabricNode_no_n9k_c9408.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [ | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "id": "101", | ||
| "model": "N9K-C93180YC-FX" | ||
| } | ||
| } | ||
| } | ||
| ] |
136 changes: 136 additions & 0 deletions
136
tests/checks/n9k_c9408_model_lem_count_check/test_n9k_c9408_model_lem_count_check.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| 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 = "n9k_c9408_model_lem_count_check" | ||
|
|
||
| # icurl queries | ||
| eqptLC_api = 'eqptLC.json?query-target-filter=eq(eqptLC.model,"N9K-X9400-16W")' | ||
|
|
||
Harinadh-Saladi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "icurl_outputs, tversion, fabric_nodes, expected_result, expected_data, expected_msg", | ||
| [ | ||
| # Version not affected (lower than 6.1(2f)) | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_empty.json")}, | ||
| "6.1(2e)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.NA, | ||
| [], | ||
| script.VER_NOT_AFFECTED, | ||
| ), | ||
| # Version not affected (higher than 6.2(1g)) | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_empty.json")}, | ||
| "6.2(1h)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.NA, | ||
| [], | ||
| script.VER_NOT_AFFECTED, | ||
| ), | ||
| # Applicable version but no N9K-C9408 nodes found | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_6_node.json")}, | ||
| "6.1(2f)", | ||
| read_data(dir, "fabricNode_no_n9k_c9408.json"), | ||
| script.NA, | ||
| [], | ||
| "No N9K-C9408 nodes found. Skipping.", | ||
| ), | ||
| # Applicable version, C9408 exists, no LEM entries | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_empty.json")}, | ||
| "6.1(2f)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.PASS, | ||
| [], | ||
| "", | ||
| ), | ||
| # Applicable version, C9408 exists, with <=5 LEMs -> PASS | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_5_node.json")}, | ||
| "6.2(1g)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.PASS, | ||
| [], | ||
| "", | ||
| ), | ||
| # Applicable version with 6 LEMs -> FAIL_O | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_6_node.json")}, | ||
| "6.2(1g)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.FAIL_O, | ||
| [["101", "N9K-C9408", "N9K-X9400-16W", 6]], | ||
| "", | ||
| ), | ||
| # Applicable mid-train version 6.1(5e), less than 6 LEMs on C9408 -> PASS | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_5_node.json")}, | ||
| "6.1(5e)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.PASS, | ||
| [], | ||
| "", | ||
| ), | ||
| # Applicable mid-train version 6.1(5e), 6 LEMs on C9408 -> FAIL_O | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_6_node.json")}, | ||
| "6.1(5e)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.FAIL_O, | ||
| [["101", "N9K-C9408", "N9K-X9400-16W", 6]], | ||
| "", | ||
| ), | ||
| # Version not affected (fixed after 6.1(5e)) | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_6_node.json")}, | ||
| "6.1(5f)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.NA, | ||
| [], | ||
| script.VER_NOT_AFFECTED, | ||
| ), | ||
| # Applicable version, 6 LEMs on C9408 -> FAIL_O | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_6_node.json")}, | ||
| "6.1(2f)", | ||
| read_data(dir, "fabricNode_n9k_c9408.json"), | ||
| script.FAIL_O, | ||
| [["101", "N9K-C9408", "N9K-X9400-16W", 6]], | ||
| "", | ||
| ), | ||
| # Count only C9408 nodes and only matching LEM model | ||
| ( | ||
| {eqptLC_api: read_data(dir, "eqptLC_mixed.json")}, | ||
| "6.1(3a)", | ||
| read_data(dir, "fabricNode_mixed.json"), | ||
| script.FAIL_O, | ||
| [ | ||
| ["101", "N9K-C9408", "N9K-X9400-16W", 6], | ||
| ["102", "N9K-C9408", "N9K-X9400-16W", 6], | ||
| ], | ||
| "", | ||
| ), | ||
| ], | ||
| ) | ||
| def test_logic(run_check, mock_icurl, icurl_outputs, tversion, fabric_nodes, expected_result, expected_data, expected_msg): | ||
| result = run_check( | ||
| tversion=script.AciVersion(tversion), | ||
| fabric_nodes=fabric_nodes, | ||
| ) | ||
|
|
||
| assert result.result == expected_result | ||
| assert result.data == expected_data | ||
| assert result.msg == expected_msg | ||
|
|
||
| if expected_result == script.FAIL_O: | ||
| assert "boot loop" in result.recommended_action | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.