From 103c2f16b44cae1d158321942f81b2718067fffd Mon Sep 17 00:00:00 2001 From: Edouard Lavaud Date: Wed, 16 Nov 2022 05:35:21 +0100 Subject: [PATCH] Huawei - display acl all - add rule description --- .../templates/huawei_vrp_display_acl_all.textfsm | 13 +++++++++---- .../huawei_vrp_display_acl_all_1.raw | 1 + .../huawei_vrp_display_acl_all_1.yml | 13 +++++++++++++ .../huawei_vrp_display_acl_ipv6_all_1.yml | 3 +++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm b/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm index ee3937f0a5..c1c0afc68f 100644 --- a/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm +++ b/ntc_templates/templates/huawei_vrp_display_acl_all.textfsm @@ -1,7 +1,7 @@ Value Filldown ACL_NAME (.*?) Value Filldown ACL_NUMBER (\d+) Value Required SN (\d+) -Value ACTION (deny|permit) +Value Required 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) @@ -10,13 +10,18 @@ Value DESTINATION (((\d+.){3}\d+|[0-9a-fA-F]{1,4}([0-9a-fA-F]{0,4}:){1,7}[0-9a-f Value DESTINATION_PORT_MODIFIER (eq|lt|gt|range) Value DESTINATION_PORT_RANGE ((\S+)(\s(\S+))?) Value MATCHES (\d+) +Value DESCRIPTION (.*) Start + ^\s*rule\s\d+\s(deny|permit) -> Continue.Record + ^\S+\sIPv6\sACL\s -> Continue.Record + ^\S+\sACL\s -> Continue.Record ^\s*Total\squantity\sof\snonempty\sACL\snumber\sis\s\d+\s*$$ ^\s*Total\snonempty\sacl6\snumber\sis\s\d+\s*$$ - ^\S+\sIPv6\sACL\s${ACL_NUMBER}(\sname\s${ACL_NAME})?,\s\d+.*$$ - ^\S+\sACL\s(${ACL_NAME}\s)?${ACL_NUMBER},\s\d+.*$$ + ^\S+\sIPv6\sACL\s${ACL_NUMBER}(\sname\s${ACL_NAME})?,\s\d+\srules?.*$$ + ^\S+\sACL\s(${ACL_NAME}\s)?${ACL_NUMBER},\s\d+\srules?.*$$ ^\s*Acl's\sstep\sis\s\d+\s*$$ - ^\s*rule\s${SN}\s${ACTION}(\s${PROTOCOL})?(\ssource\s${SOURCE})?(\ssource-port\s${SOURCE_PORT_MODIFIER}\s${SOURCE_PORT_RANGE})?(\sdestination\s${DESTINATION})?(\sdestination-port\s${DESTINATION_PORT_MODIFIER}\s${DESTINATION_PORT_RANGE})?(\s\(${MATCHES}\smatch(es)?\))?\s*$$ -> Record + ^\s*rule\s${SN}\s${ACTION}(\s${PROTOCOL})?(\ssource\s${SOURCE})?(\ssource-port\s${SOURCE_PORT_MODIFIER}\s${SOURCE_PORT_RANGE})?(\sdestination\s${DESTINATION})?(\sdestination-port\s${DESTINATION_PORT_MODIFIER}\s${DESTINATION_PORT_RANGE})?(\s\(${MATCHES}\smatch(es)?\))?\s*$$ + ^\s*rule\s\d+\sdescription\s"${DESCRIPTION}"\s*$$ ^\s*$$ ^. -> Error 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 622e0f45e4..e9754b9a0e 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,6 +17,7 @@ Acl's step is 5 Advanced ACL 3997, 1 rule Acl's step is 5 rule 5 permit ip source 192.165.3.5 0 + rule 5 description "qsdqsdqsdqsdqsdqsdqs az" Advanced ACL REGLE_NAT 3998, 3 rules 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 1aa1fa3bde..22e85ac789 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 @@ -12,6 +12,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "94" + description: "" - acl_name: "" acl_number: "2000" sn: "10" @@ -24,6 +25,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "26939" + description: "" - acl_name: "" acl_number: "2000" sn: "15" @@ -36,6 +38,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "24" + description: "" - acl_name: "" acl_number: "2000" sn: "20" @@ -48,6 +51,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: "" - acl_name: "" acl_number: "2000" sn: "25" @@ -60,6 +64,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: "" - acl_name: "" acl_number: "2000" sn: "30" @@ -72,6 +77,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: "" - acl_name: "" acl_number: "2000" sn: "35" @@ -84,6 +90,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: "" - acl_name: "" acl_number: "2500" sn: "35" @@ -96,6 +103,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "5431" + description: "" - acl_name: "" acl_number: "3997" sn: "5" @@ -108,6 +116,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: "qsdqsdqsdqsdqsdqsdqs az" - acl_name: "REGLE_NAT" acl_number: "3998" sn: "5" @@ -120,6 +129,7 @@ parsed_sample: destination_port_modifier: "eq" destination_port_range: "8022" matches: "18" + description: "" - acl_name: "REGLE_NAT" acl_number: "3998" sn: "10" @@ -132,6 +142,7 @@ parsed_sample: destination_port_modifier: "eq" destination_port_range: "www" matches: "8" + description: "" - acl_name: "REGLE_NAT" acl_number: "3998" sn: "15" @@ -144,6 +155,7 @@ parsed_sample: destination_port_modifier: "range" destination_port_range: "50 80" matches: "8" + description: "" - acl_name: "REGLE_NAT" acl_number: "3998" sn: "20" @@ -156,3 +168,4 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "278450" + description: "" diff --git a/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_ipv6_all_1.yml b/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_ipv6_all_1.yml index a663d42a70..4f96e83082 100644 --- a/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_ipv6_all_1.yml +++ b/tests/huawei_vrp/display_acl_all/huawei_vrp_display_acl_ipv6_all_1.yml @@ -12,6 +12,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: "" - acl_name: "MyACL_IPv6" acl_number: "3999" sn: "5" @@ -24,6 +25,7 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: "" - acl_name: "MyACL_IPv6" acl_number: "3999" sn: "10" @@ -36,3 +38,4 @@ parsed_sample: destination_port_modifier: "" destination_port_range: "" matches: "" + description: ""