-
Notifications
You must be signed in to change notification settings - Fork 48
Add N9300 switch memory check #370
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
Priyanka-Patil14
wants to merge
23
commits into
datacenter:v4.2.0-dev
Choose a base branch
from
Priyanka-Patil14:feature/n9300-switch-memory-check
base: v4.2.0-dev
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
23 commits
Select commit
Hold shift + click to select a range
ced0e4a
Added N9300 switch memory check
Priyanka-Patil14 615b58e
Remove unrelated thread/prints changes from N9300 check PR
Priyanka-Patil14 4013a37
Addressed PR comments
Priyanka-Patil14 a357301
Addressed and updated n9300_switch_memory_check files
Priyanka-Patil14 d392bd7
Updated aci-preupgrade-validation-script.py script
Priyanka-Patil14 2f4c703
Add arg to define thread limit - to throttle concurrent API calls whe…
monrog2 c6a46d5
353 the script incorrectly detects vpc and port channel interfaces as…
monrog2 45bcaac
print cleanup
monrog2 8f49c44
Moved N9300 memory check to general checks section
Priyanka-Patil14 d9ee712
Updated N9300 memory check and threshold to 32GB
Priyanka-Patil14 26f397f
Fixed N9300 memory threshold to decimal 32GB
Priyanka-Patil14 5a60335
Added manual check when nodes fail and others have missing memory data
Priyanka-Patil14 ee2cd8d
Cleared recommended_action for ERROR results
Priyanka-Patil14 83db0bb
Updated memory check result to MANUAL
Priyanka-Patil14 20ceb84
refactored parse errors to unformatted_data
Priyanka-Patil14 61651e4
Addressed PR comments
Priyanka-Patil14 d7d4289
Remove old n9300_switch_memory_24g_check test files
Priyanka-Patil14 db4dd05
Updated check for fabricNode attributes
Priyanka-Patil14 a5ed4ce
Addressed PR comments in validations.md
Priyanka-Patil14 ea26774
Addressed PR comments
Priyanka-Patil14 2aa34bf
Addressed the PR comments
Priyanka-Patil14 3f0bd8c
Addressed PR Comments
Priyanka-Patil14 c275070
Updated the files
Priyanka-Patil14 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
13 changes: 13 additions & 0 deletions
13
tests/checks/n9k_c93180yc_fx3_switch_memory_check/fabricNode_N9K-C9508.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,13 @@ | ||
| [ | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-201", | ||
| "id": "201", | ||
| "name": "leaf201", | ||
| "model": "N9K-C9508", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
13 changes: 13 additions & 0 deletions
13
tests/checks/n9k_c93180yc_fx3_switch_memory_check/fabricNode_one.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,13 @@ | ||
| [ | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101", | ||
| "id": "101", | ||
| "name": "leaf101", | ||
| "model": "N9K-C93180YC-FX3", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| } | ||
| ] |
24 changes: 24 additions & 0 deletions
24
tests/checks/n9k_c93180yc_fx3_switch_memory_check/fabricNode_two.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,24 @@ | ||
| [ | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101", | ||
| "id": "101", | ||
| "name": "leaf101", | ||
| "model": "N9K-C93180YC-FX3", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-102", | ||
| "id": "102", | ||
| "name": "leaf102", | ||
| "model": "N9K-C9364C", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| } | ||
| ] |
24 changes: 24 additions & 0 deletions
24
tests/checks/n9k_c93180yc_fx3_switch_memory_check/fabricNode_two_fx3.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,24 @@ | ||
| [ | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101", | ||
| "id": "101", | ||
| "name": "leaf101", | ||
| "model": "N9K-C93180YC-FX3", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-102", | ||
| "id": "102", | ||
| "name": "leaf102", | ||
| "model": "N9K-C93180YC-FX3", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| } | ||
| ] |
20 changes: 20 additions & 0 deletions
20
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_all_gt32gb.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,20 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "32676092" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-102/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "32676092" | ||
| } | ||
| } | ||
| } | ||
| ] |
11 changes: 11 additions & 0 deletions
11
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_fail_and_missing.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,11 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "16000000" | ||
| } | ||
| } | ||
| } | ||
| ] |
11 changes: 11 additions & 0 deletions
11
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_gt32gb.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,11 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "32676092" | ||
| } | ||
| } | ||
| } | ||
| ] |
11 changes: 11 additions & 0 deletions
11
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_invalid_total.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,11 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "unknown" | ||
| } | ||
| } | ||
| } | ||
| ] |
11 changes: 11 additions & 0 deletions
11
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_lt32gb.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,11 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "16000000" | ||
| } | ||
| } | ||
| } | ||
| ] |
11 changes: 11 additions & 0 deletions
11
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_missing_affected_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,11 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-201/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "32676092" | ||
| } | ||
| } | ||
| } | ||
| ] |
20 changes: 20 additions & 0 deletions
20
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_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,20 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-101/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "32676092" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-102/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "22535444" | ||
| } | ||
| } | ||
| } | ||
| ] |
11 changes: 11 additions & 0 deletions
11
tests/checks/n9k_c93180yc_fx3_switch_memory_check/procMemUsage_node201_gt32gb.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,11 @@ | ||
| [ | ||
| { | ||
| "procMemUsage": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-201/sys/procmem/memusage-sup", | ||
| "Modname": "sup", | ||
| "Total": "32676092" | ||
| } | ||
| } | ||
| } | ||
| ] |
82 changes: 82 additions & 0 deletions
82
.../checks/n9k_c93180yc_fx3_switch_memory_check/test_n9k_c93180yc_fx3_switch_memory_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,82 @@ | ||
| 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_c93180yc_fx3_switch_memory_check" | ||
|
|
||
| # icurl queries - filtered by affected node IDs and memory threshold | ||
| proc_mem_query_node101 = 'procMemUsage.json?query-target-filter=and(or(wcard(procMemUsage.dn,"node-101/")),wcard(procMemUsage.dn,"memusage-sup"),lt(procMemUsage.Total,"32000000"))' | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
|
Priyanka-Patil14 marked this conversation as resolved.
|
||
| "fabric_nodes, icurl_outputs, expected_result, expected_msg, expected_data", | ||
| [ | ||
| # No nodes returned | ||
| ( | ||
| [], | ||
| {}, | ||
| script.NA, | ||
| 'No N9K-C93180YC-FX3 switches found. Skipping.', | ||
| [], | ||
| ), | ||
| # Non-N9K-C93180YC-FX3 node (N9K-C9508) | ||
| ( | ||
| read_data(dir, "fabricNode_N9K-C9508.json"), | ||
| {}, | ||
| script.NA, | ||
| 'No N9K-C93180YC-FX3 switches found. Skipping.', | ||
| [], | ||
| ), | ||
| # N9K-C93180YC-FX3 node with >=32GB memory - API returns empty (filtered by lt) | ||
| ( | ||
| read_data(dir, "fabricNode_one.json"), | ||
| { | ||
| proc_mem_query_node101: [], | ||
| }, | ||
| script.PASS, | ||
| '', | ||
| [], | ||
| ), | ||
| # Multiple nodes, only N9K-C93180YC-FX3 checked, all >=32GB - API returns empty | ||
| ( | ||
| read_data(dir, "fabricNode_two.json"), | ||
| { | ||
| proc_mem_query_node101: [], | ||
| }, | ||
| script.PASS, | ||
| '', | ||
| [], | ||
| ), | ||
| # N9K-C93180YC-FX3 node with <32GB memory (fail case) | ||
| ( | ||
| read_data(dir, "fabricNode_one.json"), | ||
| { | ||
| proc_mem_query_node101: read_data(dir, "procMemUsage_lt32gb.json"), | ||
| }, | ||
| script.MANUAL, | ||
| ( | ||
| 'N9K-C93180YC-FX3 requires a minimum of 32GB RAM for proper operation in ACI mode. ' | ||
| 'One or more switches with less than 32GB of memory may experience service instability. ' | ||
| 'Upgrade the switch memory to at least 32GB.' | ||
| ), | ||
| [["101", "leaf101", "N9K-C93180YC-FX3", 16.0]], | ||
| ), | ||
| ], | ||
| ) | ||
| def test_logic(run_check, mock_icurl, fabric_nodes, expected_result, expected_msg, expected_data): | ||
| result = run_check( | ||
| fabric_nodes=fabric_nodes, | ||
| ) | ||
| assert result.result == expected_result | ||
| assert result.msg == expected_msg | ||
| if result.data: | ||
| assert result.data == expected_data | ||
| else: | ||
| assert result.unformatted_data == expected_data | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please match the file name also with model and not general 9300..
every statement, filename should have proper name for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.