Skip to content

Commit

Permalink
feat: Add show_port_description for alcatel_sros (#1912)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Bear <[email protected]>
  • Loading branch information
bennnnnnnn and mjbear authored Nov 27, 2024
1 parent db6b793 commit 649998f
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ntc_templates/templates/alcatel_sros_show_port_description.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Value PORT_ID (\S+)
Value DESCRIPTION (.+)

Start
^=+\s*$$
^\s*$$
^Port\s+Descriptions\s+on\s+Slot\s+\S+\s*$$
^Port\s+Id\s+Description\s*$$
^${PORT_ID}\s+${DESCRIPTION}\s*$$ -> Record
^-+\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ alcatel_sros_show_router_pim_interface.textfsm, .*, alcatel_sros, sh[[ow]] route
alcatel_sros_show_service_id_interface.textfsm, .*, alcatel_sros, sh[[ow]] se[[rvice]] id (\d+ in[[terface]]|in[[terface]])
alcatel_sros_show_service_sap-using.textfsm, .*, alcatel_sros, sh[[ow]] service sap-u[[sing]]
alcatel_sros_show_service_sdp-using.textfsm, .*, alcatel_sros, sh[[ow]] service sdp-using
alcatel_sros_show_port_description.textfsm, .*, alcatel_sros, sh[[ow]] port (\S+ )?des[[cription]]
alcatel_sros_show_router_interface.textfsm, .*, alcatel_sros, sh[[ow]] router (\d+ int[[erface]]|int[[erface]])
alcatel_sros_show_router_mpls_lsp.textfsm, .*, alcatel_sros, sh[[ow]] router mpls lsp
alcatel_sros_show_service_id_base.textfsm, .*, alcatel_sros, sh[[ow]] serv[[ice]] id ba[[se]]
Expand Down
35 changes: 35 additions & 0 deletions tests/alcatel_sros/show_port_description/show_port_description.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
===============================================================================
Port Descriptions on Slot 1
===============================================================================
Port Id Description
-------------------------------------------------------------------------------
1/1/1 some_gig1_test
1/1/2 some2_gig1_test
1/1/3 some3_gig1_test
1/1/4 some4_gig1_test
1/1/5 some5_gig1_test
1/1/6 10/100/Gig Ethernet SFP
1/1/7 10/100/Gig Ethernet SFP
1/1/8 10/100/Gig Ethernet SFP
1/1/9 10/100/Gig Ethernet SFP
1/1/10 10/100/Gig Ethernet SFP
1/1/11 10/100/Gig Ethernet SFP
1/1/12 TEST_AGG_TOGGLE
1/1/13 TNET_RAN_TEST1
1/1/14 TNET_RAN_TEST2
1/1/15 test 1
1/1/16 test 2
1/1/17 TEST_3
1/1/18 TNET_RAN_TEST3
1/1/19 TNET_RAN_TEST4
1/1/20 TNET_RAN_TEST5
1/5/1 10-Gig Ethernet
1/5/2 10-Gig Ethernet

===============================================================================
Port Descriptions on Slot A
===============================================================================
Port Id Description
-------------------------------------------------------------------------------
A/1 10/100 Ethernet TX
===============================================================================
48 changes: 48 additions & 0 deletions tests/alcatel_sros/show_port_description/show_port_description.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
parsed_sample:
- description: "some_gig1_test"
port_id: "1/1/1"
- description: "some2_gig1_test"
port_id: "1/1/2"
- description: "some3_gig1_test"
port_id: "1/1/3"
- description: "some4_gig1_test"
port_id: "1/1/4"
- description: "some5_gig1_test"
port_id: "1/1/5"
- description: "10/100/Gig Ethernet SFP"
port_id: "1/1/6"
- description: "10/100/Gig Ethernet SFP"
port_id: "1/1/7"
- description: "10/100/Gig Ethernet SFP"
port_id: "1/1/8"
- description: "10/100/Gig Ethernet SFP"
port_id: "1/1/9"
- description: "10/100/Gig Ethernet SFP"
port_id: "1/1/10"
- description: "10/100/Gig Ethernet SFP"
port_id: "1/1/11"
- description: "TEST_AGG_TOGGLE"
port_id: "1/1/12"
- description: "TNET_RAN_TEST1"
port_id: "1/1/13"
- description: "TNET_RAN_TEST2"
port_id: "1/1/14"
- description: "test 1"
port_id: "1/1/15"
- description: "test 2"
port_id: "1/1/16"
- description: "TEST_3"
port_id: "1/1/17"
- description: "TNET_RAN_TEST3"
port_id: "1/1/18"
- description: "TNET_RAN_TEST4"
port_id: "1/1/19"
- description: "TNET_RAN_TEST5"
port_id: "1/1/20"
- description: "10-Gig Ethernet"
port_id: "1/5/1"
- description: "10-Gig Ethernet"
port_id: "1/5/2"
- description: "10/100 Ethernet TX"
port_id: "A/1"

0 comments on commit 649998f

Please sign in to comment.