-
Notifications
You must be signed in to change notification settings - Fork 41
New validation for CFD CSCwn81692 #298
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
muthu-ku
wants to merge
10
commits into
datacenter:master
Choose a base branch
from
muthu-ku:muthuku-CSCwn81692
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
63f5859
Added new CFD validation for CSCwn81692
muthu-ku 5e69a53
updated validation.md documentation for the cfd
muthu-ku def0ceb
addressed syntax/spacing comments
muthu-ku 32b04af
updated code with latest approach to get fabric_nodes
muthu-ku 86f1744
Merge branch 'master' into muthuku-CSCwn81692
muthu-ku 7915a42
merged latest changes
muthu-ku 5c7f6f5
Merge branch 'muthuku-CSCwn81692' of github.com:muthu-ku/ACI-Pre-Upgr…
muthu-ku 5c6be01
Merge branch 'datacenter:master' into muthuku-CSCwn81692
muthu-ku 09869b7
removed unwanted new lines
muthu-ku 6459c37
remove white spaces
muthu-ku 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
24 changes: 24 additions & 0 deletions
24
tests/checks/active_node_presListener_mo_object_check/fabricNode.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-104", | ||
| "fabricSt": "active", | ||
| "id": "104", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "fabricNode": { | ||
| "attributes": { | ||
| "dn": "topology/pod-1/node-105", | ||
| "fabricSt": "active", | ||
| "id": "105", | ||
| "role": "leaf" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| ] |
1 change: 1 addition & 0 deletions
1
tests/checks/active_node_presListener_mo_object_check/fabricNode_empty.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 @@ | ||
| [] |
21 changes: 21 additions & 0 deletions
21
tests/checks/active_node_presListener_mo_object_check/presListener.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,21 @@ | ||
| [ | ||
| { | ||
| "presListener": { | ||
| "attributes": { | ||
| "childAction": "", | ||
| "dn": "resregistry/resregistry-20/relnholder/rspresClass-[resregistry/resregistry-20/class-4307]/list-[uni/infra/nodecfgcont/node-104]", | ||
| "lstDn": "uni/infra/nodecfgcont/node-104" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "presListener": { | ||
| "attributes": { | ||
| "dn": "resregistry/resregistry-20/relnholder/rspresClass-[resregistry/resregistry-20/class-4307]/list-[uni/infra/nodecfgcont/node-105]", | ||
| "lstDn": "uni/infra/nodecfgcont/node-105" | ||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
| ] |
1 change: 1 addition & 0 deletions
1
tests/checks/active_node_presListener_mo_object_check/presListener_empty.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 changes: 10 additions & 0 deletions
10
tests/checks/active_node_presListener_mo_object_check/presListener_missing_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,10 @@ | ||
| [ | ||
| { | ||
| "presListener": { | ||
| "attributes": { | ||
| "dn": "resregistry/resregistry-20/relnholder/rspresClass-[resregistry/resregistry-20/class-4307]/list-[uni/infra/nodecfgcont/node-104]", | ||
| "lstDn": "uni/infra/nodecfgcont/node-104" | ||
| } | ||
| } | ||
| } | ||
| ] |
103 changes: 103 additions & 0 deletions
103
...active_node_presListener_mo_object_check/test_active_node_presListener_mo_object_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,103 @@ | ||
| 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 = "active_node_presListener_mo_object_check" | ||
|
|
||
| # icurl queries | ||
| presListener = 'presListener.json?query-target-filter=wcard(presListener.dn,"4307")' | ||
| fabricNode = 'fabricNode.json?query-target-filter=and(wcard(fabricNode.role,"leaf"),wcard(fabricNode.fabricSt,"active"))' | ||
|
|
||
| @pytest.mark.parametrize( | ||
| "icurl_outputs, tversion,fabric_nodes,expected_result", | ||
| [ | ||
| #CASE 1: Check pass case with all nodes present | ||
| ( | ||
| { | ||
| presListener: read_data( | ||
| dir, "presListener.json" | ||
| ) | ||
| }, | ||
| "6.1(2f)", | ||
| read_data( | ||
| dir, "fabricNode.json" | ||
| ), | ||
| script.PASS, | ||
| ), | ||
| #CASE 2: Check with missing nodes in presListener mo | ||
| ( | ||
| { | ||
| presListener: read_data( | ||
| dir, "presListener_missing_node.json" | ||
| ) | ||
| }, | ||
| "6.1(2f)", | ||
| read_data( | ||
| dir, "fabricNode.json" | ||
| ), | ||
| script.FAIL_O | ||
| ), | ||
| #CASE 3: Check with missing nodes in presListener mo on affected version | ||
| ( | ||
| { | ||
| presListener: read_data( | ||
| dir, "presListener_missing_node.json" | ||
| ) | ||
| }, | ||
| "5.2(8h)", | ||
| read_data( | ||
| dir, "fabricNode.json" | ||
| ), | ||
| script.FAIL_O, | ||
| ), | ||
| #CASE 4: Check with empty responses of fabric node and presListener mo for latest version | ||
| ( | ||
| { | ||
| presListener: read_data( | ||
| dir, "presListener_empty.json" | ||
| ) | ||
| }, | ||
| "6.1(3h)", | ||
| read_data( | ||
| dir, "fabricNode_empty.json" | ||
| ), | ||
| script.NA, | ||
| ), | ||
| #CASE 5: Check with empty responses of fabric node and presListener mo for affected version | ||
| ( | ||
| { | ||
| presListener: read_data( | ||
| dir, "presListener_empty.json" | ||
| ), | ||
| }, | ||
| "5.2(8h)", | ||
| read_data( | ||
| dir, "fabricNode_empty.json" | ||
| ), | ||
| script.FAIL_UF, | ||
| ), | ||
| #CASE 6: tversion not given | ||
| ( | ||
| { | ||
| presListener: read_data( | ||
| dir, "presListener_missing_node.json" | ||
| ) | ||
| }, | ||
| None, | ||
| read_data( | ||
| dir, "fabricNode.json" | ||
| ), | ||
| script.MANUAL, | ||
| ), | ||
| ], | ||
| ) | ||
| def test_logic(run_check,mock_icurl, tversion,fabric_nodes, expected_result): | ||
| result = run_check(tversion=script.AciVersion(tversion) if tversion else None, fabric_nodes=fabric_nodes) | ||
| assert result.result == expected_result |
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.