Skip to content

Commit

Permalink
bugfix - cisco_xr - support both show_platform and admin_show_platform (
Browse files Browse the repository at this point in the history
#1783)

* move xr show_platform data into the correct directory

* update index and cisco_xr admin_show_platform template to support admin
nad non-admin output
  • Loading branch information
mjbear authored Jul 24, 2024
1 parent 56904eb commit 0780cae
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 30 deletions.
5 changes: 4 additions & 1 deletion ntc_templates/templates/cisco_xr_admin_show_platform.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ Start
^\-+ -> Parse

Parse
^${NODE}\s+${TYPE}\s+${STATE}\s+(${CONFIG_STATE})? -> Record
# show platform
^${NODE}\s+${TYPE}\s+${STATE}\s+(${CONFIG_STATE})? -> Record
# admin show platform
^${NODE}\s+${TYPE}\s+\S+\s+${STATE}\s+(${CONFIG_STATE})? -> Record
2 changes: 1 addition & 1 deletion ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ cisco_xr_show_redundancy_summary.textfsm, .*, cisco_xr, sh[[ow]] redun[[dancy]]
cisco_xr_show_pim_ipv4_neighbor.textfsm, .*, cisco_xr, sh[[ow]] pim ipv4 nei[[ghbor]]
cisco_xr_admin_show_inventory.textfsm, .*, cisco_xr, adm[[in]] sh[[ow]] inven[[tory]]
cisco_xr_show_interface_brief.textfsm, .*, cisco_xr, sh[[ow]] int[[erface]] br[[ief]]
cisco_xr_admin_show_platform.textfsm, .*, cisco_xr, adm[[in]] sh[[ow]] pla[[tform]]
cisco_xr_admin_show_platform.textfsm, .*, cisco_xr, (adm[[in]] )?sh[[ow]] pla[[tform]]
cisco_xr_show_install_active.textfsm, .*, cisco_xr, sh[[ow]] install active
cisco_xr_show_ip_bgp_summary.textfsm, .*, cisco_xr, sh[[ow]] ip b[[gp]] s[[ummary]]
cisco_xr_show_ipv4_interface.textfsm, .*, cisco_xr, sh[[ow]] ip[[v4]](?: vrf \S+)? int[[erface]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
Tue Mar 7 14:29:29.338 EST
Node Type State Config State
-----------------------------------------------------------------------------
0/RSP0/CPU0 A9K-RSP440-TR(Active) IOS XR RUN PWR,NSHUT,MON
0/RSP1/CPU0 A9K-RSP440-TR(Standby) IOS XR RUN PWR,NSHUT,MON
0/FT0/SP ASR-9010-FAN-V2 READY
0/FT1/SP ASR-9010-FAN-V2 READY
0/0/0 A9K-MPA-2X40GE OK PWR,NSHUT,MON
Tue Nov 16 15:43:18.391 UTC
Location Card Type HW State SW State Config State
----------------------------------------------------------------------------
0/0 R-IOSXRV9000-LC-C OPERATIONAL N/A NSHUT
0/RP0 R-IOSXRV9000-RP-C OPERATIONAL OPERATIONAL NSHUT
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
---
parsed_sample:
- node: "0/RSP0/CPU0"
type: "A9K-RSP440-TR(Active)"
state: "IOS XR RUN"
config_state: "PWR,NSHUT,MON"
- node: "0/RSP1/CPU0"
type: "A9K-RSP440-TR(Standby)"
state: "IOS XR RUN"
config_state: "PWR,NSHUT,MON"
- node: "0/FT0/SP"
type: "ASR-9010-FAN-V2"
state: "READY"
config_state: ""
- node: "0/FT1/SP"
type: "ASR-9010-FAN-V2"
state: "READY"
config_state: ""
- node: "0/0/0"
type: "A9K-MPA-2X40GE"
state: "OK"
config_state: "PWR,NSHUT,MON"
- config_state: "N/A"
node: "0/0"
state: "OPERATIONAL"
type: "R-IOSXRV9000-LC-C"
- config_state: "OPERATIONAL"
node: "0/RP0"
state: "OPERATIONAL"
type: "R-IOSXRV9000-RP-C"
8 changes: 8 additions & 0 deletions tests/cisco_xr/show_platform/cisco_xr_show_platform.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Tue Mar 7 14:29:29.338 EST
Node Type State Config State
-----------------------------------------------------------------------------
0/RSP0/CPU0 A9K-RSP440-TR(Active) IOS XR RUN PWR,NSHUT,MON
0/RSP1/CPU0 A9K-RSP440-TR(Standby) IOS XR RUN PWR,NSHUT,MON
0/FT0/SP ASR-9010-FAN-V2 READY
0/FT1/SP ASR-9010-FAN-V2 READY
0/0/0 A9K-MPA-2X40GE OK PWR,NSHUT,MON
22 changes: 22 additions & 0 deletions tests/cisco_xr/show_platform/cisco_xr_show_platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
parsed_sample:
- config_state: "PWR,NSHUT,MON"
node: "0/RSP0/CPU0"
state: "IOS XR RUN"
type: "A9K-RSP440-TR(Active)"
- config_state: "PWR,NSHUT,MON"
node: "0/RSP1/CPU0"
state: "IOS XR RUN"
type: "A9K-RSP440-TR(Standby)"
- config_state: ""
node: "0/FT0/SP"
state: "READY"
type: "ASR-9010-FAN-V2"
- config_state: ""
node: "0/FT1/SP"
state: "READY"
type: "ASR-9010-FAN-V2"
- config_state: "PWR,NSHUT,MON"
node: "0/0/0"
state: "OK"
type: "A9K-MPA-2X40GE"
5 changes: 5 additions & 0 deletions tests/cisco_xr/show_platform/cisco_xr_show_platform2.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Tue Nov 16 15:42:24.738 UTC
Node Type State Config state
--------------------------------------------------------------------------------
0/0/CPU0 R-IOSXRV9000-LC-C IOS XR RUN NSHUT
0/RP0/CPU0 R-IOSXRV9000-RP-C(Active) IOS XR RUN NSHUT
10 changes: 10 additions & 0 deletions tests/cisco_xr/show_platform/cisco_xr_show_platform2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
parsed_sample:
- config_state: "NSHUT"
node: "0/0/CPU0"
state: "IOS XR RUN"
type: "R-IOSXRV9000-LC-C"
- config_state: "NSHUT"
node: "0/RP0/CPU0"
state: "IOS XR RUN"
type: "R-IOSXRV9000-RP-C(Active)"

0 comments on commit 0780cae

Please sign in to comment.