diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index eda8c825ad..2d4eb407c2 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -737,6 +737,7 @@ mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm, .*, mikrotik_rou mikrotik_routeros_ip_route_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip r[[oute]] p[[rint]] t[[erse]] wi[[thout-paging]] mikrotik_routeros_snmp_community_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]snmp community print without-paging mikrotik_routeros_ipv6_neighbor_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ipv6 neighbor print without-paging +mikrotik_routeros_routing_ospf_interface_print_terse.textfsm, .*, mikrotik_routeros, [[/]]r[[outing]] o[[spf]] in[[terface]] p[[rint]] t[[erse]] mikrotik_routeros_ip_arp_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip a[[rp]] p[[rint]] t[[erse]] wi[[thout-paging]] mikrotik_routeros_log_print_detail_without-paging.textfsm, .*, mikrotik_routeros, [[/]]log p[[rint]] d[[etail]] wi[[thout-paging]] mikrotik_routeros_interface_bonding_print_detail.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] bo[[nding]] p[[rint]] d[[etail]] diff --git a/ntc_templates/templates/mikrotik_routeros_routing_ospf_interface_print_terse.textfsm b/ntc_templates/templates/mikrotik_routeros_routing_ospf_interface_print_terse.textfsm new file mode 100644 index 0000000000..6cf471ede7 --- /dev/null +++ b/ntc_templates/templates/mikrotik_routeros_routing_ospf_interface_print_terse.textfsm @@ -0,0 +1,10 @@ +Value INTERFACE (\S+) +Value DYNAMIC (D) +Value PASSIVE (P|passive) +Value COST (\d+) + +Start + ^\s*\d+\s*(${DYNAMIC}\s*)?(${PASSIVE}\s*)?(comment=.+?)?interface=${INTERFACE}\s*cost=${COST}\s*priority=\d+\s*authentication=\S+\s*authentication-key=(?:")?\S+(?:")?\s*authentication-key-id=\d+\s*network-type=\S+\s*instance-id=\d+\s*retransmit-interval=\d+s\s*transmit-delay=\d+s\s*hello-interval=\d+s\s*dead-interval=\d+s\s*use-bfd=\S+$$ -> Record + ^\s*\d+\s*(D\s*)?address=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}%${INTERFACE}\s*area=\S+\s*state=(${PASSIVE}|\S+)\s*network-type=\S+\s*cost=${COST}\s*(priority=\d+\s*)?use-bfd=\S+\s*retransmit-interval=\d+s\s*transmit-delay=\d+s\s*hello-interval=\d+s\s*dead-interval=\d+s\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse.raw b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse.raw new file mode 100644 index 0000000000..c48c205289 --- /dev/null +++ b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse.raw @@ -0,0 +1,3 @@ + 0 P interface=all cost=10 priority=1 authentication=none authentication-key=foo authentication-key-id=1 network-type=broadcast instance-id=0 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s use-bfd=no + 1 comment=ospf comment interface=vlan906@bond1 cost=10 priority=1 authentication=none authentication-key="bar" authentication-key-id=1 network-type=broadcast instance-id=0 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s use-bfd=no + 2 DP interface=lo0 cost=10 priority=1 authentication=none authentication-key="" authentication-key-id=1 network-type=broadcast instance-id=0 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s use-bfd=no diff --git a/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse.yml b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse.yml new file mode 100644 index 0000000000..4ab7ff6d9a --- /dev/null +++ b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - cost: "10" + dynamic: "" + interface: "all" + passive: "P" + - cost: "10" + dynamic: "" + interface: "vlan906@bond1" + passive: "" + - cost: "10" + dynamic: "D" + interface: "lo0" + passive: "P" diff --git a/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse01.raw b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse01.raw new file mode 100644 index 0000000000..01770106d7 --- /dev/null +++ b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse01.raw @@ -0,0 +1,3 @@ +0 D address=1.1.1.1%vlan11@vlan975@sfp-sfpplus1 area=INET-v2 state=ptp network-type=ptp cost=1400 use-bfd=no retransmit-interval=5s transmit-delay=1s hello-interval=1s dead-interval=4s +1 D address=1.1.1.1%vlan10@vlan975@sfp-sfpplus1 area=MGMT-v2 state=ptp network-type=ptp cost=10 use-bfd=no retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s +2 D address=1.1.1.1%Lo0 area=MGMT-v2 state=passive network-type=broadcast cost=1 priority=128 use-bfd=no retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s diff --git a/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse01.yml b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse01.yml new file mode 100644 index 0000000000..3ce745d6af --- /dev/null +++ b/tests/mikrotik_routeros/routing_ospf_interface_print_terse/routing_ospf_interface_print_terse01.yml @@ -0,0 +1,14 @@ +--- +parsed_sample: + - cost: "1400" + dynamic: "" + interface: "vlan11@vlan975@sfp-sfpplus1" + passive: "" + - cost: "10" + dynamic: "" + interface: "vlan10@vlan975@sfp-sfpplus1" + passive: "" + - cost: "1" + dynamic: "" + interface: "Lo0" + passive: "passive"