From 3f9b8915f69b07765e7f1fa663dd2fa2af296aa9 Mon Sep 17 00:00:00 2001 From: Mikhail Yohman Date: Wed, 20 May 2020 07:14:52 -0600 Subject: [PATCH] BugFix: Ciena Saos: Added more use cases to vlan_show (#707) --- templates/ciena_saos_vlan_show.textfsm | 47 ++++++++++--------- .../vlan_show/ciena_saos_vlan_show.yml | 36 +++++++------- .../vlan_show/ciena_saos_vlan_show2.raw | 26 ++++++++++ .../vlan_show/ciena_saos_vlan_show2.yml | 12 +++++ 4 files changed, 82 insertions(+), 39 deletions(-) create mode 100644 tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.raw create mode 100644 tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.yml diff --git a/templates/ciena_saos_vlan_show.textfsm b/templates/ciena_saos_vlan_show.textfsm index fcaac57357..2b09e9314c 100644 --- a/templates/ciena_saos_vlan_show.textfsm +++ b/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 \ No newline at end of file + ^. -> 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 diff --git a/tests/ciena_saos/vlan_show/ciena_saos_vlan_show.yml b/tests/ciena_saos/vlan_show/ciena_saos_vlan_show.yml index 4f63065d39..1b1f295cd7 100644 --- a/tests/ciena_saos/vlan_show/ciena_saos_vlan_show.yml +++ b/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" diff --git a/tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.raw b/tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.raw new file mode 100644 index 0000000000..482fc7ed36 --- /dev/null +++ b/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 | ++------+------+----------------------------------+----------------------------------+ \ No newline at end of file diff --git a/tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.yml b/tests/ciena_saos/vlan_show/ciena_saos_vlan_show2.yml new file mode 100644 index 0000000000..75a91c33c2 --- /dev/null +++ b/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"