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

Updating command in Alcatel AOS: show vlan #1931

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
31 changes: 19 additions & 12 deletions ntc_templates/templates/alcatel_aos_show_vlan.textfsm
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
Value VLAN_ID (\d+)
Value TYPE (std|vstk|gvrp|ipmv)
Value ADMIN_STATE (on|off)
Value OPERATIONAL_STATE (on|off)
Value SPANNING_TREE_1X1 (on|off)
Value SPANNING_TREE_FLAT (on|off)
Value AUTH (on|off)
Value IP_STATE (on|off)
Value MBLETAG (on|off)
Value SOURCE_LEARN (on|off)
Value VLAN_NAME ((\S+\s*)+\S+)
Value TYPE (\S+)
Value ADMIN_STATE (\S+)
Value OPERATIONAL_STATE (\S+)
Value SPANNING_TREE_1X1 (\S+)
Value SPANNING_TREE_FLAT (\S+)
Value AUTH (\S+)
Value IP_STATE (\S+)
Value MBLETAG (\S+)
Value SOURCE_LEARN (\S+)
Value MTU (\d+)
Value VLAN_NAME (\S.+\S)

Start
^\s*${VLAN_ID}\s+${TYPE}\s+${ADMIN_STATE}\s+${OPERATIONAL_STATE}\s+${SPANNING_TREE_1X1}\s+${SPANNING_TREE_FLAT}\s+${AUTH}\s+${IP_STATE}\s+${MBLETAG}\s+${SOURCE_LEARN}\s+${VLAN_NAME}\s*$$ -> Record
# R6 Version
^\s*stree\s+mble\s+src\s*$$
^\s*vlan\s+type\s+admin\s+oper\s+1x1\s+flat\s+auth\s+ip\s+tag\s+lrn\s+name\s*$$
^-----\+-----\+------\+------\+------\+------\+----\+-----\+-----\+------\+----------
# R8 Version
^\s*vlan\s+type\s+admin\s+oper\s+ip\s+mtu\s+name\s*$$
^\s*-+
# R6
^\s*${VLAN_ID}\s+${TYPE}\s+${ADMIN_STATE}\s+${OPERATIONAL_STATE}\s+${SPANNING_TREE_1X1}\s+${SPANNING_TREE_FLAT}\s+${AUTH}\s+${IP_STATE}\s+${MBLETAG}\s+${SOURCE_LEARN}\s+${VLAN_NAME}\s*$$ -> Record
# R8
^\s*${VLAN_ID}\s+${TYPE}\s+${ADMIN_STATE}\s+${OPERATIONAL_STATE}\s+${IP_STATE}\s+${MTU}\s+${VLAN_NAME}\s*$$ -> Record
^.*$$ -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parsed_sample:
auth: "off"
ip_state: "off"
mbletag: "off"
mtu: ""
operational_state: "on"
source_learn: "on"
spanning_tree_1x1: "on"
Expand All @@ -15,6 +16,7 @@ parsed_sample:
auth: "off"
ip_state: "off"
mbletag: "off"
mtu: ""
operational_state: "off"
source_learn: "on"
spanning_tree_1x1: "on"
Expand All @@ -26,6 +28,7 @@ parsed_sample:
auth: "off"
ip_state: "on"
mbletag: "off"
mtu: ""
operational_state: "on"
source_learn: "on"
spanning_tree_1x1: "on"
Expand All @@ -37,6 +40,7 @@ parsed_sample:
auth: "off"
ip_state: "on"
mbletag: "off"
mtu: ""
operational_state: "on"
source_learn: "on"
spanning_tree_1x1: "on"
Expand Down
4 changes: 4 additions & 0 deletions tests/alcatel_aos/show_vlan/alcatel_aos_show_vlan_R8.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vlan type admin oper ip mtu name
------+-------+-------+------+------+------+------------------
1 std Dis Dis Dis 1500 Vlan_1
4094 vcm Ena Dis Dis 1500 VCM IPC
26 changes: 26 additions & 0 deletions tests/alcatel_aos/show_vlan/alcatel_aos_show_vlan_R8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
parsed_sample:
- admin_state: "Dis"
auth: ""
ip_state: "Dis"
mbletag: ""
mtu: "1500"
operational_state: "Dis"
source_learn: ""
spanning_tree_1x1: ""
spanning_tree_flat: ""
type: "std"
vlan_id: "1"
vlan_name: "Vlan_1"
- admin_state: "Ena"
auth: ""
ip_state: "Dis"
mbletag: ""
mtu: "1500"
operational_state: "Dis"
source_learn: ""
spanning_tree_1x1: ""
spanning_tree_flat: ""
type: "vcm"
vlan_id: "4094"
vlan_name: "VCM IPC"