-
Notifications
You must be signed in to change notification settings - Fork 48
Check for F0467 bgpProt-policy-already-existing. CSCwt78235 #373
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
dhaselva
wants to merge
8
commits into
datacenter:v4.1.0-dev
Choose a base branch
from
dhaselva:dhaselva/F0467
base: v4.1.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 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
20b5eee
Check for F0467 bgpProt-policy-already-existing
dhaselva 4e4a120
Incorporated the review comments
dhaselva b2dfa64
Addressed review comments
dhaselva 5815d26
Added version check instead of generic check
dhaselva b8ca9d5
Modified the target version check
dhaselva fdd9a28
pulled dev branch
dhaselva ea73e9b
Removed whitepsaces
dhaselva d41ad25
Modified the content in validation file
dhaselva 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
1 change: 1 addition & 0 deletions
1
tests/checks/bgp_timer_policy_already_existing_check/faultDelegate_NEG.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 changes: 20 additions & 0 deletions
20
tests/checks/bgp_timer_policy_already_existing_check/faultDelegate_POS.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 @@ | ||
| [ | ||
| { | ||
| "faultDelegate": { | ||
| "attributes": { | ||
| "affected": "resPolCont/rtdOutCont/rtdOutDef-[uni/tn-common/out-L3outY]/nwissues", | ||
| "code": "F0467", | ||
| "changeSet": "configQual:bgpProt-policy-already-existing, configSt:failed-to-apply, temporaryError:no" | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "faultDelegate": { | ||
| "attributes": { | ||
| "affected": "resPolCont/rtdOutCont/rtdOutDef-[uni/tn-prod/out-L3outA]/nwissues", | ||
| "code": "F0467", | ||
| "changeSet": "configQual:bgpProt-policy-already-existing, configSt:failed-to-apply, temporaryError:no" | ||
| } | ||
| } | ||
| } | ||
| ] |
11 changes: 11 additions & 0 deletions
11
tests/checks/bgp_timer_policy_already_existing_check/faultDelegate_UNFORMATTED.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 @@ | ||
| [ | ||
| { | ||
| "faultDelegate": { | ||
| "attributes": { | ||
| "affected": "resPolCont/rtdOutCont/rtdOutDef-[uni/invalid]/nwissues", | ||
| "code": "F0467", | ||
| "changeSet": "configQual:bgpProt-policy-already-existing, configSt:failed-to-apply, temporaryError:no" | ||
| } | ||
| } | ||
| } | ||
| ] |
60 changes: 60 additions & 0 deletions
60
...s/bgp_timer_policy_already_existing_check/test_bgp_timer_policy_already_existing_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,60 @@ | ||
| 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 = "bgpProto_timer_policy_already_existing_check" | ||
| # icurl queries | ||
| faultDelegates = 'faultDelegate.json?query-target-filter=and(eq(faultDelegate.code,"F0467"),wcard(faultDelegate.changeSet,"bgpProt-policy-already-existing"))' | ||
|
|
||
| @pytest.mark.parametrize( | ||
| "icurl_outputs, expected_result, expected_data, expected_unformatted_data", | ||
| [ | ||
| ( | ||
| {faultDelegates: read_data(dir, "faultDelegate_POS.json")}, | ||
| script.FAIL_O, | ||
| [ | ||
| [ | ||
| "F0467", | ||
| "common", | ||
| "L3outY", | ||
| "configQual:bgpProt-policy-already-existing, configSt:failed-to-apply, temporaryError:no", | ||
| ], | ||
| [ | ||
| "F0467", | ||
| "prod", | ||
| "L3outA", | ||
| "configQual:bgpProt-policy-already-existing, configSt:failed-to-apply, temporaryError:no", | ||
| ], | ||
| ], | ||
| [], | ||
| ), | ||
| ( | ||
| {faultDelegates: read_data(dir, "faultDelegate_UNFORMATTED.json")}, | ||
| script.FAIL_O, | ||
| [], | ||
| [ | ||
| [ | ||
| "F0467", | ||
| "resPolCont/rtdOutCont/rtdOutDef-[uni/invalid]/nwissues", | ||
| "configQual:bgpProt-policy-already-existing, configSt:failed-to-apply, temporaryError:no", | ||
| ], | ||
| ], | ||
| ), | ||
| ( | ||
| {faultDelegates: read_data(dir, "faultDelegate_NEG.json")}, | ||
| script.PASS, | ||
| [], | ||
| [], | ||
| ), | ||
| ], | ||
| ) | ||
| def test_logic(run_check, mock_icurl, expected_result, expected_data, expected_unformatted_data): | ||
| result = run_check() | ||
| assert result.result == expected_result | ||
| assert result.data == expected_data | ||
| assert result.unformatted_data == expected_unformatted_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.