Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipv6 support #1905

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ntc_templates/templates/cisco_ios_show_object-group.textfsm
Original file line number Diff line number Diff line change
@@ -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+)

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsoleted by brunopeter/pull/1

Value PORT_MATCH (eq|neq|range|lt|gt)
Value PORT ((?<!range\s)\S+)
Value PORT_RANGE_START ((?<=range\s)\S+)
Value PORT_RANGE_END (\S+)
Value ICMP_TYPE (echo|echo-reply|administratively-prohibited|unreachable|port-unreachable|redirect|router-advertisement|router-solicitation|packet-too-big|time-exceeded|ttl-exceeded|parameter-problem)
Value ICMP6_TYPE (dhaad-reply|dhaad-request|echo-reply|echo-request|mld-query|mld-reduction|mld-report|mld-v2-report|mpd-advertisement|mpd-solicitation|nd-na|nd-ns|packet-too-big|parameter-problem|redirect|router-advertisement|router-renumbering|router-solicitation|time-exceeded|unreachable)

Start
^(Service|Network) -> 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

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsoleted by brunopeter/pull/1

^\s+${PROTOCOL}\s+${PORT_MATCH}\s+(${PORT_RANGE_START}\s+${PORT_RANGE_END}|${PORT})\s*$$ -> Record
^\s+${PROTOCOL}\s*$$ -> Record
^\s*$$
^. -> Error

EOF

Original file line number Diff line number Diff line change
@@ -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
138 changes: 138 additions & 0 deletions tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
parsed_sample:
- ANY: ""
DESCRIPTION: ""
HOST: ""
HOST_RANGE_END: ""
HOST_RANGE_START: ""
ICMP6_TYPE: ""
ICMP_TYPE: ""
NAME: TEST-v6-icmp

Check failure on line 10 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

10:11 [quoted-strings] string value is not quoted with double quotes
NESTED_GROUPS: ""
NETMASK: ""
NETWORK: ""
PORT: ""
PORT_MATCH: ""
PORT_RANGE_END: ""
PORT_RANGE_START: ""
PROTOCOL: ""
TYPE: V6-Service

Check failure on line 19 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

19:11 [quoted-strings] string value is not quoted with double quotes
- ANY: ""
DESCRIPTION: ""
HOST: ""
HOST_RANGE_END: ""
HOST_RANGE_START: ""
ICMP6_TYPE: echo-request

Check failure on line 25 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

25:17 [quoted-strings] string value is not quoted with double quotes
ICMP_TYPE: ""
NAME: TEST-v6-icmp

Check failure on line 27 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

27:11 [quoted-strings] string value is not quoted with double quotes
NESTED_GROUPS: ""
NETMASK: ""
NETWORK: ""
PORT: ""
PORT_MATCH: ""
PORT_RANGE_END: ""
PORT_RANGE_START: ""
PROTOCOL: ""
TYPE: V6-Service

Check failure on line 36 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

36:11 [quoted-strings] string value is not quoted with double quotes
- ANY: ""
DESCRIPTION: ""
HOST: ""
HOST_RANGE_END: ""
HOST_RANGE_START: ""
ICMP6_TYPE: ""
ICMP_TYPE: echo-reply

Check failure on line 43 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

43:16 [quoted-strings] string value is not quoted with double quotes
NAME: TEST-v6-icmp

Check failure on line 44 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

44:11 [quoted-strings] string value is not quoted with double quotes
NESTED_GROUPS: ""
NETMASK: ""
NETWORK: ""
PORT: ""
PORT_MATCH: ""
PORT_RANGE_END: ""
PORT_RANGE_START: ""
PROTOCOL: ""
TYPE: V6-Service

Check failure on line 53 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

53:11 [quoted-strings] string value is not quoted with double quotes
- ANY: ""
DESCRIPTION: ""
HOST: ""
HOST_RANGE_END: ""
HOST_RANGE_START: ""
ICMP6_TYPE: ""
ICMP_TYPE: ""
NAME: TEST-v6-obj

Check failure on line 61 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

61:11 [quoted-strings] string value is not quoted with double quotes
NESTED_GROUPS: ""
NETMASK: ""
NETWORK: ""
PORT: ""
PORT_MATCH: ""
PORT_RANGE_END: ""
PORT_RANGE_START: ""
PROTOCOL: ""
TYPE: V6-Network

Check failure on line 70 in tests/cisco_ios/show_object-group/cisco_ios_show_object-group-v6.yml

View workflow job for this annotation

GitHub Actions / yamllint

70:11 [quoted-strings] string value is not quoted with double quotes
- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TYPE: V6-Network
TYPE: V6-Network

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the TYPE be a double quoted string too?

TYPE: "V6-Network"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be obsoleted by brunopeter/pull/1

Comment on lines +10 to +138

This comment was marked as outdated.

Copy link
Contributor

@mjbear mjbear Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunopeter
I didn't realize this until now, but the keys in your YAML are in uppercase but they should be lowercase.

I'm going to work up a PR against your ipv6-support branch that you can easily merge in to fix this up.
Thank you!

Copy link
Contributor

@mjbear mjbear Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Canceling/hiding this inline review as they're obsoleted by brunopeter/pull/1
Please review that PR and merge it in. Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunopeter I think the fixes in this PR should have the tests ready to go through CI