-
Notifications
You must be signed in to change notification settings - Fork 756
Update Huawei VRP display vlan #2016
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
Open
evilmonkey19
wants to merge
9
commits into
networktocode:master
Choose a base branch
from
evilmonkey19:huawei_vrp_display_vlan
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
590c5c0
Updating template Huawei VRP: `display vlan`
evilmonkey19 8f549de
Merging AP vlan, simplifying terms
evilmonkey19 a6ff16d
Update ntc_templates/templates/huawei_vrp_display_vlan.textfsm
evilmonkey19 29eb413
Draft
evilmonkey19 1a2ea36
Fixing `display vlan` and adding command `display vlan brief`
evilmonkey19 56dbb7f
Merge branch 'master' into huawei_vrp_display_vlan
mjbear 8ae80fc
Remove blank line - huawei_vrp_display_vlan_brief.textfsm
mjbear 497c95f
Move duplicate s char out of OR condition
mjbear 4706f9d
Improving template with new test case. (No breaking change)
evilmonkey19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,57 @@ | ||
Value Filldown VLAN_ID (\d+) | ||
Value Filldown VLAN_TYPE (\w+) | ||
Value Filldown MODE ((TG|UT)) | ||
Value INTERFACE ([A-Z0-9/th\-runk]+) | ||
Value VLAN_NAME (.+) | ||
# Complement huawei_vrp_display_vlan_brief.textfsm | ||
Value Key,Required VLAN_ID (\d+) | ||
Value VLAN_TYPE (\S+) | ||
Value VLAN_STATUS (\S+) | ||
Value VLAN_MAC_LEARNING (\S+) | ||
Value VLAN_DESCRIPTION (\S+|\S.+\S) | ||
Value VLAN_PROPERTY (\S+) | ||
Value VLAN_BROADCAST (\S+) | ||
Value VLAN_MULTICAST (\S+) | ||
Value VLAN_UNICAST (\S+) | ||
Value VLAN_STATISTICS (\S+) | ||
|
||
Start | ||
^The\s+total\s+number\s+of\s+VLANs | ||
^-+$$ | ||
^U:\s+Up;\s+D:\s+Down;\s+TG:\s+Tagged;\s+UT:\s+Untagged; | ||
^MP:\s+Vlan-mapping;\s+ST:\s+Vlan-stacking; | ||
^#:\s+ProtocolTransparent-vlan;\s+\*:\s+Management-vlan; | ||
^VID\s+Type\s+Ports -> VLANS | ||
^VID\s+Status\s+Property -> STATUS | ||
^\s*\*\s+:\s+management-vlan\s*$$ | ||
^\s*The\s+total\s+number\s+of\s+(VLAN|vlan)s\s+is\s*:\s+\d+\s*$$ | ||
^\s*-+\s*$$ | ||
^\s*U:\s*Up;\s*D:\s*Down;\s*TG:\s*Tagged;\s*UT:\s*Untagged;\s*$$ | ||
^\s*MP:\s+Vlan-mapping;\s+ST:\s+Vlan-stacking;\s*$$ | ||
^\s*#:\s+ProtocolTransparent-vlan;\s+\*:\s+Management-vlan;\s*$$ | ||
^\s*MAC-LRN:\s+MAC-address\s+learning;\s+STAT:\s+Statistic;\s*$$ | ||
^\s*BC:\s+Broadcast;\s+MC:\s+Multicast;\s+UC:\s+Unknown-unicast;\s*$$ | ||
^\s*FWD:\s+Forward;\s+DSD:\s+Discard;\s*$$ | ||
^\s*VID\s+(?:Type\s+)?Ports\s*$$ -> VLANS_SW | ||
^\s*VID\s+Name\s+Status\s+Ports\s*$$ -> VLANS_AP | ||
^\s*VID\s+Status\s+Property\s+MAC\-LRN\s+Statistics\s+Description\s*$$ -> STATUS_SW | ||
^\s*VID\s+Type\s+Status\s+Property\s+MAC\-LRN\s+STAT\s+BC\s+MC\s+UC\s+Description\s*$$ -> STATUS_SW_2 | ||
^\s*VLAN\s+ID\s+Type\s+Status\s+MAC\s+Learning\s+Broadcast\/Multicast\/Unicast\s+Property\s*$$ -> STATUS_AP | ||
^. -> Error | ||
|
||
VLANS | ||
^-+$$ | ||
^${VLAN_ID}\s+${VLAN_TYPE}\s*$$ -> Record | ||
^${VLAN_ID}\s+${VLAN_TYPE}\s+${MODE}:${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^${VLAN_ID}\s+${VLAN_TYPE}\s+${MODE}:(?:\S+\s+){1}\s+${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^${VLAN_ID}\s+${VLAN_TYPE}\s+${MODE}:(?:\S+\s+){2}\s+${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^${VLAN_ID}\s+${VLAN_TYPE}\s+${MODE}:(?:\S+\s+){3}\s+${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^${VLAN_ID}\s+${VLAN_TYPE}\s+${MODE}:(?:\S+\s+){4}\s+${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^\d+ | ||
^\s{6,}${MODE}:${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^\s{6,}${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^\s{6,}(?:\S+\s+){1}${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^\s{6,}(?:\S+\s+){2}${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^\s{6,}(?:\S+\s+){3}${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^\s{6,}(?:\S+\s+){4}${INTERFACE}\(\w+\)\s* -> Continue.Record | ||
^\s{6,} | ||
VLANS_SW | ||
^\s*-+\s*$$ | ||
^\s*\d+\s+ | ||
^\s+\S+ | ||
^\s*$$ -> Start | ||
^. -> Error | ||
|
||
VLANS_AP | ||
^\s*-+\s*$$ | ||
^\s*\d+\s+ | ||
^\s+\S+ | ||
^\s*$$ -> Start | ||
^. -> Error | ||
|
||
STATUS_SW | ||
^\s*-+\s*$$ | ||
^\s*${VLAN_ID}\s+${VLAN_STATUS}\s+${VLAN_PROPERTY}\s+${VLAN_MAC_LEARNING}\s+${VLAN_STATISTICS}\s+${VLAN_DESCRIPTION}\s*$$ -> Record | ||
^. -> Error | ||
|
||
STATUS_SW_2 | ||
^\s*-+\s*$$ | ||
^\s*${VLAN_ID}\s+${VLAN_TYPE}\s+${VLAN_STATUS}\s+${VLAN_PROPERTY}\s+${VLAN_MAC_LEARNING}\s+${VLAN_STATISTICS}\s+${VLAN_BROADCAST}\s+${VLAN_MULTICAST}\s+${VLAN_UNICAST}\s+${VLAN_DESCRIPTION}\s*$$ -> Record | ||
^. -> Error | ||
|
||
STATUS | ||
^-+$$ -> Clearall | ||
^${VLAN_ID}\s+${VLAN_STATUS}\s+\S+\s+\S+\s+\S+\s+${VLAN_NAME} -> Continue.Record | ||
^\d+ -> Clearall | ||
STATUS_AP | ||
^\s*-+\s*$$ | ||
^\s*${VLAN_ID}\s+${VLAN_TYPE}\s+${VLAN_STATUS}\s+${VLAN_MAC_LEARNING}\s+${VLAN_BROADCAST}\s+${VLAN_MULTICAST}\s+${VLAN_UNICAST}\s+${VLAN_PROPERTY}\s*$$ -> Record | ||
^. -> Error |
64 changes: 64 additions & 0 deletions
64
ntc_templates/templates/huawei_vrp_display_vlan_brief.textfsm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Value Key,Required,Filldown VLAN_ID (\d+) | ||
Value Filldown VLAN_NAME (\w.+\w|\w+) | ||
Value Filldown MODE ((TG|UT)) | ||
Value Filldown VLAN_STATUS ((enable|disable)) | ||
Value Filldown VLAN_TYPE ((common|uncommon)) | ||
Value List INTERFACE ([\w+\.\-\/]+) | ||
Value List INTERFACE_STATUS ((U|D)) | ||
|
||
Start | ||
^\s*\*\s+:\s+management-vlan\s*$$ | ||
^\s*The\s+total\s+number\s+of\s+(VLAN|vlan)s\s+is\s*:\s+\d+\s*$$ | ||
^\s*-+\s*$$ | ||
^\s*U:\s*Up;\s*D:\s*Down;\s*TG:\s*Tagged;\s*UT:\s*Untagged;\s*$$ | ||
^\s*MP:\s+Vlan-mapping;\s+ST:\s+Vlan-stacking;\s*$$ | ||
^\s*#:\s+ProtocolTransparent-vlan;\s+\*:\s+Management-vlan;\s*$$ | ||
^\s*MAC-LRN:\s+MAC-address\s+learning;\s+STAT:\s+Statistic;\s*$$ | ||
^\s*BC:\s+Broadcast;\s+MC:\s+Multicast;\s+UC:\s+Unknown-unicast;\s*$$ | ||
^\s*FWD:\s+Forward;\s+DSD:\s+Discard;\s*$$ | ||
^\s*VID\s+(?:Type\s+)?Ports\s*$$ -> VLANS_SW | ||
^\s*VID\s+Name\s+Status\s+Ports\s*$$ -> VLANS_AP | ||
^\s*VID\s+(?:Type\s+)?Status\s+Property\s+MAC\-LRN\s+(STAT|Statistics)\s+(?:BC\s+)?(?:MC\s+)?(?:UC\s+)?Description\s*$$ -> STATUS_SW | ||
^\s*VLAN\s+ID\s+Type\s+Status\s+MAC\s+Learning\s+Broadcast\/Multicast\/Unicast\s+Property\s*$$ -> STATUS_AP | ||
^. -> Error | ||
|
||
VLANS_SW | ||
^\d+ -> Continue.Record | ||
^\s+(UT|TG): -> Continue.Record | ||
^\s*${VLAN_ID}\s+(?:${VLAN_TYPE}\s+)? -> Continue | ||
^.+(?:(-|common|uncommon)\s+)?${MODE}:\s*${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^.+(?:(-|common|uncommon)\s+)?(UT|TG):\s*[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^.+(?:(-|common|uncommon)\s+)?(UT|TG):\s*[\w+\.\-\/\(\)]+\s+[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^.+(?:(-|common|uncommon)\s+)?(UT|TG):\s*[\w+\.\-\/\(\)]+\s+[\w+\.\-\/\(\)]+\s+[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\s+${MODE}:\s*[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\s+(UT|TG):\s*[\w+\.\-\/\(\)]+\s+[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\s+(UT|TG):\s*[\w+\.\-\/\(\)]+\s+[\w+\.\-\/\(\)]+\s+[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\s+[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\d+ | ||
^\s+\S+ | ||
^\s*-+\s*$$ | ||
^\s*$$ -> Start | ||
^. -> Error | ||
|
||
VLANS_AP | ||
^\d+ -> Continue.Record | ||
^\s*${VLAN_ID}\s+(?:${VLAN_NAME}\s+)?${VLAN_STATUS}\s+ -> Continue | ||
^.+(-|enable|disable)\s+${MODE}:\s*${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^.+(-|enable|disable)\s+(UT|TG):\s+[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^.+(-|enable|disable)\s+(UT|TG):\s+[\w+\.\-\/\(\)]+\s+[\w+\.\-\/\(\)]+\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\s+${INTERFACE}\(${INTERFACE_STATUS}\)\s* -> Continue | ||
^\d+ | ||
^\s+\S+ | ||
^\s*-+\s*$$ | ||
^. -> Error | ||
|
||
STATUS_SW | ||
^\s*-+\s*$$ | ||
^\s*\d+\s+\w+\s+\w+\s+\w+\s+\w+\s+\S.+\S\s*$$ | ||
^. -> Error | ||
|
||
STATUS_AP | ||
^\s*-+\s*$$ | ||
^\s*\d+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s+\S+\s*$$ | ||
^. -> Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evilmonkey19
What do you think about consolidating some of the repeated and optional chars for BC, MC, UC?
Edit: This could allow for BC BC to be supported, but that's not likely. 😅
If you think this is too complex we can avoid it.