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_ios_show_platform, only for switches #1892

Merged
merged 15 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ntc_templates/templates/cisco_ios_show_platform.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Value INDEX (\d+)
Value PORTS (\d+)
Value MODEL (\S+)
Value SERIAL (\S+)
Value MAC (\S+)
Value HARDWARE_VERSION (\S+)
Value SOFTWARE_VERSION (\d+\.\d+\.\d+)

Start
^Switch\s+Ports\s+Model\s+Serial\s+No\.\s+MAC\s+address\s+Hw\s+Ver\.\s+Sw\s+Ver\.\s*$$
^(-+\s*)+$$
^\s*${INDEX}\s+${PORTS}\s+${MODEL}\s+${SERIAL}\s+${MAC}\s+${HARDWARE_VERSION}\s+${SOFTWARE_VERSION}\s*
jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ cisco_ios_show_nve_peers.textfsm, .*, cisco_ios, sh[[ow]] nv[[e]] p[[eers]]
cisco_ios_show_route-map.textfsm, .*, cisco_ios, sh[[ow]] route-m[[ap]]
cisco_ios_show_snmp_user.textfsm, .*, cisco_ios, sh[[ow]] sn[[mp]] u[[ser]]
cisco_ios_show_ip_route.textfsm, .*, cisco_ios, sh[[ow]] ip r[[oute]]
cisco_ios_show_platform.textfsm, .*, cisco_ios, sh[[ow]] plat[[form]]
cisco_ios_show_vrrp_all.textfsm, .*, cisco_ios, sh[[ow]] vrr[[p]] a[[ll]]
cisco_ios_show_aliases.textfsm, .*, cisco_ios, sh[[ow]] alia[[ses]]
cisco_ios_show_archive.textfsm, .*, cisco_ios, sh[[ow]] arc[[hive]]
Expand Down
4 changes: 4 additions & 0 deletions tests/cisco_ios/show_platform/cisco_ios_show_platform.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Switch Ports Model Serial No. MAC address Hw Ver. Sw Ver.
------ ----- --------- ----------- -------------- ------- --------
1 65 C9300-48P J111111111a f000.f000.f000 V03 16.12.4
2 65 C9300-48P J222222222b f000.f000.f001 V03 16.12.4
16 changes: 16 additions & 0 deletions tests/cisco_ios/show_platform/cisco_ios_show_platform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
parsed_sample:
- index: "1"
ports: "65"
model: "C9300-48P"
serial: "J111111111a"
mac: "f000.f000.f000"
hardware_version: "V03"
software_version: "16.12.4"
- index: "2"
ports: "65"
model: "C9300-48P"
serial: "J222222222b"
mac: "f000.f000.f001"
hardware_version: "V03"
software_version: "16.12.4"
Loading