forked from networktocode/ntc-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new_template: cisco_nxos_show_route-map
- Loading branch information
1 parent
b160158
commit bcf6dfa
Showing
4 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,31 @@ | ||
Value Required NAME (\S+) | ||
Value Required ACTION (\S+) | ||
Value Required SEQ (\d+) | ||
Value List MATCH_CLAUSES (.+?) | ||
Value List SET_CLAUSES (.+?) | ||
|
||
Start | ||
^route-map\s+${NAME},\s+${ACTION},\s+sequence\s+${SEQ}\s*$$ | ||
^\s+Match\s+clauses -> Match | ||
^\s+Set\s+clauses -> Set | ||
^\s*$$ | ||
^. -> Error | ||
|
||
Match | ||
^\s*$$ | ||
^\s+Set\s+clauses -> Set | ||
^\s+Policy\s+routing | ||
^\s+${MATCH_CLAUSES}\s*$$ | ||
^route-map -> Continue.Record | ||
^route-map\s+${NAME},\s+${ACTION},\s+sequence\s+${SEQ}\s*$$ -> Start | ||
^\s*$$ | ||
^. -> Error | ||
|
||
Set | ||
^\s*$$ | ||
^\s+Policy\s+routing | ||
^\s+${SET_CLAUSES}\s*$$ | ||
^route-map -> Continue.Record | ||
^route-map\s+${NAME},\s+${ACTION},\s+sequence\s+${SEQ}\s*$$ -> Start | ||
^\s*$$ | ||
^. -> Error |
This file contains 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
99 changes: 99 additions & 0 deletions
99
tests/cisco_nxos/show_route-map/cisco_nxos_show_route-map.parsed
This file contains 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,99 @@ | ||
--- | ||
parsed_sample: | ||
- action: permit | ||
match_clauses: | ||
- 'as-path (as-path filter): AS-TEST' | ||
name: RM-TEST-OUT | ||
seq: '10' | ||
set_clauses: [] | ||
- action: deny | ||
match_clauses: | ||
- 'tag: 12345' | ||
name: RM-BGP-TO-OSPF | ||
seq: '10' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: [] | ||
name: RM-BGP-TO-OSPF | ||
seq: '20' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: [] | ||
name: RM-ISP1-IN | ||
seq: '1000' | ||
set_clauses: | ||
- local-preference 300 | ||
- action: permit | ||
match_clauses: | ||
- 'as-path (as-path filter): AS-ISP2' | ||
name: RM-ISP1-OUT | ||
seq: '1000' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: [] | ||
name: RM-ISP1-MAITENANCE | ||
seq: '10' | ||
set_clauses: | ||
- local-preference 50 | ||
- action: permit | ||
match_clauses: [] | ||
name: RM-FW-LP | ||
seq: '10' | ||
set_clauses: | ||
- local-preference 25 | ||
- action: permit | ||
match_clauses: [] | ||
name: RM-FW-MAITENANCE | ||
seq: '10' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: | ||
- 'as-path (as-path filter): TEST-AS-FW' | ||
name: RM-FW-OUTBOUND | ||
seq: '10' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: | ||
- 'ip address prefix-lists: PF-PATH-X-INTERNAL' | ||
name: RM-X-SIDE-INTERNAL | ||
seq: '10' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: | ||
- 'ip address prefix-lists: PF-PATH-Z-INTERNAL' | ||
name: RM-Z-SIDE-INTERNAL | ||
seq: '10' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: | ||
- 'ip address prefix-lists: PL-PERMIT-IN' | ||
name: RM-FILTER-IN | ||
seq: '10' | ||
set_clauses: [] | ||
- action: permit | ||
match_clauses: | ||
- 'ip address (access-lists): AL_TEST_TEST' | ||
name: TEST_THIS | ||
seq: '10' | ||
set_clauses: | ||
- ip next-hop 2.2.2.2 | ||
- action: permit | ||
match_clauses: | ||
- 'ip address prefix-lists: PF-N3K1-TO-N3K2' | ||
name: RM-N3K1-TO-N3K2 | ||
seq: '10' | ||
set_clauses: | ||
- extcommunity RT:100:1 | ||
- action: permit | ||
match_clauses: | ||
- 'ip address prefix-lists: PF-N3K2-TO-N3K1' | ||
name: RM-N3K2-TO-N3K1 | ||
seq: '10' | ||
set_clauses: | ||
- extcommunity RT:200:1 | ||
- action: permit | ||
match_clauses: | ||
- 'ip address prefix-lists: PF-A-DEFAULT-ROUTE' | ||
name: RM-PATH-A-DEFAULT-ROUTE | ||
seq: '10' | ||
set_clauses: [] |
66 changes: 66 additions & 0 deletions
66
tests/cisco_nxos/show_route-map/cisco_nxos_show_route-map.raw
This file contains 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,66 @@ | ||
route-map RM-TEST-OUT, permit, sequence 10 | ||
Match clauses: | ||
as-path (as-path filter): AS-TEST | ||
Set clauses: | ||
route-map RM-BGP-TO-OSPF, deny, sequence 10 | ||
Match clauses: | ||
tag: 12345 | ||
Set clauses: | ||
route-map RM-BGP-TO-OSPF, permit, sequence 20 | ||
Match clauses: | ||
Set clauses: | ||
route-map RM-ISP1-IN, permit, sequence 1000 | ||
Match clauses: | ||
Set clauses: | ||
local-preference 300 | ||
route-map RM-ISP1-OUT, permit, sequence 1000 | ||
Match clauses: | ||
as-path (as-path filter): AS-ISP2 | ||
Set clauses: | ||
route-map RM-ISP1-MAITENANCE, permit, sequence 10 | ||
Match clauses: | ||
Set clauses: | ||
local-preference 50 | ||
route-map RM-FW-LP, permit, sequence 10 | ||
Match clauses: | ||
Set clauses: | ||
local-preference 25 | ||
route-map RM-FW-MAITENANCE, permit, sequence 10 | ||
Match clauses: | ||
Set clauses: | ||
route-map RM-FW-OUTBOUND, permit, sequence 10 | ||
Match clauses: | ||
as-path (as-path filter): TEST-AS-FW | ||
Set clauses: | ||
|
||
route-map RM-X-SIDE-INTERNAL, permit, sequence 10 | ||
Match clauses: | ||
ip address prefix-lists: PF-PATH-X-INTERNAL | ||
Set clauses: | ||
route-map RM-Z-SIDE-INTERNAL, permit, sequence 10 | ||
Match clauses: | ||
ip address prefix-lists: PF-PATH-Z-INTERNAL | ||
Set clauses: | ||
route-map RM-FILTER-IN, permit, sequence 10 | ||
Match clauses: | ||
ip address prefix-lists: PL-PERMIT-IN | ||
Set clauses: | ||
route-map TEST_THIS, permit, sequence 10 | ||
Match clauses: | ||
ip address (access-lists): AL_TEST_TEST | ||
Set clauses: | ||
ip next-hop 2.2.2.2 | ||
route-map RM-N3K1-TO-N3K2, permit, sequence 10 | ||
Match clauses: | ||
ip address prefix-lists: PF-N3K1-TO-N3K2 | ||
Set clauses: | ||
extcommunity RT:100:1 | ||
route-map RM-N3K2-TO-N3K1, permit, sequence 10 | ||
Match clauses: | ||
ip address prefix-lists: PF-N3K2-TO-N3K1 | ||
Set clauses: | ||
extcommunity RT:200:1 | ||
route-map RM-PATH-A-DEFAULT-ROUTE, permit, sequence 10 | ||
Match clauses: | ||
ip address prefix-lists: PF-A-DEFAULT-ROUTE | ||
Set clauses: |