-
Notifications
You must be signed in to change notification settings - Fork 44
Added validation for CSCws84232 #334
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
veenaskumar-cisco
wants to merge
10
commits into
datacenter:master
Choose a base branch
from
veenaskumar-cisco:CSCws84232
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
10 commits
Select commit
Hold shift + click to select a range
45c68da
Feat:added svccoreCtrlr excessive entries check
veenaskumar-cisco c57efb2
updated the formated json in svccore_negative.json
veenaskumar-cisco d5695bc
Removed other PR checks
veenaskumar-cisco 420e816
Fix: svccoreNode mo check is updated
veenaskumar-cisco 1f874ea
Fix:update the threshold to 240
veenaskumar-cisco b244587
refactor:moved to general check
veenaskumar-cisco 4f5ff88
refactor:updated recommended action
veenaskumar-cisco 32289d3
refactor:optimise the check for get the count alone
veenaskumar-cisco f3f430b
refactor:added try catch exception for error handling
veenaskumar-cisco bfa13cd
update the threshold value for 240
veenaskumar-cisco 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
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
12 changes: 12 additions & 0 deletions
12
tests/checks/svccore_excessive_class_entries_check/svccoreNode_negative.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,12 @@ | ||
| [ | ||
| { | ||
| "moCount": { | ||
| "attributes": { | ||
| "childAction": "", | ||
| "count": "32000", | ||
| "dn": "", | ||
| "status": "" | ||
| } | ||
| } | ||
| } | ||
| ] |
12 changes: 12 additions & 0 deletions
12
tests/checks/svccore_excessive_class_entries_check/svccoreNode_positive.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,12 @@ | ||
| [ | ||
| { | ||
| "moCount": { | ||
| "attributes": { | ||
| "childAction": "", | ||
| "count": "3", | ||
| "dn": "", | ||
| "status": "" | ||
| } | ||
| } | ||
| } | ||
| ] |
56 changes: 56 additions & 0 deletions
56
tests/checks/svccore_excessive_class_entries_check/svccore_excessive_class_entries_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,56 @@ | ||
| 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 = "svccore_excessive_data_check" | ||
|
|
||
| # icurl queries | ||
| svccoreClassEntry = 'svccoreCtrlr.json?&rsp-subtree-include=count' | ||
| svccoreNodeEntry = 'svccoreNode.json?&rsp-subtree-include=count' | ||
|
|
||
| @pytest.mark.parametrize( | ||
| "icurl_outputs, expected_result", | ||
| [ | ||
| # No excessive class entries | ||
| ( | ||
| { | ||
| svccoreClassEntry: read_data(dir, "svccore_positive.json"), | ||
| svccoreNodeEntry: read_data(dir, "svccoreNode_positive.json") | ||
| }, | ||
| script.PASS, | ||
| ), | ||
| # Excessive class entries found | ||
| ( | ||
| { | ||
| svccoreClassEntry: read_data(dir, "svccore_negative.json"), | ||
| svccoreNodeEntry: read_data(dir, "svccoreNode_positive.json") | ||
| }, | ||
| script.MANUAL, | ||
| ), | ||
| ( | ||
| { | ||
| svccoreClassEntry: read_data(dir, "svccoreNode_negative.json"), | ||
| svccoreNodeEntry: read_data(dir, "svccoreNode_negative.json") | ||
| }, | ||
| script.MANUAL, | ||
| ), | ||
| ( | ||
| { | ||
| svccoreClassEntry: read_data(dir, "svccore_positive.json"), | ||
| svccoreNodeEntry: read_data(dir, "svccoreNode_negative.json") | ||
| }, | ||
| script.MANUAL, | ||
| ) | ||
| ], | ||
| ) | ||
|
|
||
| def test_logic(run_check,mock_icurl,expected_result): | ||
| result = run_check() | ||
| assert result.result == expected_result | ||
|
|
||
12 changes: 12 additions & 0 deletions
12
tests/checks/svccore_excessive_class_entries_check/svccore_negative.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,12 @@ | ||
| [ | ||
| { | ||
| "moCount": { | ||
| "attributes": { | ||
| "childAction": "", | ||
| "count": "500", | ||
| "dn": "", | ||
| "status": "" | ||
| } | ||
| } | ||
| } | ||
| ] |
12 changes: 12 additions & 0 deletions
12
tests/checks/svccore_excessive_class_entries_check/svccore_positive.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,12 @@ | ||
| [ | ||
| { | ||
| "moCount": { | ||
| "attributes": { | ||
| "childAction": "", | ||
| "count": "3", | ||
| "dn": "", | ||
| "status": "" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
veenaskumar-cisco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.