From e2772fab151cbc6c53a47da5b795c63562f357ba Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Fri, 12 Mar 2021 21:36:52 +0000 Subject: [PATCH 1/4] New Template: alcatel_sros, sap-using --- ...lcatel_sros_show_service_sap-using.textfsm | 25 +++++++++++ ntc_templates/templates/index | 1 + .../alcatel_sros_show_service_sap-using.raw | 15 +++++++ .../alcatel_sros_show_service_sap-using.yml | 42 +++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm create mode 100644 tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.raw create mode 100644 tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml diff --git a/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm b/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm new file mode 100644 index 0000000000..e481e45f43 --- /dev/null +++ b/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm @@ -0,0 +1,25 @@ +Value Required PORT_ID (\S+) +Value Required SVC_ID (\d+) +Value Required ING_QOS (\d+) +Value Required ING_FLTR (\S+) +Value Required EGR_QOS (\d+) +Value Required EGR_FLTR (\S+) +Value Required ADM (Up|Down) +Value Required OPR (Up|Down) + +Start + ^=+ + ^Service\s+Access\s+Points + ^PortId\s+SvcId\s+Ing.\s+Ing.\s+Egr.\s+Egr.\s+Adm\s+Opr\s*$$ + ^\s+QoS\s+Fltr\s+QoS\s+Fltr + ^-+ -> SAPS + ^\s*$$ + ^. -> Error + +SAPS + ^${PORT_ID}\s+${SVC_ID}\s+${ING_QOS}\s+${ING_FLTR}\s+${EGR_QOS}\s+${EGR_FLTR}\s+${ADM}\s+${OPR} -> Record + ^-+ -> Done + ^\s*$$ + ^. -> Error + +Done diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 631375838b..8b6cd85357 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -21,6 +21,7 @@ alcatel_sros_show_router_mpls_interface.textfsm, .*, alcatel_sros, sh[[ow]] rout alcatel_sros_show_router_rsvp_interface.textfsm, .*, alcatel_sros, sh[[ow]] router rsvp int[[erface]] alcatel_sros_show_router_ldp_interface.textfsm, .*, alcatel_sros, sh[[ow]] router ldp int[[erface]] alcatel_sros_show_router_pim_interface.textfsm, .*, alcatel_sros, sh[[ow]] router pim int[[erface]] +alcatel_sros_show_service_sap-using.textfsm, .*, alcatel_sros, sh[[ow]] service sap-u[[sing]] 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 alcatel_sros_oam_mac-ping.textfsm, .*, alcatel_sros, oam mac-pi[[ng]] diff --git a/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.raw b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.raw new file mode 100644 index 0000000000..0c31ef23a8 --- /dev/null +++ b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.raw @@ -0,0 +1,15 @@ +=============================================================================== +Service Access Points +=============================================================================== +PortId SvcId Ing. Ing. Egr. Egr. Adm Opr + QoS Fltr QoS Fltr +------------------------------------------------------------------------------- +lag-21:300 1 11130 none 11140 none Up Up +lag-22:300 1 11130 ip4 11140 none Up Up +1/1/c6/1:234 400 1 none 1 none Up Down +lag-21:400 76415001 10 none 1 none Up Up +lag-22:400 76415002 10 none 1 none Up Up +------------------------------------------------------------------------------- +Number of SAPs : 5 +------------------------------------------------------------------------------- +=============================================================================== diff --git a/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml new file mode 100644 index 0000000000..55ae4caada --- /dev/null +++ b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml @@ -0,0 +1,42 @@ +--- +parsed_sample: + - adm: "Up" + egr_fltr: "none" + egr_qos: "11140" + ing_fltr: "none" + ing_qos: "11130" + opr: "Up" + port_id: "lag-21:300" + svc_id: "1" + - adm: "Up" + egr_fltr: "none" + egr_qos: "11140" + ing_fltr: "ip4" + ing_qos: "11130" + opr: "Up" + port_id: "lag-22:300" + svc_id: "1" + - adm: "Up" + egr_fltr: "none" + egr_qos: "1" + ing_fltr: "none" + ing_qos: "1" + opr: "Down" + port_id: "1/1/c6/1:234" + svc_id: "400" + - adm: "Up" + egr_fltr: "none" + egr_qos: "1" + ing_fltr: "none" + ing_qos: "10" + opr: "Up" + port_id: "lag-21:400" + svc_id: "76415001" + - adm: "Up" + egr_fltr: "none" + egr_qos: "1" + ing_fltr: "none" + ing_qos: "10" + opr: "Up" + port_id: "lag-22:400" + svc_id: "76415002" From 65e8f687a3d75f4e4c60498ab6f703f9ef157286 Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Sat, 13 Mar 2021 22:49:20 +0000 Subject: [PATCH 2/4] Trans>off header + standardized keys --- ...lcatel_sros_show_service_sap-using.textfsm | 24 ++++--- .../alcatel_sros_show_service_sap-using.yml | 70 +++++++++---------- 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm b/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm index e481e45f43..7294c329d0 100644 --- a/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm +++ b/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm @@ -1,24 +1,26 @@ Value Required PORT_ID (\S+) -Value Required SVC_ID (\d+) -Value Required ING_QOS (\d+) -Value Required ING_FLTR (\S+) -Value Required EGR_QOS (\d+) -Value Required EGR_FLTR (\S+) -Value Required ADM (Up|Down) -Value Required OPR (Up|Down) +Value Required SERVICE_ID (\d+) +Value Required INGRESS_QOS (\d+) +Value Required INGRESS_FILTER (\S+) +Value Required EGRESS_QOS (\d+) +Value Required EGRESS_FILTER (\S+) +Value Required ADMIN_STATE (Up|Down) +Value Required OPER_STATE (Up|Down) Start ^=+ ^Service\s+Access\s+Points - ^PortId\s+SvcId\s+Ing.\s+Ing.\s+Egr.\s+Egr.\s+Adm\s+Opr\s*$$ - ^\s+QoS\s+Fltr\s+QoS\s+Fltr - ^-+ -> SAPS + ^PortId\s+SvcId\s+Ing.\s+Ing.\s+Egr.\s+Egr.\s+Adm\s+Opr\s*$$ -> SAPS ^\s*$$ ^. -> Error SAPS - ^${PORT_ID}\s+${SVC_ID}\s+${ING_QOS}\s+${ING_FLTR}\s+${EGR_QOS}\s+${EGR_FLTR}\s+${ADM}\s+${OPR} -> Record + ^\s+QoS\s+Fltr\s+QoS\s+Fltr + ^-+ + ^${PORT_ID}\s+${SVC_ID}\s+${INGRESS_QOS}\s+${INGRESS_FILTER}\s+${EGRESS_QOS}\s+${EGRESS_FILTER}\s+${ADMIN_STATE}\s+${OPER_STATE} -> Record ^-+ -> Done + ^=+ + ^Number\s+of ^\s*$$ ^. -> Error diff --git a/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml index 55ae4caada..ee672754a9 100644 --- a/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml +++ b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml @@ -1,42 +1,42 @@ --- parsed_sample: - - adm: "Up" - egr_fltr: "none" - egr_qos: "11140" - ing_fltr: "none" - ing_qos: "11130" - opr: "Up" + - admin_state: "Up" + egress_filter: "none" + egress_qos: "11140" + ingress_filter: "none" + ingress_qos: "11130" + oper_state: "Up" port_id: "lag-21:300" - svc_id: "1" - - adm: "Up" - egr_fltr: "none" - egr_qos: "11140" - ing_fltr: "ip4" - ing_qos: "11130" - opr: "Up" + service_id: "1" + - admin_state: "Up" + egress_filter: "none" + egress_qos: "11140" + ingress_filter: "ip4" + ingress_qos: "11130" + oper_state: "Up" port_id: "lag-22:300" - svc_id: "1" - - adm: "Up" - egr_fltr: "none" - egr_qos: "1" - ing_fltr: "none" - ing_qos: "1" - opr: "Down" + service_id: "1" + - admin_state: "Up" + egress_filter: "none" + egress_qos: "1" + ingress_filter: "none" + ingress_qos: "1" + oper_state: "Down" port_id: "1/1/c6/1:234" - svc_id: "400" - - adm: "Up" - egr_fltr: "none" - egr_qos: "1" - ing_fltr: "none" - ing_qos: "10" - opr: "Up" + service_id: "400" + - admin_statein_state: "Up" + egress_filter: "none" + egress_qos: "1" + ingress_filter: "none" + ingress_qos: "10" + oper_state: "Up" port_id: "lag-21:400" - svc_id: "76415001" - - adm: "Up" - egr_fltr: "none" - egr_qos: "1" - ing_fltr: "none" - ing_qos: "10" - opr: "Up" + service_id: "76415001" + - admin_statein_state: "Up" + egress_filter: "none" + egress_qos: "1" + ingress_filter: "none" + ingress_qos: "10" + oper_state: "Up" port_id: "lag-22:400" - svc_id: "76415002" + service_id: "76415002" From 86050554e61a1184a8b355ade4916679867b36fd Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Sat, 13 Mar 2021 23:05:34 +0000 Subject: [PATCH 3/4] standardized, fixed errors --- .../templates/alcatel_sros_show_service_sap-using.textfsm | 2 +- .../alcatel_sros_show_service_sap-using.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm b/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm index 7294c329d0..89ee1b5fac 100644 --- a/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm +++ b/ntc_templates/templates/alcatel_sros_show_service_sap-using.textfsm @@ -17,7 +17,7 @@ Start SAPS ^\s+QoS\s+Fltr\s+QoS\s+Fltr ^-+ - ^${PORT_ID}\s+${SVC_ID}\s+${INGRESS_QOS}\s+${INGRESS_FILTER}\s+${EGRESS_QOS}\s+${EGRESS_FILTER}\s+${ADMIN_STATE}\s+${OPER_STATE} -> Record + ^${PORT_ID}\s+${SERVICE_ID}\s+${INGRESS_QOS}\s+${INGRESS_FILTER}\s+${EGRESS_QOS}\s+${EGRESS_FILTER}\s+${ADMIN_STATE}\s+${OPER_STATE} -> Record ^-+ -> Done ^=+ ^Number\s+of diff --git a/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml index ee672754a9..1e17bdb1ca 100644 --- a/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml +++ b/tests/alcatel_sros/show_service_sap-using/alcatel_sros_show_service_sap-using.yml @@ -24,7 +24,7 @@ parsed_sample: oper_state: "Down" port_id: "1/1/c6/1:234" service_id: "400" - - admin_statein_state: "Up" + - admin_state: "Up" egress_filter: "none" egress_qos: "1" ingress_filter: "none" @@ -32,7 +32,7 @@ parsed_sample: oper_state: "Up" port_id: "lag-21:400" service_id: "76415001" - - admin_statein_state: "Up" + - admin_state: "Up" egress_filter: "none" egress_qos: "1" ingress_filter: "none" From 6511aba8aadb8d6693b7245754d3febe2bebdf23 Mon Sep 17 00:00:00 2001 From: Hugo Tinoco <43675476+h4ndzdatm0ld@users.noreply.github.com> Date: Tue, 16 Mar 2021 15:07:20 +0000 Subject: [PATCH 4/4] fix index --- ntc_templates/templates/index | 3 --- 1 file changed, 3 deletions(-) diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 64cb11230d..d115cb04c8 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -21,11 +21,8 @@ alcatel_sros_show_router_mpls_interface.textfsm, .*, alcatel_sros, sh[[ow]] rout alcatel_sros_show_router_rsvp_interface.textfsm, .*, alcatel_sros, sh[[ow]] router rsvp int[[erface]] alcatel_sros_show_router_ldp_interface.textfsm, .*, alcatel_sros, sh[[ow]] router ldp int[[erface]] alcatel_sros_show_router_pim_interface.textfsm, .*, alcatel_sros, sh[[ow]] router pim int[[erface]] -<<<<<<< HEAD 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 ->>>>>>> 080fa3de02c493ac9165969e2fe03a771ae9eca1 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 alcatel_sros_oam_mac-ping.textfsm, .*, alcatel_sros, oam mac-pi[[ng]]