From 3f11776c8c1e1095fab03eb0a3e28a0a83d6c2da Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Sat, 15 May 2021 07:49:55 +0000 Subject: [PATCH 1/2] sros-sh-rtr-ospf-int --- ...el_sros_show_router_ospf_interface.textfsm | 27 +++++++++++++++++++ ntc_templates/templates/index | 1 + ...lcatel_sros_show_router_ospf_interface.raw | 12 +++++++++ ...lcatel_sros_show_router_ospf_interface.yml | 26 ++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm create mode 100644 tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.raw create mode 100644 tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml diff --git a/ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm b/ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm new file mode 100644 index 0000000000..c974293977 --- /dev/null +++ b/ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm @@ -0,0 +1,27 @@ +Value Required INTERFACE (\S+) +Value Required AREA_ID (\S+) +Value Required DESIG_RTR (\S+) +Value Required BKUP_DESIG_RTR (\S+) +Value Required ADMIN_STATE (\S+) +Value Required OPER_STATE (\S+) + +Start + ^=+ + ^Rtr\s+Base + ^If\s+Name\s+Area\s+Id\s+Designated\s+Rtr\s+Bkup\s+Desig\s+Rtr\s+Adm\s+Oper\s*$$ + ^-+ -> Interface + ^\s*$$ + ^. -> Error + +Interface + ^${INTERFACE}\s+${AREA_ID}\s+${DESIG_RTR}\s+${BKUP_DESIG_RTR}\s+${ADMIN_STATE}\s+${OPER_STATE} -> Record + ^-+ -> Total + ^\s*$$ + ^. -> Error + +Total + ^No.\s+ + ^=+ -> Done + ^. -> Error + +Done diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index e33bb43f98..fc3db637ca 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -18,6 +18,7 @@ alcatel_sros_show_router_bgp_summary_family.textfsm, .*, alcatel_sros, sh[[ow]] alcatel_sros_show_router_isis_adjacency.textfsm, .*, alcatel_sros, sh[[ow]] router isis adj[[acency]] alcatel_sros_show_router_isis_interface.textfsm, .*, alcatel_sros, sh[[ow]] router isis int[[erface]] alcatel_sros_show_router_mpls_interface.textfsm, .*, alcatel_sros, sh[[ow]] router mpls int[[erface]] +alcatel_sros_show_router_ospf_interface.textfsm, .*, alcatel_sros, sh[[ow]] router ospf int[[erface]] alcatel_sros_show_router_rsvp_interface.textfsm, .*, alcatel_sros, sh[[ow]] router rsvp int[[erface]] alcatel_sros_show_router_ldp_interface.textfsm, .*, alcatel_sros, sh[[ow]] router ldp int[[erface]] alcatel_sros_show_router_pim_interface.textfsm, .*, alcatel_sros, sh[[ow]] router pim int[[erface]] diff --git a/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.raw b/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.raw new file mode 100644 index 0000000000..a901f8e05b --- /dev/null +++ b/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.raw @@ -0,0 +1,12 @@ +=============================================================================== +Rtr Base OSPFv2 Instance 0 Interfaces +=============================================================================== +If Name Area Id Designated Rtr Bkup Desig Rtr Adm Oper +------------------------------------------------------------------------------- +system 0.0.0.0 10.10.10.3 0.0.0.0 Up DR +TO_IOSXR 0.0.0.0 0.0.0.0 0.0.0.0 Up PToP +TO_R1 0.0.0.0 0.0.0.0 0.0.0.0 Up PToP +TO_R4 0.0.0.0 0.0.0.0 0.0.0.0 Up PToP +------------------------------------------------------------------------------- +No. of OSPF Interfaces: 4 +=============================================================================== diff --git a/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml b/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml new file mode 100644 index 0000000000..1d10ebb104 --- /dev/null +++ b/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml @@ -0,0 +1,26 @@ +--- +parsed_sample: + - interface: "system" + area_id: "0.0.0.0" + desig_rtr: "10.10.10.3" + bkup_desig_rtr: "0.0.0.0" + admin_state: "Up" + oper_state: "DR" + - interface: "TO_IOSXR" + area_id: "0.0.0.0" + desig_rtr: "0.0.0.0" + bkup_desig_rtr: "0.0.0.0" + admin_state: "Up" + oper_state: "PToP" + - interface: "TO_R1" + area_id: "0.0.0.0" + desig_rtr: "0.0.0.0" + bkup_desig_rtr: "0.0.0.0" + admin_state: "Up" + oper_state: "PToP" + - interface: "TO_R4" + area_id: "0.0.0.0" + desig_rtr: "0.0.0.0" + bkup_desig_rtr: "0.0.0.0" + admin_state: "Up" + oper_state: "PToP" From 5d87d23b7057becd2ba805b396b5bf3f0b125b8f Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Fri, 21 May 2021 20:59:30 +0000 Subject: [PATCH 2/2] Matched other ospf int templates --- .../alcatel_sros_show_router_ospf_interface.textfsm | 4 ++-- .../alcatel_sros_show_router_ospf_interface.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm b/ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm index c974293977..6f790aad56 100644 --- a/ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm +++ b/ntc_templates/templates/alcatel_sros_show_router_ospf_interface.textfsm @@ -1,5 +1,5 @@ Value Required INTERFACE (\S+) -Value Required AREA_ID (\S+) +Value Required AREA (\S+) Value Required DESIG_RTR (\S+) Value Required BKUP_DESIG_RTR (\S+) Value Required ADMIN_STATE (\S+) @@ -14,7 +14,7 @@ Start ^. -> Error Interface - ^${INTERFACE}\s+${AREA_ID}\s+${DESIG_RTR}\s+${BKUP_DESIG_RTR}\s+${ADMIN_STATE}\s+${OPER_STATE} -> Record + ^${INTERFACE}\s+${AREA}\s+${DESIG_RTR}\s+${BKUP_DESIG_RTR}\s+${ADMIN_STATE}\s+${OPER_STATE} -> Record ^-+ -> Total ^\s*$$ ^. -> Error diff --git a/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml b/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml index 1d10ebb104..5c1c77d79c 100644 --- a/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml +++ b/tests/alcatel_sros/show_router_ospf_interface/alcatel_sros_show_router_ospf_interface.yml @@ -1,25 +1,25 @@ --- parsed_sample: - interface: "system" - area_id: "0.0.0.0" + area: "0.0.0.0" desig_rtr: "10.10.10.3" bkup_desig_rtr: "0.0.0.0" admin_state: "Up" oper_state: "DR" - interface: "TO_IOSXR" - area_id: "0.0.0.0" + area: "0.0.0.0" desig_rtr: "0.0.0.0" bkup_desig_rtr: "0.0.0.0" admin_state: "Up" oper_state: "PToP" - interface: "TO_R1" - area_id: "0.0.0.0" + area: "0.0.0.0" desig_rtr: "0.0.0.0" bkup_desig_rtr: "0.0.0.0" admin_state: "Up" oper_state: "PToP" - interface: "TO_R4" - area_id: "0.0.0.0" + area: "0.0.0.0" desig_rtr: "0.0.0.0" bkup_desig_rtr: "0.0.0.0" admin_state: "Up"