From 3bf5206db8fd9170176f0d32d418d26adf79b7b2 Mon Sep 17 00:00:00 2001 From: PavloSkliarenko <78343937+PavloSkliarenko@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:02:18 +0400 Subject: [PATCH] Add IOS show mpls l2transport vc template (#1477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: pskliarenko <“pskliarenko@bsh.ru”> --- .../cisco_ios_show_mpls_l2transport_vc.textfsm | 16 ++++++++++++++++ ntc_templates/templates/index | 1 + .../cisco_ios_show_mpls_l2transport_vc.raw | 5 +++++ .../cisco_ios_show_mpls_l2transport_vc.yml | 17 +++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 ntc_templates/templates/cisco_ios_show_mpls_l2transport_vc.textfsm create mode 100644 tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.raw create mode 100644 tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.yml diff --git a/ntc_templates/templates/cisco_ios_show_mpls_l2transport_vc.textfsm b/ntc_templates/templates/cisco_ios_show_mpls_l2transport_vc.textfsm new file mode 100644 index 0000000000..7758309daf --- /dev/null +++ b/ntc_templates/templates/cisco_ios_show_mpls_l2transport_vc.textfsm @@ -0,0 +1,16 @@ +Value INTERFACE ([a-zA-Z0-9\-/.]+) +Value LOCAL_CIRCUIT (.*) +Value DEST_ADDRESS (\S+) +Value VC_ID (\d+) +Value STATUS (.*) + +Start + ^\s*Local\s+intf\s+Local\s+circuit\s+Dest\s+address\s+VC\s+ID\s+Status\s*$$ -> L2transportTable + ^\s*$$ + ^. -> Error + +L2transportTable + ^\s*-+(\s+-+)*\s*$$ + ^\s*${INTERFACE}\s+${LOCAL_CIRCUIT}\s+${DEST_ADDRESS}\s+${VC_ID}\s+${STATUS}\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 774dc3b01b..8c6f190001 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -253,6 +253,7 @@ cisco_ios_show_cdp_neighbors_detail.textfsm, .*, cisco_ios, sh[[ow]] c[[dp]] nei cisco_ios_show_etherchannel_summary.textfsm, .*, cisco_ios, sh[[ow]] etherchann[[el]] summ[[ary]] cisco_ios_show_ipv6_interface_brief.textfsm, .*, cisco_ios, sh[[ow]] ipv[[6]] i[[nterface]] b[[rief]] cisco_ios_show_ip_nat_translations.textfsm, .*, cisco_ios, sh[[ow]] ip nat translation[[s]] +cisco_ios_show_mpls_l2transport_vc.textfsm, .*, cisco_ios, sh[[ow]] m[[pls]] l2[[transport]] v[[c]] cisco_ios_show_ip_eigrp_neighbors.textfsm, .*, cisco_ios, sh[[ow]] ip ei[[grp]] nei[[ghbors]] cisco_ios_show_ip_flow_toptalkers.textfsm, .*, cisco_ios, sh[[ow]] ip fl[[ow]] top[[-talkers]] cisco_ios_show_ip_interface_brief.textfsm, .*, cisco_ios, sh[[ow]] ip int[[erface]] br[[ief]] diff --git a/tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.raw b/tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.raw new file mode 100644 index 0000000000..85bdbc0855 --- /dev/null +++ b/tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.raw @@ -0,0 +1,5 @@ +Local intf Local circuit Dest address VC ID Status +------------- ------------------ --------------- ---------- ---------- +Se5/0 FR DLCI 55 10.0.0.1 55 UP +AT4/0 ATM AAL5 0/100 10.0.0.1 100 UP +AT4/0.300 ATM AAL5 0/300 10.0.0.1 300 UP diff --git a/tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.yml b/tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.yml new file mode 100644 index 0000000000..adde43ead5 --- /dev/null +++ b/tests/cisco_ios/show_mpls_l2transport_vc/cisco_ios_show_mpls_l2transport_vc.yml @@ -0,0 +1,17 @@ +--- +parsed_sample: + - dest_address: "10.0.0.1" + interface: "Se5/0" + local_circuit: "FR DLCI 55 " + status: "UP" + vc_id: "55" + - dest_address: "10.0.0.1" + interface: "AT4/0" + local_circuit: "ATM AAL5 0/100 " + status: "UP" + vc_id: "100" + - dest_address: "10.0.0.1" + interface: "AT4/0.300" + local_circuit: "ATM AAL5 0/300 " + status: "UP" + vc_id: "300"