From 0a6de067169e8c7497861e543a2d8c42d7fbb80c Mon Sep 17 00:00:00 2001 From: Andrea Dainese Date: Wed, 29 Mar 2023 20:28:17 +0200 Subject: [PATCH] Fix hp_comware_display_ip_interface with production outputs (#1341) * Fix hp_comware_display_ip_interface with production outputs --- .../hp_comware_display_ip_interface.textfsm | 2 ++ .../hp_comware_display_ip_interface.yml | 5 ++++ .../hp_comware_display_ip_interface1.yml | 1 + .../hp_comware_display_ip_interface2.raw | 30 +++++++++++++++++++ .../hp_comware_display_ip_interface2.yml | 9 ++++++ 5 files changed, 47 insertions(+) create mode 100644 tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.raw create mode 100644 tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.yml diff --git a/ntc_templates/templates/hp_comware_display_ip_interface.textfsm b/ntc_templates/templates/hp_comware_display_ip_interface.textfsm index 6925412e0f..5d48b710b0 100644 --- a/ntc_templates/templates/hp_comware_display_ip_interface.textfsm +++ b/ntc_templates/templates/hp_comware_display_ip_interface.textfsm @@ -1,6 +1,7 @@ Value INTF (\S+) Value LINE_STATUS (UP|DOWN|Administratively DOWN) Value PROTOCOL_STATUS (UP(\(spoofing\))?|DOWN) +Value ROUTE_MAP (\S+) Value List IPADDR (\S+) Value MTU (\d+) @@ -18,6 +19,7 @@ Interface ^Internet\s+Address\s+is\s+${IPADDR}\s+Sub ^Broadcast\s+address\s*:\s*\S+ ^The\s+Maximum\s+Transmit\s+Unit\s*:\s*${MTU}\s+bytes + ^Policy\s+routing\s+is\s+enabled,\s+using\s+route\s+map\s+${ROUTE_MAP} ^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*:\s*\d+ 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 index 7804400d0e..b08687a82f 100644 --- 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 @@ -6,26 +6,31 @@ parsed_sample: mtu: "1536" line_status: "UP" protocol_status: "UP(spoofing)" + route_map: "" - intf: "M-GigabitEthernet0/0/0" ipaddr: [] mtu: "" line_status: "Administratively DOWN" protocol_status: "DOWN" + route_map: "" - intf: "Vlan-interface66" ipaddr: - "172.18.69.101/24" mtu: "1500" line_status: "UP" protocol_status: "UP" + route_map: "" - intf: "Vlan-interface89" ipaddr: - "172.18.89.3/24" mtu: "1500" line_status: "UP" protocol_status: "UP" + route_map: "" - intf: "Vlan-interface206" ipaddr: - "172.18.41.22/24" mtu: "1500" line_status: "UP" protocol_status: "UP" + route_map: "" diff --git a/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface1.yml b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface1.yml index d7e06a912e..523b777d57 100644 --- a/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface1.yml +++ b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface1.yml @@ -5,3 +5,4 @@ parsed_sample: mtu: "" line_status: "UP" protocol_status: "DOWN" + route_map: "" diff --git a/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.raw b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.raw new file mode 100644 index 0000000000..de935f77cc --- /dev/null +++ b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.raw @@ -0,0 +1,30 @@ +Route-Aggregation1.4 current state :UP +Line protocol current state :UP +Internet Address is 10.1.1.1/24 Primary +Broadcast address : 10.1.1.255 +The Maximum Transmit Unit : 1500 bytes +input packets : 519880114, bytes : 2114446514, multicasts : 1523365 +output packets : 892477481, bytes : 2635360909, multicasts : 1513360 +ARP packet input number: 4648 + Request packet: 9 + Reply packet: 4639 + Unknown packet: 0 +TTL invalid packet number: 1067079 +ICMP packet input number: 27 + Echo reply: 15 + Unreachable: 0 + Source quench: 0 + Routing redirect: 0 + Echo request: 0 + Router advert: 0 + Router solicit: 0 + Time exceed: 12 + 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 +Policy routing is enabled, using route map TO_INTERNET diff --git a/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.yml b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.yml new file mode 100644 index 0000000000..9181761445 --- /dev/null +++ b/tests/hp_comware/display_ip_interface/hp_comware_display_ip_interface2.yml @@ -0,0 +1,9 @@ +--- +parsed_sample: + - intf: "Route-Aggregation1.4" + ipaddr: + - "10.1.1.1/24" + mtu: "1500" + line_status: "UP" + protocol_status: "UP" + route_map: "TO_INTERNET"