Skip to content

Commit 50949b6

Browse files
authored
Adapting command to accept R8 and updating template to be more maintainable (#1931)
1 parent 4e86b2e commit 50949b6

File tree

5 files changed

+53
-12
lines changed

5 files changed

+53
-12
lines changed
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
Value VLAN_ID (\d+)
2-
Value TYPE (std|vstk|gvrp|ipmv)
3-
Value ADMIN_STATE (on|off)
4-
Value OPERATIONAL_STATE (on|off)
5-
Value SPANNING_TREE_1X1 (on|off)
6-
Value SPANNING_TREE_FLAT (on|off)
7-
Value AUTH (on|off)
8-
Value IP_STATE (on|off)
9-
Value MBLETAG (on|off)
10-
Value SOURCE_LEARN (on|off)
11-
Value VLAN_NAME ((\S+\s*)+\S+)
2+
Value TYPE (\S+)
3+
Value ADMIN_STATE (\S+)
4+
Value OPERATIONAL_STATE (\S+)
5+
Value SPANNING_TREE_1X1 (\S+)
6+
Value SPANNING_TREE_FLAT (\S+)
7+
Value AUTH (\S+)
8+
Value IP_STATE (\S+)
9+
Value MBLETAG (\S+)
10+
Value SOURCE_LEARN (\S+)
11+
Value MTU (\d+)
12+
Value VLAN_NAME (\S.+\S)
1213

1314
Start
14-
^\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
15+
# R6 Version
1516
^\s*stree\s+mble\s+src\s*$$
1617
^\s*vlan\s+type\s+admin\s+oper\s+1x1\s+flat\s+auth\s+ip\s+tag\s+lrn\s+name\s*$$
17-
^-----\+-----\+------\+------\+------\+------\+----\+-----\+-----\+------\+----------
18+
# R8 Version
19+
^\s*vlan\s+type\s+admin\s+oper\s+ip\s+mtu\s+name\s*$$
20+
^\s*-+
21+
# R6
22+
^\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
23+
# R8
24+
^\s*${VLAN_ID}\s+${TYPE}\s+${ADMIN_STATE}\s+${OPERATIONAL_STATE}\s+${IP_STATE}\s+${MTU}\s+${VLAN_NAME}\s*$$ -> Record
1825
^.*$$ -> Error

tests/alcatel_aos/show_vlan/alcatel_aos_show_vlan.yml renamed to tests/alcatel_aos/show_vlan/alcatel_aos_show_vlan_R6.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ parsed_sample:
44
auth: "off"
55
ip_state: "off"
66
mbletag: "off"
7+
mtu: ""
78
operational_state: "on"
89
source_learn: "on"
910
spanning_tree_1x1: "on"
@@ -15,6 +16,7 @@ parsed_sample:
1516
auth: "off"
1617
ip_state: "off"
1718
mbletag: "off"
19+
mtu: ""
1820
operational_state: "off"
1921
source_learn: "on"
2022
spanning_tree_1x1: "on"
@@ -26,6 +28,7 @@ parsed_sample:
2628
auth: "off"
2729
ip_state: "on"
2830
mbletag: "off"
31+
mtu: ""
2932
operational_state: "on"
3033
source_learn: "on"
3134
spanning_tree_1x1: "on"
@@ -37,6 +40,7 @@ parsed_sample:
3740
auth: "off"
3841
ip_state: "on"
3942
mbletag: "off"
43+
mtu: ""
4044
operational_state: "on"
4145
source_learn: "on"
4246
spanning_tree_1x1: "on"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vlan type admin oper ip mtu name
2+
------+-------+-------+------+------+------+------------------
3+
1 std Dis Dis Dis 1500 Vlan_1
4+
4094 vcm Ena Dis Dis 1500 VCM IPC
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
parsed_sample:
3+
- admin_state: "Dis"
4+
auth: ""
5+
ip_state: "Dis"
6+
mbletag: ""
7+
mtu: "1500"
8+
operational_state: "Dis"
9+
source_learn: ""
10+
spanning_tree_1x1: ""
11+
spanning_tree_flat: ""
12+
type: "std"
13+
vlan_id: "1"
14+
vlan_name: "Vlan_1"
15+
- admin_state: "Ena"
16+
auth: ""
17+
ip_state: "Dis"
18+
mbletag: ""
19+
mtu: "1500"
20+
operational_state: "Dis"
21+
source_learn: ""
22+
spanning_tree_1x1: ""
23+
spanning_tree_flat: ""
24+
type: "vcm"
25+
vlan_id: "4094"
26+
vlan_name: "VCM IPC"

0 commit comments

Comments
 (0)