Skip to content

Commit

Permalink
new_template: cisco_nxos_show_route-map
Browse files Browse the repository at this point in the history
  • Loading branch information
nnaukwal authored and FragmentedPacket committed Oct 9, 2019
1 parent b160158 commit bcf6dfa
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 0 deletions.
31 changes: 31 additions & 0 deletions templates/cisco_nxos_show_route-map.template
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
1 change: 1 addition & 0 deletions templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ cisco_nxos_show_access-lists.template, .*, cisco_nxos, sh[[ow]] acc[[ess-lists]]
cisco_nxos_show_environments.template, .*, cisco_nxos, sh[[ow]] envi[[ronments]]
cisco_nxos_show_interface.template, .*, cisco_nxos, sh[[ow]] inte[[rface]]
cisco_nxos_show_inventory.template, .*, cisco_nxos, sh[[ow]] inv[[entory]]
cisco_nxos_show_route-map.template, .*, cisco_nxos, sh[[ow]] route-m[[ap]]
cisco_nxos_show_hostname.template, .*, cisco_nxos, sh[[ow]] hostn[[ame]]
cisco_nxos_show_ip_route.template, .*, cisco_nxos, sh[[ow]] ip route
cisco_nxos_show_feature.template, .*, cisco_nxos, sh[[ow]] feat[[ure]]
Expand Down
99 changes: 99 additions & 0 deletions tests/cisco_nxos/show_route-map/cisco_nxos_show_route-map.parsed
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 tests/cisco_nxos/show_route-map/cisco_nxos_show_route-map.raw
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:

0 comments on commit bcf6dfa

Please sign in to comment.