Skip to content

Commit

Permalink
BugFix: Ciena Saos: Added more use cases to vlan_show (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
FragmentedPacket committed May 20, 2020
1 parent 1068e31 commit 6a6acbf
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 39 deletions.
47 changes: 26 additions & 21 deletions templates/ciena_saos_vlan_show.textfsm
@@ -1,26 +1,31 @@
Value VLAN_ID (\d+)
Value VLAN_NAME ([0-9a-zA-Z_#]+)
Value NAME ([0-9a-zA-Z_#]+)

Start
^\+-+\s*VLAN\s*GLOBAL\s*CONFIGURATION\s*-+\+
^\+-+
^\|\sP\w+\s*\|\s*V\w+\s*\|
^\+-+
^\|\s+In\w+\s*\w+\s*\|\s*\d+\s*\|
^\+-+
^(?=\s+)
^\+-+
^\|VL\w+\|\s*\|\s*\d+\|
^\|\s*ID\s*\|\s*\w+\s*\w+\s*\w+\s*\|\d+\|
^\+-+
^\|\s*${VLAN_ID}\s*\|\s*${VLAN_NAME}\s*\| -> Record
^\+-+
^(?=\s+)
^\+-+
^\+-+\s*CROSS\s*CONNECTION\s*TABLE\s*-+\+
^\|\sOV\w+\s*\|\s*IV\w+\s*\|\s*\w+\-\w+\s*\|\s*\w+\-\w+\s*\|
^\+-+
^\|\s*No\s*Entry\s*Found\s*\|
^\+-+
^\+-+\+-+.*
^\|\sParameter\s+|\sValue.*
^.*Inner TPID State.*
^\s+\|\s+\|\s+\|
^\|\s+Field\s+\|\s+Admin\s+\|\s+Oper\s+\|
^\|\s+Inner TPID.*
^\|\s+\|\s+\|
^\|VLAN\|.*
^\|\s+ID\s+\|\s+VLAN Name* -> VLAN_TABLE
^\+-+\s+CROSS\s+CONNECTION\s+TABLE -> CROSS_TABLE
^\s*$$
^. -> Error
^. -> Error

VLAN_TABLE
^\|\s*${VLAN_ID}\s*\|\s*${NAME}\s*\| -> Record
^\+-+\+.*
^\+-+\s+CROSS\s+CONNECTION\s+TABLE -> CROSS_TABLE
^\s*$$
^. -> Error

CROSS_TABLE
^\|\s+OVID
^\+-+\+.*
^\|\s+No Entry Found
^\s*$$
^. -> Error
36 changes: 18 additions & 18 deletions tests/ciena_saos/vlan_show/ciena_saos_vlan_show.yml
@@ -1,20 +1,20 @@
---
parsed_sample:
- vlan_id: '1'
vlan_name: 'Default'
- vlan_id: '2'
vlan_name: 'VLAN#2'
- vlan_id: '4'
vlan_name: 'VLAN#4'
- vlan_id: '5'
vlan_name: 'VLAN#5'
- vlan_id: '7'
vlan_name: 'VLAN#7'
- vlan_id: '8'
vlan_name: 'VLAN#8'
- vlan_id: '1401'
vlan_name: 'Mgmt'
- vlan_id: '3999'
vlan_name: 'RVID_3999'
- vlan_id: '4000'
vlan_name: 'VLAN#4000'
- vlan_id: "1"
name: "Default"
- vlan_id: "2"
name: "VLAN#2"
- vlan_id: "4"
name: "VLAN#4"
- vlan_id: "5"
name: "VLAN#5"
- vlan_id: "7"
name: "VLAN#7"
- vlan_id: "8"
name: "VLAN#8"
- vlan_id: "1401"
name: "Mgmt"
- vlan_id: "3999"
name: "RVID_3999"
- vlan_id: "4000"
name: "VLAN#4000"
26 changes: 26 additions & 0 deletions tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.raw
@@ -0,0 +1,26 @@
+------------ VLAN GLOBAL CONFIGURATION ------------+
| Parameter | Value |
+-------------------+---------------+---------------+
| Inner TPID State | Disabled |
| | |
| Field | Admin | Oper |
+-------------------+---------------+---------------+
| Inner TPID | 8100 | 8100 |
+-------------------+---------------+---------------+

+----+--------------------------------+------------------------+
|VLAN| | 111111111122222|
| ID | VLAN Name Ports |123456789012345678901234|
+----+--------------------------------+------------------------+
| 1|Default | x x|
| 127|VLAN#127 |x x|
| 666|Blackhole | xxxxxxxxxx xxxxxxxxxxx |
| 800|Mgmt |x x|
|1001|RVID_1001 |x x|
+----+--------------------------------+------------------------+

+----------------------------- CROSS CONNECTION TABLE ------------------------------+
| OVID | IVID | Port-A | Port-B |
+------+------+----------------------------------+----------------------------------+
| No Entry Found |
+------+------+----------------------------------+----------------------------------+
12 changes: 12 additions & 0 deletions tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.yml
@@ -0,0 +1,12 @@
---
parsed_sample:
- vlan_id: "1"
name: "Default"
- vlan_id: "127"
name: "VLAN#127"
- vlan_id: "666"
name: "Blackhole"
- vlan_id: "800"
name: "Mgmt"
- vlan_id: "1001"
name: "RVID_1001"

0 comments on commit 6a6acbf

Please sign in to comment.