From dc092bdc6a83098b656e3acf0d25c09b5959fcc5 Mon Sep 17 00:00:00 2001 From: bbinnard Date: Tue, 26 Nov 2024 14:57:20 +0100 Subject: [PATCH 1/3] feat: Add show service id sap --- ...alcatel_sros_show_service_id_0_sap.textfsm | 29 +++++++++++++++++++ ntc_templates/templates/index | 1 + .../show_service_id_0_sap.raw | 11 +++++++ .../show_service_id_0_sap.yml | 10 +++++++ 4 files changed, 51 insertions(+) create mode 100644 ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm create mode 100644 tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.raw create mode 100644 tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.yml diff --git a/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm b/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm new file mode 100644 index 0000000000..eb379cf869 --- /dev/null +++ b/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm @@ -0,0 +1,29 @@ +Value PORT_ID (\S+) +Value SERVICE_ID (\d+) +Value INGRESS_QOS (\d+) +Value INGRESS_FILTER (\S+) +Value EGRESS_QOS (\d+) +Value EGRESS_FILTER (\S+) +Value ADMIN_STATUS (\S+) +Value OPERATIONAL_STATUS (\S+) + +Start + ^=+\s*$$ + ^SAP\(Summary\), Service \d+\s*$$ -> Header + ^. -> Error + +Header + ^=+\s*$$ + ^PortId\s+SvcId\s+Ing\.\s+Ing\.\s+Egr\.\s+Egr\.\s+Adm\s+Opr\s*$$ + ^\s+QoS\s+Fltr\s+QoS\s+Fltr\s*$$ + ^-+\s*$$ -> Sap + ^. -> Error + + +Sap + ^${PORT_ID}\s+${SERVICE_ID}\s+${INGRESS_QOS}\s+${INGRESS_FILTER}\s+${EGRESS_QOS}\s+${EGRESS_FILTER}\s+${ADMIN_STATUS}\s+${OPERATIONAL_STATUS}\s*$$ -> Record + ^-+\s*$$ + ^Number of SAPs : \d+\s*$$ + ^-+\s*$$ + ^=+\s*$$ -> End + ^. -> Error \ No newline at end of file diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index eb8b2962a3..88db1d4c41 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -29,6 +29,7 @@ alcatel_sros_show_service_id_interface.textfsm, .*, alcatel_sros, sh[[ow]] se[[r alcatel_sros_show_service_sap-using.textfsm, .*, alcatel_sros, sh[[ow]] service sap-u[[sing]] alcatel_sros_show_service_sdp-using.textfsm, .*, alcatel_sros, sh[[ow]] service sdp-using alcatel_sros_show_router_interface.textfsm, .*, alcatel_sros, sh[[ow]] router (\d+ int[[erface]]|int[[erface]]) +alcatel_sros_show_service_id_0_sap.textfsm, .*, alcatel_sros, sh[[ow]] serv[[ice]] id \d+ sa[[p]] alcatel_sros_show_router_mpls_lsp.textfsm, .*, alcatel_sros, sh[[ow]] router mpls lsp alcatel_sros_show_service_id_base.textfsm, .*, alcatel_sros, sh[[ow]] serv[[ice]] id ba[[se]] alcatel_sros_show_service_sdp.textfsm, .*, alcatel_sros, sh[[ow]] service sdp diff --git a/tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.raw b/tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.raw new file mode 100644 index 0000000000..8ca9baab86 --- /dev/null +++ b/tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.raw @@ -0,0 +1,11 @@ +=============================================================================== +SAP(Summary), Service 24731 +=============================================================================== +PortId SvcId Ing. Ing. Egr. Egr. Adm Opr + QoS Fltr QoS Fltr +------------------------------------------------------------------------------- +lag-54:950 24731 1 none 1 none Up Down +------------------------------------------------------------------------------- +Number of SAPs : 1 +------------------------------------------------------------------------------- +=============================================================================== diff --git a/tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.yml b/tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.yml new file mode 100644 index 0000000000..c99161e3a7 --- /dev/null +++ b/tests/alcatel_sros/show_service_id_0_sap/show_service_id_0_sap.yml @@ -0,0 +1,10 @@ +--- +parsed_sample: + - admin_status: "Up" + egress_filter: "none" + egress_qos: "1" + ingress_filter: "none" + ingress_qos: "1" + operational_status: "Down" + port_id: "lag-54:950" + service_id: "24731" From 62ce5bd44eb21b3475632843e7345d8d85219fc7 Mon Sep 17 00:00:00 2001 From: bennnnnnnn Date: Tue, 26 Nov 2024 16:21:10 +0100 Subject: [PATCH 2/3] fix: Update ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm Take into account @mjbear's suggestions Co-authored-by: Michael Bear <38406045+mjbear@users.noreply.github.com> --- .../alcatel_sros_show_service_id_0_sap.textfsm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm b/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm index eb379cf869..4cf9dcb578 100644 --- a/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm +++ b/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm @@ -9,21 +9,10 @@ Value OPERATIONAL_STATUS (\S+) Start ^=+\s*$$ - ^SAP\(Summary\), Service \d+\s*$$ -> Header - ^. -> Error - -Header - ^=+\s*$$ + ^SAP\(Summary\), Service \d+\s*$$ ^PortId\s+SvcId\s+Ing\.\s+Ing\.\s+Egr\.\s+Egr\.\s+Adm\s+Opr\s*$$ ^\s+QoS\s+Fltr\s+QoS\s+Fltr\s*$$ - ^-+\s*$$ -> Sap - ^. -> Error - - -Sap ^${PORT_ID}\s+${SERVICE_ID}\s+${INGRESS_QOS}\s+${INGRESS_FILTER}\s+${EGRESS_QOS}\s+${EGRESS_FILTER}\s+${ADMIN_STATUS}\s+${OPERATIONAL_STATUS}\s*$$ -> Record ^-+\s*$$ - ^Number of SAPs : \d+\s*$$ - ^-+\s*$$ - ^=+\s*$$ -> End + ^Number\s+of\s+SAPs\s+:\s+\d+\s*$$ ^. -> Error \ No newline at end of file From 6a05e3c854042ffec5db178c8b834a72c26b7073 Mon Sep 17 00:00:00 2001 From: Jacob McGill <9847006+jmcgill298@users.noreply.github.com> Date: Wed, 27 Nov 2024 17:17:16 -0500 Subject: [PATCH 3/3] Update ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm --- .../templates/alcatel_sros_show_service_id_0_sap.textfsm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm b/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm index 4cf9dcb578..5dd44813f3 100644 --- a/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm +++ b/ntc_templates/templates/alcatel_sros_show_service_id_0_sap.textfsm @@ -15,4 +15,4 @@ Start ^${PORT_ID}\s+${SERVICE_ID}\s+${INGRESS_QOS}\s+${INGRESS_FILTER}\s+${EGRESS_QOS}\s+${EGRESS_FILTER}\s+${ADMIN_STATUS}\s+${OPERATIONAL_STATUS}\s*$$ -> Record ^-+\s*$$ ^Number\s+of\s+SAPs\s+:\s+\d+\s*$$ - ^. -> Error \ No newline at end of file + ^. -> Error