-
Notifications
You must be signed in to change notification settings - Fork 48
Added validation for CSCwd40071 #332
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7954165
Merge pull request #1 from datacenter/master
sanjanch ca1602e
Added validation for CSCwd40071
sanjanch 72b856c
Modified the validations.md file
sanjanch b258668
Resolved merge conflicts
sanjanch ebedcf4
Addressed the comments
sanjanch f0bc106
Added cversion for the check
sanjanch f146ca0
Resolved the merge conflicts post changing the base branch to v4.1.0-dev
sanjanch d6b25f9
Removed empty spaces
sanjanch 290f291
logic change. removed 0.0.0.0/0 and made pytest changes
sanjanch 550df7d
logic modified and validation.md file updated
sanjanch 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
18 changes: 18 additions & 0 deletions
18
.../inband_management_policy_misconfig_check/mgmtRsInBStNode_invalid_addr_and_gw_config.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,18 @@ | ||
| [ | ||
| { | ||
| "mgmtRsInBStNode": { | ||
| "attributes": { | ||
| "tDn": "topology/pod-1/node-103", | ||
| "addr": "0.0.0.0", | ||
| "configurationMode": "static", | ||
| "dn": "uni/tn-mgmt/mgmtp-default/inb-inb/rsinBStNode-[topology/pod-1/node-103]", | ||
| "gw": "0.0.0.0", | ||
| "modTs": "2024-12-20T07:45:21.454+00:00", | ||
| "rType": "mo", | ||
| "rn": "rsinBStNode-[topology/pod-1/node-103]", | ||
| "stateQual": "none", | ||
| "tType": "mo" | ||
| } | ||
| } | ||
| } | ||
| ] |
18 changes: 18 additions & 0 deletions
18
...ecks/inband_management_policy_misconfig_check/mgmtRsInBStNode_invalid_address_config.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,18 @@ | ||
| [ | ||
| { | ||
| "mgmtRsInBStNode": { | ||
| "attributes": { | ||
| "tDn": "topology/pod-1/node-103", | ||
| "addr": "0.0.0.0", | ||
| "configurationMode": "static", | ||
| "dn": "uni/tn-mgmt/mgmtp-default/inb-inb/rsinBStNode-[topology/pod-1/node-103]", | ||
| "gw": "191.1.1.1", | ||
| "modTs": "2024-12-20T07:45:21.454+00:00", | ||
| "rType": "mo", | ||
| "rn": "rsinBStNode-[topology/pod-1/node-103]", | ||
| "stateQual": "none", | ||
| "tType": "mo" | ||
| } | ||
| } | ||
| } | ||
| ] |
18 changes: 18 additions & 0 deletions
18
...ecks/inband_management_policy_misconfig_check/mgmtRsInBStNode_invalid_gateway_config.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,18 @@ | ||
| [ | ||
| { | ||
| "mgmtRsInBStNode": { | ||
| "attributes": { | ||
| "tDn": "topology/pod-1/node-103", | ||
| "addr": "191.1.1.153/24", | ||
| "configurationMode": "static", | ||
| "dn": "uni/tn-mgmt/mgmtp-default/inb-inb/rsinBStNode-[topology/pod-1/node-103]", | ||
| "gw": "0.0.0.0", | ||
| "modTs": "2024-12-20T07:45:21.454+00:00", | ||
| "rType": "mo", | ||
| "rn": "rsinBStNode-[topology/pod-1/node-103]", | ||
| "stateQual": "none", | ||
| "tType": "mo" | ||
| } | ||
| } | ||
| } | ||
| ] |
1 change: 1 addition & 0 deletions
1
tests/checks/inband_management_policy_misconfig_check/mgmtRsInBStNode_valid_config.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 @@ | ||
| [] |
163 changes: 163 additions & 0 deletions
163
...inband_management_policy_misconfig_check/test_inband_management_policy_misconfig_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,163 @@ | ||
| 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 = "inband_management_policy_misconfig_check" | ||
| mgmtRsInBStNode = 'mgmtRsInBStNode.json?query-target-filter=or(eq(mgmtRsInBStNode.addr,"0.0.0.0"),eq(mgmtRsInBStNode.gw,"0.0.0.0"))' | ||
|
|
||
| @pytest.mark.parametrize( | ||
| "icurl_outputs, cversion, tversion, expected_result, expected_data", | ||
| [ | ||
| # Current version is affected, Target version = 6.0(4c), valid data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_valid_config.json") | ||
| }, | ||
| "5.2(7g)", | ||
| "6.0(4c)", | ||
| script.PASS, | ||
| [] | ||
| ), | ||
| # Current version is affected, Target version = 6.0(4c), invalid address | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_address_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(4c)", | ||
| script.FAIL_O, | ||
| [ | ||
| ["103", "0.0.0.0", "191.1.1.1"] | ||
| ] | ||
| ), | ||
| # Current version is affected, Target version = 6.0(4c), invalid gateway | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_gateway_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(4c)", | ||
| script.FAIL_O, | ||
| [ | ||
| ["103", "191.1.1.153/24", "0.0.0.0"], | ||
| ] | ||
| ), | ||
| # Current version is affected, Target version = 6.0(4c), invalid both data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(4c)", | ||
| script.FAIL_O, | ||
| [ | ||
| ["103", "0.0.0.0", "0.0.0.0"], | ||
| ] | ||
| ), | ||
| # Current version is affected, Target version > 6.0(4c), valid data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_valid_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(8f)", | ||
| script.PASS, | ||
| [] | ||
| ), | ||
| # Current version is affected, Target version > 6.0(4c), invalid address | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_address_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(5h)", | ||
| script.FAIL_O, | ||
| [ | ||
| ["103", "0.0.0.0", "191.1.1.1"], | ||
| ] | ||
| ), | ||
| # Current version is affected, Target version > 6.0(4c), invalid gateway | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_gateway_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(5j)", | ||
| script.FAIL_O, | ||
| [ | ||
| ["103", "191.1.1.153/24", "0.0.0.0"], | ||
| ] | ||
| ), | ||
| # Current version is affected, Target version > 6.0(4c), invalid both data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(6c)", | ||
| script.FAIL_O, | ||
| [ | ||
| ["103", "0.0.0.0", "0.0.0.0"], | ||
| ] | ||
| ), | ||
| # Current version is affected, Target version < 6.0(4c), invalid both data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(3g)", | ||
| script.NA, | ||
| [] | ||
| ), | ||
| # Current version is affected, Target version < 6.0(4c), valid both data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_valid_config.json"), | ||
| }, | ||
| "5.2(7f)", | ||
| "6.0(3g)", | ||
| script.NA, | ||
| [] | ||
| ), | ||
| # Current version is not affected, Target version = 6.0(4c), invalid both data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"), | ||
| }, | ||
| "5.3(2f)", | ||
| "6.0(4c)", | ||
| script.NA, | ||
| [] | ||
| ), | ||
| # Current version is not affected, Target version > 6.0(4c), invalid both data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"), | ||
| }, | ||
| "5.3(2f)", | ||
| "6.0(6c)", | ||
| script.NA, | ||
| [] | ||
| ), | ||
| # Current version is not affected, Target version < 6.0(4c), invalid both data | ||
| ( | ||
| { | ||
| mgmtRsInBStNode: read_data(dir, "mgmtRsInBStNode_invalid_addr_and_gw_config.json"), | ||
| }, | ||
| "5.3(2f)", | ||
| "6.0(3g)", | ||
| script.NA, | ||
| [] | ||
| ), | ||
| ], | ||
| ) | ||
| def test_logic(run_check, mock_icurl, cversion, tversion, expected_result, expected_data): | ||
| result = run_check(cversion=script.AciVersion(cversion), tversion=script.AciVersion(tversion)) | ||
| assert result.result == expected_result | ||
| assert result.data == expected_data |
Oops, something went wrong.
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.