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

Fixing bug related to Huawei SmartAX template description #1985

Open
wants to merge 6 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Value Required FSP (\w+\/\s\w+\/\w+)
# Template related to huawei_smartax_display_ont_info_description.textfsm
Value Required,Key FSP (\w+\/\s\w+\/\w+)
Value Key ONT_ID (\d+)
Value SERIAL_NUMBER ([A-Z0-9]{16})
Value CONTROL_FLAG (active|deactive|configuring)
Expand All @@ -9,13 +10,21 @@ Value PROTECT_SIDE (no|yes)

Start
^\s+-
^\s+F\/S\/P\s+ONT\s+SN\s+Control\s+Run\s+Config\s+Match\s+Protect
^\s+ID\s+flag\s+state\s+state\s+state\s+side -> SNs
^.\s*$$ -> Error
^\s+$$
^\s+F\/S\/P\s+ONT\s+SN\s+Control\s+Run\s+Config\s+Match\s+Protect\s*$$
^\s+ID\s+flag\s+state\s+state\s+state\s+side\s*$$ -> SNs
^. -> Error

SNs
^\s*${FSP}\s*${ONT_ID}\s*${SERIAL_NUMBER}\s*${CONTROL_FLAG}\s*(-|${RUN_STATE})\s*(-|${CONFIG_STATE})\s*(-|${MATCH_STATE})\s*${PROTECT_SIDE}\s* -> Record
^\s*-
^\s*F\/S\/P\s+(ONT|ONT-ID)\s+Description
^\s+-
^\s*${FSP}\s*${ONT_ID}\s*${SERIAL_NUMBER}\s*${CONTROL_FLAG}\s*(-|${RUN_STATE})\s*(-|${CONFIG_STATE})\s*(-|${MATCH_STATE})\s*${PROTECT_SIDE}\s*$$ -> Record
^\s*F\/S\/P\s+ONT(-ID)?\s+Description\s*$$ -> Descriptions
^\s*$$
^.-> Error

Descriptions
^\s+-
^\s*ID\s*$$
^\s+\w+\/\s\w+\/\w+\s+\d+\s+.+?\s*$$
^\s+In\s+port\s+\w+\/\s*\w+\/\w+\s*,\s+the\s+total(\s*number)?\s+of\s+ONTs\s+(is|are):\s+\w+(\,\s*online:\s*\w+)?(\,\s*offline:\s*\w+)? -> Start
^. -> Error
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
Value Required FSP (\w+\/\s\w+\/\w+)
# Template related to huawei_smartax_display_ont_info_0_1_2.textfsm
Value Key,Required FSP (\w+\/\s\w+\/\w+)
Value Key ONT_ID (\d+)
Value DESCRIPTION (.+?)


Start
^\s+F\/S\/P\s+(ONT|ONT-ID)\s+Description -> Descriptions
^\s+-
^\s+$$
^\s+F\/S\/P\s+ONT\s+SN\s+Control\s+Run\s+Config\s+Match\s+Protect\s*$$
^\s+ID\s+flag\s+state\s+state\s+state\s+side\s*$$ -> SNs
^. -> Error

SNs
^\s+-
^\s*\w+\/\s\w+\/\w+\s*\d+\s*([A-Z0-9]{16})\s*(active|deactive|configuring)\s*(-|online|offline)\s*(-|normal|mismatch|failing|online|initial)\s*(-|initial|mismatch|match)\s*(no|yes)\s*$$
^\s*F\/S\/P\s+ONT(-ID)?\s+Description\s*$$ -> Descriptions
^\s*$$
^.-> Error

Descriptions
^\s+ID
^\s+-
^\s*ID\s*$$
^\s+${FSP}\s+${ONT_ID}\s+${DESCRIPTION}\s*$$ -> Record
^\s+In\s+port\s+\w+\/\s*\w+\/\w+\s*,\s+the\s+total(\s*number)?\s+of\s+ONTs\s+(is|are):\s+\w+(\,\s*online:\s*\w+)?(\,\s*offline:\s*\w+)? -> EOF
^. -> Error
^\s+In\s+port\s+\w+\/\s*\w+\/\w+\s*,\s+the\s+total(\s*number)?\s+of\s+ONTs\s+(is|are):\s+\w+(\,\s*online:\s*\w+)?(\,\s*offline:\s*\w+)? -> Start
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parsed_sample:
serial_number: "46VBSM4LFW7QLGAV"
- config_state: "normal"
control_flag: "active"
description: "The boiling consignment budgets."
description: "ONT_NO_DESCRIPTION"
fsp: "0/ 1/2"
match_state: "match"
ont_id: "0"
Expand Down