From aeb509a4f1d2847197d5cea4a3df7a028189b82e Mon Sep 17 00:00:00 2001 From: jefvantongerloo Date: Tue, 28 Jun 2022 15:38:30 +0200 Subject: [PATCH] add ale_aos8_show_spantree_ports --- README.md | 1 + .../ale_aos8_show_spantree_ports.txt | 7 ++++ .../ale_aos8_show_spantree_ports.yml | 36 +++++++++++++++++++ .../ale_aos8_show_spantree_ports.textfsm | 15 ++++++++ textfsm_aos/templates/templates_index.yml | 2 ++ 5 files changed, 61 insertions(+) create mode 100644 tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.txt create mode 100644 tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.yml create mode 100644 textfsm_aos/templates/ale_aos8_show_spantree_ports.textfsm diff --git a/README.md b/README.md index 3dd6b41..94d235d 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ parsed result | show snmp station | :heavy_check_mark: | :heavy_check_mark: | | show snmp community map | :heavy_check_mark: | `alias: show snmp community-map` | | show snmp community-map | `alias: show snmp community map` | :heavy_check_mark: | +| show spantree ports | :x: | :heavy_check_mark: | | show system | :heavy_check_mark: | :heavy_check_mark: | | show transceivers | :x: | :heavy_check_mark: | | show vlan | :heavy_check_mark: | :heavy_check_mark: | diff --git a/tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.txt b/tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.txt new file mode 100644 index 0000000..b2a473d --- /dev/null +++ b/tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.txt @@ -0,0 +1,7 @@ + Vlan Port Oper Status Path Cost Role Loop Guard Note +-----+-------+------------+---------+-------+----------+------ + 1 1/1/7 DIS 0 DIS DIS + 3200 0/1 FORW 1 DESG DIS + 3200 0/32 FORW 3 DESG DIS + 3201 1/1/15 FORW 4 DESG DIS + 3201 1/1/16 FORW 4 DESG DIS diff --git a/tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.yml b/tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.yml new file mode 100644 index 0000000..d1de7de --- /dev/null +++ b/tests/ale_aos8_show_spantree_ports/ale_aos8_show_spantree_ports.yml @@ -0,0 +1,36 @@ +--- +- cist_param: '1' + port: '1/1/7' + oper_status: 'DIS' + path_cost: '0' + role: 'DIS' + loop_guard: 'DIS' + note: '' +- cist_param: '3200' + port: '0/1' + oper_status: 'FORW' + path_cost: '1' + role: 'DESG' + loop_guard: 'DIS' + note: '' +- cist_param: '3200' + port: '0/32' + oper_status: 'FORW' + path_cost: '3' + role: 'DESG' + loop_guard: 'DIS' + note: '' +- cist_param: '3201' + port: '1/1/15' + oper_status: 'FORW' + path_cost: '4' + role: 'DESG' + loop_guard: 'DIS' + note: '' +- cist_param: '3201' + port: '1/1/16' + oper_status: 'FORW' + path_cost: '4' + role: 'DESG' + loop_guard: 'DIS' + note: '' \ No newline at end of file diff --git a/textfsm_aos/templates/ale_aos8_show_spantree_ports.textfsm b/textfsm_aos/templates/ale_aos8_show_spantree_ports.textfsm new file mode 100644 index 0000000..16698b3 --- /dev/null +++ b/textfsm_aos/templates/ale_aos8_show_spantree_ports.textfsm @@ -0,0 +1,15 @@ +Value cist_param (\d{1,4}) +Value port ((\d{1,2}\/)+\d*) +Value oper_status (\w+) +Value path_cost (\d+) +Value role (\w+) +Value loop_guard (ENA|DIS) +Value note (.*) + +Start + ^\s+(Bridge|Msti|Vlan)\s+Port\s+Oper Status\s+Path Cost\s+Role\s+Loop Guard\s+Note$$ + ^[-+\+]+\s*$$ -> Spantree_ports + +Spantree_ports + ^\s+${cist_param}\s+${port}\s+${oper_status}\s+${path_cost}\s+${role}\s+${loop_guard}\s+${note}\s*$$ -> Record + ^. -> Error diff --git a/textfsm_aos/templates/templates_index.yml b/textfsm_aos/templates/templates_index.yml index a5bba6a..54b08f9 100644 --- a/textfsm_aos/templates/templates_index.yml +++ b/textfsm_aos/templates/templates_index.yml @@ -83,6 +83,8 @@ platform: ale_aos6 - command: show snmp community-map platform: ale_aos8 +- command: show spantree ports + platform: ale_aos8 - command: show system platform: ale_aos6 - command: show system