diff --git a/ntc_templates/templates/cisco_ios_show_object-group.textfsm b/ntc_templates/templates/cisco_ios_show_object-group.textfsm index cce83b80fc..fe2f46313d 100644 --- a/ntc_templates/templates/cisco_ios_show_object-group.textfsm +++ b/ntc_templates/templates/cisco_ios_show_object-group.textfsm @@ -1,31 +1,31 @@ -Value Required,Filldown TYPE (Service|Network) +Value Required,Filldown TYPE (Service|Network|V6-Service|V6-Network) Value Required,Filldown NAME (\S+) Value DESCRIPTION (.+) Value NESTED_GROUPS (\S+) Value ANY (any) -Value HOST (\d+\.\d+\.\d+\.\d+) +Value HOST (((\d+\.\d+\.\d+\.\d+)|([A-Fa-f0-9:]+:+)+[A-Fa-f0-9]+)) Value HOST_RANGE_START (\d+\.\d+\.\d+\.\d+) Value HOST_RANGE_END (\d+\.\d+\.\d+\.\d+) -Value NETWORK (\d+\.\d+\.\d+\.\d+) -Value NETMASK (\d+\.\d+\.\d+\.\d+) +Value NETWORK ((\d+\.\d+\.\d+\.\d+)|([A-Fa-f0-9:]+:+[A-Fa-f0-9:]+)) +Value NETMASK ((\d+\.\d+\.\d+\.\d+)|((?:\d{1,3}))) Value PROTOCOL (\S+) Value PORT_MATCH (eq|neq|range|lt|gt) Value PORT ((? Continue.Clearall + ^(Service|Network|V6-Service|V6-Network) -> Continue.Clearall ^${TYPE}\s+object\s+group\s+${NAME}\s*$$ -> Record ^\s+Description\s+${DESCRIPTION}$$ -> Record ^\s+group-object\s+${NESTED_GROUPS}\s*$$ -> Record - ^\s+(host\s+${HOST}|range\s+${HOST_RANGE_START}\s+${HOST_RANGE_END}|${ANY}|${NETWORK}\s+${NETMASK})\s*$$ -> Record - ^\s+icmp\s+${ICMP_TYPE}\s*$$ -> Record + ^\s+(host\s+${HOST}|range\s+${HOST_RANGE_START}\s+${HOST_RANGE_END}|${ANY}|${NETWORK}\s*/?${NETMASK})\s*$$ -> Record + ^\s+icmp\s+(${ICMP_TYPE}|${ICMP6_TYPE})\s*$$ -> Record ^\s+${PROTOCOL}\s+${PORT_MATCH}\s+(${PORT_RANGE_START}\s+${PORT_RANGE_END}|${PORT})\s*$$ -> Record ^\s+${PROTOCOL}\s*$$ -> Record ^\s*$$ ^. -> Error EOF - diff --git a/tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.raw b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.raw new file mode 100644 index 0000000000..dd95f4f650 --- /dev/null +++ b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.raw @@ -0,0 +1,8 @@ +V6-Network object group TEST-v6-obj + host 2001:db8::1:1111 + host 2001:db8::2:2222 + 2001:db8:111:1::/48 + 2001:db8:222:2::/48 +V6-Service object group TEST-v6-icmp + icmp echo-request + icmp echo-reply diff --git a/tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml new file mode 100644 index 0000000000..87fe4a5986 --- /dev/null +++ b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml @@ -0,0 +1,138 @@ +--- +parsed_sample: + - any: "" + description: "" + host: "" + host_range_end: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-v6-obj" + nested_groups: "" + netmask: "" + network: "" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Network" + - any: "" + description: "" + host: "2001:db8::1:1111" + host_range_end: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-v6-obj" + nested_groups: "" + netmask: "" + network: "" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Network" + - any: "" + description: "" + host: "2001:db8::2:2222" + host_range_end: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-v6-obj" + nested_groups: "" + netmask: "" + network: "" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Network" + - any: "" + description: "" + host: "" + host_range_end: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-v6-obj" + nested_groups: "" + netmask: "48" + network: "2001:db8:111:1::" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Network" + - any: "" + description: "" + host: "" + host_range_end: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-v6-obj" + nested_groups: "" + netmask: "48" + network: "2001:db8:222:2::" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Network" + - any: "" + description: "" + host: "" + host_range_end: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-v6-icmp" + nested_groups: "" + netmask: "" + network: "" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Service" + - any: "" + description: "" + host: "" + host_range_end: "" + host_range_start: "" + icmp6_type: "echo-request" + icmp_type: "" + name: "TEST-v6-icmp" + nested_groups: "" + netmask: "" + network: "" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Service" + - any: "" + description: "" + host: "" + host_range_end: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "echo-reply" + name: "TEST-v6-icmp" + nested_groups: "" + netmask: "" + network: "" + port: "" + port_match: "" + port_range_end: "" + port_range_start: "" + protocol: "" + type: "V6-Service" diff --git a/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml index 562100bd28..1f970527f6 100644 --- a/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml +++ b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml @@ -1,498 +1,529 @@ --- parsed_sample: - - type: "Network" - name: "NNNN" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "NNNN" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "SSSS" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "SSSS" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "" + type: "Service" + - any: "" description: "! Test Service Group !" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "echo-reply" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "echo-reply" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "tcp" - port_match: "eq" + network: "" port: "smtp" - port_range_start: "" + port_match: "eq" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "tcp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "udp" - port_match: "eq" + network: "" port: "tacacs" - port_range_start: "" + port_match: "eq" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "udp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "udp" - port_match: "range" + network: "" port: "" - port_range_start: "tacacs" + port_match: "range" port_range_end: "50" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "tacacs" + protocol: "udp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "tcp" - port_match: "range" + network: "" port: "" - port_range_start: "79" + port_match: "range" port_range_end: "www" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "79" + protocol: "tcp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "tcp" - port_match: "eq" + network: "" port: "www" - port_range_start: "" + port_match: "eq" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "tcp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "tcp" - port_match: "eq" + network: "" port: "81" - port_range_start: "" + port_match: "eq" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "tcp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "udp" - port_match: "lt" + network: "" port: "999" - port_range_start: "" + port_match: "lt" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "udp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "udp" - port_match: "gt" + network: "" port: "97" - port_range_start: "" + port_match: "gt" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "udp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "tcp-udp" - port_match: "range" + network: "" port: "" - port_range_start: "12200" + port_match: "range" port_range_end: "12700" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "12200" + protocol: "tcp-udp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "icmp" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "icmp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "tcp" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "tcp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "udp" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "udp" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "tcp-udp" - port_match: "range" + network: "" port: "" - port_range_start: "0" + port_match: "range" port_range_end: "65535" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "0" + protocol: "tcp-udp" + type: "Service" + - any: "" description: "" - nested_groups: "SSSS" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "SSSS" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "ip" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "ip" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "ipinip" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Service" - name: "TEST-SVC-OGR" + port_range_start: "" + protocol: "ipinip" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST-SVC-OGR" + nested_groups: "" netmask: "" - protocol: "99" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "TEST_NET_OGR" + port_range_start: "" + protocol: "99" + type: "Service" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST_NET_OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "TEST_NET_OGR" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "###TEST NETWORK OGR###" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST_NET_OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "TEST_NET_OGR" + port_range_start: "" + protocol: "" + type: "Network" + - any: "any" description: "" - nested_groups: "" - any: "any" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST_NET_OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "TEST_NET_OGR" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "" - nested_groups: "" - any: "" host: "1.1.1.1" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST_NET_OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "TEST_NET_OGR" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "2.2.2.2" host_range_end: "3.3.3.3" - network: "" + host_range_start: "2.2.2.2" + icmp6_type: "" + icmp_type: "" + name: "TEST_NET_OGR" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "TEST_NET_OGR" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "" - nested_groups: "NNNN" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST_NET_OGR" + nested_groups: "NNNN" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "TEST_NET_OGR" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "1.1.1.0" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "TEST_NET_OGR" + nested_groups: "" netmask: "255.255.255.0" - protocol: "" - port_match: "" + network: "1.1.1.0" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "XXXX" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "XXXX" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" - - type: "Network" - name: "YYYY" + port_range_start: "" + protocol: "" + type: "Network" + - any: "" description: "" - nested_groups: "" - any: "" host: "" - host_range_start: "" host_range_end: "" - network: "" + host_range_start: "" + icmp6_type: "" + icmp_type: "" + name: "YYYY" + nested_groups: "" netmask: "" - protocol: "" - port_match: "" + network: "" port: "" - port_range_start: "" + port_match: "" port_range_end: "" - icmp_type: "" + port_range_start: "" + protocol: "" + type: "Network"