From 17728c63f7139fad084853024111fc57a3a0a103 Mon Sep 17 00:00:00 2001 From: sliddjur Date: Sun, 8 Mar 2020 20:04:01 +0100 Subject: [PATCH] New Template: hp_comware_display_ip_interface (#609) --- .../hp_comware_display_ip_interface.textfsm | 42 +++++++ templates/index | 1 + .../hp_comware_display_ip_interface.raw | 106 ++++++++++++++++++ .../hp_comware_display_ip_interface.yml | 31 +++++ 4 files changed, 180 insertions(+) create mode 100644 templates/hp_comware_display_ip_interface.textfsm create mode 100644 tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.raw create mode 100644 tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.yml diff --git a/templates/hp_comware_display_ip_interface.textfsm b/templates/hp_comware_display_ip_interface.textfsm new file mode 100644 index 0000000000..9da45b80bd --- /dev/null +++ b/templates/hp_comware_display_ip_interface.textfsm @@ -0,0 +1,42 @@ +Value INTF (\S+) +Value LINE_STATUS (UP|DOWN|Administratively DOWN) +Value PROTOCOL_STATUS (UP(\(spoofing\))?|DOWN) +Value List IPADDR (\S+) +Value MTU (\d+) + + +Start + ^${INTF}\s+current\s+state:\s+${LINE_STATUS} -> Interface + ^. -> Error + + +Interface + ^\S+\s+current\s+state -> Continue.Record + ^${INTF}\s+current\s+state:\s+${LINE_STATUS} + ^Line\s+protocol\s+current\s+state:\s+${PROTOCOL_STATUS} + ^Internet\s+Address\s+is\s+${IPADDR}\s+Primary + ^Internet\s+Address\s+is\s+${IPADDR}\s+Sub + ^Broadcast\s+address:\s\S+ + ^The\s+Maximum\s+Transmit\s+Unit:\s+${MTU}\s+bytes + ^input\spackets\s:\s\d+,\sbytes\s:\s\d+,\smulticasts\s:\s\d+ + ^output\spackets\s:\s\d+,\sbytes\s:\s\d+,\smulticasts\s:\s\d+ + ^TTL\sinvalid\spacket\snumber:\s+\d+ + ^ICMP\spacket\sinput\snumber:\s+\d+ + ^\s+Echo\sreply:\s+\d+ + ^\s+Unreachable:\s+\d+ + ^\s+Source\squench:\s+\d+ + ^\s+Routing\sredirect:\s+\d+ + ^\s+Echo\srequest:\s+\d+ + ^\s+Router\sadvert:\s+\d+ + ^\s+Router\ssolicit:\s+\d+ + ^\s+Time\sexceed:\s+\d+ + ^\s+IP\sheader\sbad:\s+\d+ + ^\s+Timestamp\srequest:\s+\d+ + ^\s+Timestamp\sreply:\s+\d+ + ^\s+Information\srequest:\s+\d+ + ^\s+Information\sreply:\s+\d+ + ^\s+Netmask\srequest:\s+\d+ + ^\s+Netmask\sreply:\s+\d+ + ^\s+Unknown\stype:\s+\d+ + ^\s*$$ + ^. -> Error diff --git a/templates/index b/templates/index index 0192252c96..353d1a5320 100644 --- a/templates/index +++ b/templates/index @@ -326,6 +326,7 @@ fortinet_fortios_get_system_interface.textfsm, .*, fortinet_fortios, [[g]]et [[s fortinet_fortios_get_system_status.textfsm, .*, fortinet_fortios, [[g]]et [[s]]ystem [[s]]tatus hp_comware_display_counters_bound_interface.textfsm, .*, hp_comware, di[[splay]] cou[[nters]] (\S+) i[[nterface]] +hp_comware_display_ip_interface.textfsm, .*, hp_comware, dis[[play]] ip i[[nterface]] hp_comware_display_mac-address.textfsm, .*, hp_comware, di[[splay]] mac-ad[[dress]] hp_comware_display_vlan_brief.textfsm, .*, hp_comware, di[[splay]] v[[lan]] b[[rief]] hp_comware_display_clock.textfsm, .*, hp_comware, di[[splay]] clo[[ck]] diff --git a/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.raw b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.raw new file mode 100644 index 0000000000..f7b8d1f771 --- /dev/null +++ b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.raw @@ -0,0 +1,106 @@ +LoopBack0 current state: UP +Line protocol current state: UP(spoofing) +Internet Address is 172.18.255.63/32 Primary +Broadcast address: 172.18.255.63 +The Maximum Transmit Unit: 1536 bytes +input packets : 0, bytes : 0, multicasts : 0 +output packets : 0, bytes : 0, multicasts : 0 +TTL invalid packet number: 0 +ICMP packet input number: 0 + Echo reply: 0 + Unreachable: 0 + Source quench: 0 + Routing redirect: 0 + Echo request: 0 + Router advert: 0 + Router solicit: 0 + Time exceed: 0 + IP header bad: 0 + Timestamp request: 0 + Timestamp reply: 0 + Information request: 0 + Information reply: 0 + Netmask request: 0 + Netmask reply: 0 + Unknown type: 0 + +M-GigabitEthernet0/0/0 current state: Administratively DOWN +Line protocol current state: DOWN + +Vlan-interface66 current state: UP +Line protocol current state: UP +Internet Address is 172.18.69.101/24 Primary +Broadcast address: 172.18.69.255 +The Maximum Transmit Unit: 1500 bytes +input packets : 65515804, bytes : 1239151236, multicasts : 2635390 +output packets : 67811020, bytes : 1077354863, multicasts : 6419331 +TTL invalid packet number: 0 +ICMP packet input number: 1792875 + Echo reply: 5 + Unreachable: 275831 + Source quench: 0 + Routing redirect: 0 + Echo request: 1517039 + Router advert: 0 + Router solicit: 0 + Time exceed: 0 + IP header bad: 0 + Timestamp request: 0 + Timestamp reply: 0 + Information request: 0 + Information reply: 0 + Netmask request: 0 + Netmask reply: 0 + Unknown type: 0 + +Vlan-interface89 current state: UP +Line protocol current state: UP +Internet Address is 172.18.89.3/24 Primary +Broadcast address: 172.18.89.255 +The Maximum Transmit Unit: 1500 bytes +input packets : 4039131, bytes : 161730660, multicasts : 3837772 +output packets : 26662892, bytes : 958605776, multicasts : 26461590 +TTL invalid packet number: 0 +ICMP packet input number: 0 + Echo reply: 0 + Unreachable: 0 + Source quench: 0 + Routing redirect: 0 + Echo request: 0 + Router advert: 0 + Router solicit: 0 + Time exceed: 0 + IP header bad: 0 + Timestamp request: 0 + Timestamp reply: 0 + Information request: 0 + Information reply: 0 + Netmask request: 0 + Netmask reply: 0 + Unknown type: 0 + +Vlan-interface206 current state: UP +Line protocol current state: UP +Internet Address is 172.18.41.22/24 Primary +Broadcast address: 172.18.41.255 +The Maximum Transmit Unit: 1500 bytes +input packets : 119165288, bytes : 674934354, multicasts : 115953989 +output packets : 54858945, bytes : 3307003635, multicasts : 51601052 +TTL invalid packet number: 3 +ICMP packet input number: 2744265 + Echo reply: 50 + Unreachable: 17 + Source quench: 0 + Routing redirect: 0 + Echo request: 2744198 + Router advert: 0 + Router solicit: 0 + Time exceed: 0 + IP header bad: 0 + Timestamp request: 0 + Timestamp reply: 0 + Information request: 0 + Information reply: 0 + Netmask request: 0 + Netmask reply: 0 + Unknown type: 0 diff --git a/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.yml b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.yml new file mode 100644 index 0000000000..6fc50a464c --- /dev/null +++ b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface.yml @@ -0,0 +1,31 @@ +--- +parsed_sample: + - intf: "LoopBack0" + ipaddr: + - "172.18.255.63/32" + mtu: "1536" + line_status: "UP" + protocol_status: "UP(spoofing)" + - intf: "M-GigabitEthernet0/0/0" + ipaddr: [] + mtu: '' + line_status: "Administratively DOWN" + protocol_status: "DOWN" + - intf: "Vlan-interface66" + ipaddr: + - "172.18.69.101/24" + mtu: "1500" + line_status: "UP" + protocol_status: "UP" + - intf: "Vlan-interface89" + ipaddr: + - "172.18.89.3/24" + mtu: "1500" + line_status: "UP" + protocol_status: "UP" + - intf: "Vlan-interface206" + ipaddr: + - "172.18.41.22/24" + mtu: "1500" + line_status: "UP" + protocol_status: "UP"