From df7c04bb5871e39bbce4213f2b990e284f3b2d1a Mon Sep 17 00:00:00 2001 From: Edouard Lavaud Date: Mon, 14 Nov 2022 11:15:01 +0100 Subject: [PATCH] Fix huawei display acl all - port numbers replaced by names --- .../templates/huawei_vrp_display_acl_all.textfsm | 4 ++-- .../huawei_vrp_display_acl_all_1.raw | 5 +++-- .../huawei_vrp_display_acl_all_1.yml | 14 +++++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm b/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm index 99abc7b538..1845c472d1 100644 --- a/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm +++ b/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm @@ -5,10 +5,10 @@ Value ACTION (deny|permit) Value PROTOCOL (\d+|icmp(v6)?|tcp|udp|gre|igmp|ip(v6)?|ipinip|ospf) Value SOURCE (((\d+.){3}\d+|[0-9a-fA-F]{1,4}([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4})[\/\s]((\d+.){3}\d+|\d+)) Value SOURCE_PORT_MODIFIER (eq|lt|gt|range) -Value SOURCE_PORT_RANGE ((\d+)(\s(\d+))?) +Value SOURCE_PORT_RANGE ((\S+)(\s(\S+))?) Value DESTINATION (((\d+.){3}\d+|[0-9a-fA-F]{1,4}([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4})[\/\s]((\d+.){3}\d+|\d+)) Value DESTINATION_PORT_MODIFIER (eq|lt|gt|range) -Value DESTINATION_PORT_RANGE ((\d+)(\s(\d+))?) +Value DESTINATION_PORT_RANGE ((\S+)(\s(\S+))?) Value MATCHES (\d+) Start diff --git a/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.raw b/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.raw index 6ec7cf3945..94e2b59260 100644 --- a/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.raw +++ b/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.raw @@ -17,8 +17,9 @@ Acl's step is 5 Advanced ACL REGLE_NAT 3998, 3 rules Acl's step is 5 rule 5 permit tcp source 85.14.167.234 0 destination 192.214.198.156 0 destination-port eq 8022 (18 matches) - rule 10 deny tcp destination 192.214.198.156 0 destination-port eq 8022 (8 matches) - rule 15 permit ip (278450 matches) + rule 10 deny tcp destination 192.214.198.156 0 destination-port eq www (8 matches) + rule 15 deny tcp destination 192.23.26.1 0.0.255.255 destination-port range 50 80 (8 matches) + rule 20 permit ip (278450 matches) Advanced ACL qsdqsd 3999, 0 rule Acl's step is 5 diff --git a/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.yml b/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.yml index b3fcf986f2..31f9759c71 100644 --- a/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.yml +++ b/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_all_1.yml @@ -118,11 +118,23 @@ parsed_sample: source_port_range: "" destination: "192.214.198.156 0" destination_port_modifier: "eq" - destination_port_range: "8022" + destination_port_range: "www" matches: "8" - acl_name: "REGLE_NAT" acl_number: "3998" sn: "15" + action: "deny" + protocol: "tcp" + source: "" + source_port_modifier: "" + source_port_range: "" + destination: "192.23.26.1 0.0.255.255" + destination_port_modifier: "range" + destination_port_range: "50 80" + matches: "8" + - acl_name: "REGLE_NAT" + acl_number: "3998" + sn: "20" action: "permit" protocol: "ip" source: ""