-
Notifications
You must be signed in to change notification settings - Fork 784
Add hp comware display route policy #2293
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
ppetilli
wants to merge
9
commits into
networktocode:master
Choose a base branch
from
ppetilli:hp_comware_display_route-policy
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
9 commits
Select commit
Hold shift + click to select a range
b148cac
Create hp_comware_display_route-policy.textfsm
ppetilli 4872709
Update index
ppetilli 0d896fa
Add files via upload
ppetilli 3e6fab6
Add hp_comware route-policy template and corresponding test files
2c61ad6
corrected file names
5c1b3a6
corrected file names
485f172
corrected file content
cbaefd1
corrected index file
085ff0c
Add test case with multiple if-match and apply conditions for hp_comw…
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
15 changes: 15 additions & 0 deletions
15
ntc_templates/templates/hp_comware_display_route-policy.textfsm
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,15 @@ | ||
| Value Filldown POLICY_NAME (\S+) | ||
| Value Required ACTION (Permit|Deny) | ||
| Value Required NODE (\d+) | ||
| Value List IF_MATCH (.+) | ||
| Value List APPLY (.+) | ||
|
|
||
| Start | ||
| ^Route-policy:\s+ -> Continue.Record | ||
| ^Route-policy:\s+${POLICY_NAME}\s*$$ | ||
| ^\s+(Permit|Deny)\s+:\s+\d+ -> Continue.Record | ||
| ^\s+${ACTION}\s+:\s+${NODE}\s*$$ | ||
| ^\s+if-match\s+${IF_MATCH}\s*$$ | ||
| ^\s+apply\s+${APPLY}\s*$$ | ||
| ^\s*$$ -> Record | ||
| ^. -> Error |
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
15 changes: 15 additions & 0 deletions
15
tests/hp_comware/display_route-policy/hp_comware_display_route-policy.raw
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,15 @@ | ||
| Route-policy: ACTIVE_OUT | ||
| Permit : 10 | ||
| if-match ip address prefix-list pl_customer_only | ||
|
|
||
| Route-policy: BACKUP_ACT_OUT | ||
| Permit : 10 | ||
| if-match ip address prefix-list pl_customer_only | ||
| apply community 1111:135 | ||
| Deny : 99 | ||
|
|
||
| Route-policy: BACKUP_SBY_OUT | ||
| Permit : 10 | ||
| if-match ip address prefix-list pl_customer_only | ||
| apply community 1111:130 | ||
| Deny : 99 | ||
32 changes: 32 additions & 0 deletions
32
tests/hp_comware/display_route-policy/hp_comware_display_route-policy.yml
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,32 @@ | ||
| --- | ||
| parsed_sample: | ||
| - action: "Permit" | ||
| apply: [] | ||
| if_match: | ||
| - "ip address prefix-list pl_customer_only" | ||
| node: "10" | ||
| policy_name: "ACTIVE_OUT" | ||
| - action: "Permit" | ||
| apply: | ||
| - "community 1111:135" | ||
| if_match: | ||
| - "ip address prefix-list pl_customer_only" | ||
| node: "10" | ||
| policy_name: "BACKUP_ACT_OUT" | ||
| - action: "Deny" | ||
| apply: [] | ||
| if_match: [] | ||
| node: "99" | ||
| policy_name: "BACKUP_ACT_OUT" | ||
| - action: "Permit" | ||
| apply: | ||
| - "community 1111:130" | ||
| if_match: | ||
| - "ip address prefix-list pl_customer_only" | ||
| node: "10" | ||
| policy_name: "BACKUP_SBY_OUT" | ||
| - action: "Deny" | ||
| apply: [] | ||
| if_match: [] | ||
| node: "99" | ||
| policy_name: "BACKUP_SBY_OUT" |
10 changes: 10 additions & 0 deletions
10
tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.raw
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 @@ | ||
| Route-policy: active_out | ||
| Permit : 10 | ||
| if-match ip address prefix-list pl_customer_only | ||
|
|
||
| Route-policy: test_policy | ||
| Permit : 10 | ||
| if-match cost 10 | ||
| if-match ip address prefix-list pl_customer_only | ||
| apply community 1111:100 | ||
| apply local-preference 200 |
17 changes: 17 additions & 0 deletions
17
tests/hp_comware/display_route-policy/hp_comware_display_route-policy1.yml
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,17 @@ | ||
| --- | ||
| parsed_sample: | ||
| - action: "Permit" | ||
| apply: [] | ||
| if_match: | ||
| - "ip address prefix-list pl_customer_only" | ||
| node: "10" | ||
| policy_name: "active_out" | ||
| - action: "Permit" | ||
| apply: | ||
| - "community 1111:100" | ||
| - "local-preference 200" | ||
| if_match: | ||
| - "cost 10" | ||
| - "ip address prefix-list pl_customer_only" | ||
| node: "10" | ||
| policy_name: "test_policy" |
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.