Skip to content
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

CISCO XR SHOW BGP NEIGH: Add new template #341

Merged
merged 11 commits into from
Jan 24, 2019
Merged

Conversation

jmcgill298
Copy link
Contributor

ISSUE TYPE
  • New Template Pull Request
COMPONENT

cisco_xr_show_bgp_neighbor

SUMMARY

Add new template


jtishey and others added 3 commits January 9, 2019 20:32
CAPTURE GROUPS RENAMED:
  - `ROUTER_ID` -> `REMOTE_ROUTER_ID`
  - `BGP_STATE` -> `STATE`
  - `PFX_IN` -> `PREFIXES_IN`
  - `PFX_OUT` -> `PREFIXES_OUT`
  - `MAX_PFX` -> `MAX_PREFIXES`
  - `MAX_PFX_WARN` -> `MAX_PREFIXES_WARN_PERCENT`
  - `BGP_TYPE` -> `TYPE`

BREAKING CHANGES:
  - MAKE AFI CAPTURE GROUPS INTO LIST TO ACCOUNT FOR ALL TYPES
    * `AFI`
    * `PREFIXES_IN`
    * `PREFIXES_OUT`
    * `MAX_PREFIXES`
    * `MAX_PREFIXES_WARN_PERCENT`

ADDITIONAL CAPTURE GROUPS:
  - `CLUSTER_ID`
  - `UPTIME`
  - `NSR_STATE`
  - `HOLDTIME`
  - `KEEPALIVE`
  - `VERSION`
  - `ROUTE_REFLECTOR_ROLE`
  - `POLICY_INCOMING`
  - `POLICY_OUTGOING`
  - `PREFIXES_IN_BEST`
  - `PREFIXES_OUT_SUPPRESSED`
  - `PREFIXES_OUT_WITHDRAWN`
  - `LAST_ACK_VERSION`
  - `LAST_SYNCED_ACK_VERSION`
  - `CONNECTIONS_ESTABLISHED`
  - `CONNECTIONS_DROPPED`
  - `LAST_RESET`
  - `LAST_RESET_REASON`
  - `LAST_NOTIFICATION_RECEIVED`
  - `PEER_ERROR_CODE`
  - `PEER_RESET_REASON`
  - `MAX_HOPS`

GENERAL UPDATES:
  - Add regex matches for each line in the test file
  - Add a line at the end of each state to raise an error if no match is found
@jmcgill298
Copy link
Contributor Author

@jtishey I updated the template to include matches for each line; can you take a look at my changes/updates and let me know what you think?

@jtishey
Copy link

jtishey commented Jan 21, 2019

thanks @jmcgill298 , I checked it against a few different routers and will look at making a few updates for neighbors with Graceful Restart enabled and add the raw text for it.

@jtishey
Copy link

jtishey commented Jan 22, 2019

@jmcgill298 After testing on a few routers with different configs/versions, I've made some additions @ jtishey@9cb694f

Do you want a new PR or just review and integrate it with yours?

Added tests/cisco_xr/show_bgp_neighbors1.raw
Added tests/cisco_xr/show_bgp_neighbors1.parsed
Updated templates/cisco_xr_show_bgp_neighbors.templates

Value GR (.+?)
Value List DEFAULT_ORIGINATE (.+)
Value LAST_RESET_REASON (.*)

START
  ^\s+Remote\s+AS\s+${REMOTE_AS}\,\s+local\s+AS\s+${LOCAL_AS}\,\s+(?:no\-prepend,\s+)?(?:replace\-as\,\s+)?${TYPE}\s+link
  ^\s+Administratively\s+shut\s+down
  ^\s+BFD\s+[Ee]nabled
  ^\s+Configured hold time\:\s+\d+\,\s+keepalive\:
  ^\s+Graceful\s+restart\s+is\s+${GR}\s*$$
  ^\s+Restart\s+time\s+is
  ^\s+Stale\s+path\s+timeout\s+time\s+is
  ^\s+Graceful\s+Restart\s+\(GR\s+Awareness\)\:
  ^\s+Inbound\s+message\s+logging
  ^\s+Outbound\s+message\s+logging

AFI
  ^\s+Default\s+information\s+originate\:\s+${DEFAULT_ORIGINATE}
  ^\s+AF-dependent capabilities
  ^\s+Graceful\s+Restart\s+capability
  ^\s+Local\s+restart\s+time\s+is
  ^\s+Maximum\s+stalepath\s+time\s+is
  ^\s+Remote\s+Restart\s+time\s+is
  ^\s+Private\s+AS\s+number\s+removed
  ^\s+Community\s+attribute
  ^\s+Advertise\s+VPNv[46]\s+routes\s+(is\s)?enabled\s+with
  ^\s+AS\s+[oO]verride\s+is
  ^\s+Send\s+Multicast\s+Attributes

CONNECTION
  ^\s+Last\s+reset\s+${LAST_RESET}\,\s+due\s+to\s+${LAST_RESET_REASON}
  ^\s+Last\s+reset\s+${LAST_RESET}
  ^\s+External\s+BGP\s+neighbor\s+not\s+directly

@jmcgill298
Copy link
Contributor Author

@jtishey can you put in a PR to this branch?

Added tests/cisco_xr/show_bgp_neighbors1.raw
Added tests/cisco_xr/show_bgp_neighbors1.parsed
Updated templates/cisco_xr_show_bgp_neighbors.templates

Value GR (.+?)
Value List DEFAULT_ORIGINATE (.+)
Value LAST_RESET_REASON (.*)

START
  ^\s+Remote\s+AS\s+${REMOTE_AS}\,\s+local\s+AS\s+${LOCAL_AS}\,\s+(?:no\-prepend,\s+)?(?:replace\-as\,\s+)?${TYPE}\s+link
  ^\s+Administratively\s+shut\s+down
  ^\s+BFD\s+[Ee]nabled
  ^\s+Configured hold time\:\s+\d+\,\s+keepalive\:
  ^\s+Graceful\s+restart\s+is\s+${GR}\s*$$
  ^\s+Restart\s+time\s+is
  ^\s+Stale\s+path\s+timeout\s+time\s+is
  ^\s+Graceful\s+Restart\s+\(GR\s+Awareness\)\:
  ^\s+Inbound\s+message\s+logging
  ^\s+Outbound\s+message\s+logging

AFI
  ^\s+Default\s+information\s+originate\:\s+${DEFAULT_ORIGINATE}
  ^\s+AF-dependent capabilities
  ^\s+Graceful\s+Restart\s+capability
  ^\s+Local\s+restart\s+time\s+is
  ^\s+Maximum\s+stalepath\s+time\s+is
  ^\s+Remote\s+Restart\s+time\s+is
  ^\s+Private\s+AS\s+number\s+removed
  ^\s+Community\s+attribute
  ^\s+Advertise\s+VPNv[46]\s+routes\s+(is\s)?enabled\s+with
  ^\s+AS\s+[oO]verride\s+is
  ^\s+Send\s+Multicast\s+Attributes

CONNECTION
  ^\s+Last\s+reset\s+${LAST_RESET}\,\s+due\s+to\s+${LAST_RESET_REASON}
  ^\s+Last\s+reset\s+${LAST_RESET}
  ^\s+External\s+BGP\s+neighbor\s+not\s+directly
@jtishey
Copy link

jtishey commented Jan 22, 2019

#346 opened against branch xr_show_bgp_neigh

@jmcgill298 jmcgill298 merged commit 56e8843 into master Jan 24, 2019
@jmcgill298
Copy link
Contributor Author

Thanks @jtishey

@jmcgill298 jmcgill298 deleted the xr_show_bgp_neigh branch January 26, 2019 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants