Skip to content
Snippets Groups Projects
Commit 03fca847 authored by Pelle Koster's avatar Pelle Koster
Browse files

POL1-876: Update error report for additional NOKIA counters

parent 86dce71d
Branches
Tags
No related merge requests found
...@@ -21,7 +21,9 @@ errors are checked: ...@@ -21,7 +21,9 @@ errors are checked:
* ``input-drops`` (Juniper) * ``input-drops`` (Juniper)
* ``output-discards`` (Nokia) * ``output-discards`` (Nokia)
* ``output-drops`` (Juniper) * ``output-drops`` (Juniper)
* ``output-total-errors`` (Nokia) * ``oper-state-change-count`` (Nokia)
* ``crc-align-errors`` (Nokia)
* ``fcs errors`` (Nokia)
For every interface with new errors is added to a summary report. This report is then For every interface with new errors is added to a summary report. This report is then
sent to the OC. sent to the OC.
...@@ -76,6 +78,9 @@ ERROR_FIELDS = { ...@@ -76,6 +78,9 @@ ERROR_FIELDS = {
"last_output_discards": "output-discards", "last_output_discards": "output-discards",
"last_output_drops": "output-drops", "last_output_drops": "output-drops",
"last_output_total_errors": "output-total-errors", "last_output_total_errors": "output-total-errors",
"last_oper_state_change_count": "oper-state-change-count",
"last_crc_align_errors": "crc-align-errors",
"last_fcs_errors": "fcs-errors",
} }
INFLUX_TIME_WINDOW_TODAY = "time > now() - 1d" INFLUX_TIME_WINDOW_TODAY = "time > now() - 1d"
...@@ -97,6 +102,9 @@ PROCESSED_ERROR_COUNTERS_SCHEMA = { ...@@ -97,6 +102,9 @@ PROCESSED_ERROR_COUNTERS_SCHEMA = {
"output-discards": {"type": "integer"}, "output-discards": {"type": "integer"},
"output-drops": {"type": "integer"}, "output-drops": {"type": "integer"},
"output-total-errors": {"type": "integer"}, "output-total-errors": {"type": "integer"},
"oper-state-change-count": {"type": "integer"},
"crc-align-errors": {"type": "integer"},
"fcs-errors": {"type": "integer"},
}, },
"additionalProperties": False, "additionalProperties": False,
}, },
......
...@@ -56,6 +56,9 @@ ERROR_POINT_FIELDS_SCHEMA = { ...@@ -56,6 +56,9 @@ ERROR_POINT_FIELDS_SCHEMA = {
"output_fifo_errors": {"type": "integer"}, "output_fifo_errors": {"type": "integer"},
"output_resource_errors": {"type": "integer"}, "output_resource_errors": {"type": "integer"},
"output_total_errors": {"type": "integer"}, "output_total_errors": {"type": "integer"},
"oper_state_change_count": {"type": "integer"},
"crc_align_errors": {"type": "integer"},
"fcs_errors": {"type": "integer"},
}, },
"additionalProperties": False, "additionalProperties": False,
} }
......
...@@ -44,6 +44,9 @@ INTERFACE_COUNTERS = { ...@@ -44,6 +44,9 @@ INTERFACE_COUNTERS = {
"input_total_errors": {"path": "./statistics/in-errors"}, "input_total_errors": {"path": "./statistics/in-errors"},
"input_discards": {"path": "./statistics/in-discards"}, "input_discards": {"path": "./statistics/in-discards"},
"output_discards": {"path": "./statistics/out-discards"}, "output_discards": {"path": "./statistics/out-discards"},
"crc_align_errors": {"path": "./ethernet/statistics/crc-align-errors"},
"fcs_errors": {"path": "./ethernet/statistics/ethernet-like-medium/error/fcs"},
"oper_state_change_count": {"path": "./ethernet/oper-state-change-count"},
}, },
} }
......
...@@ -103,7 +103,8 @@ def create_error_point(mock_influx_client): ...@@ -103,7 +103,8 @@ def create_error_point(mock_influx_client):
:param kwargs: one or more error fields with integer value: :param kwargs: one or more error fields with integer value:
``input_framing_errors``, ``bit_error_seconds``,``errored_blocks_seconds``, ``input_framing_errors``, ``bit_error_seconds``,``errored_blocks_seconds``,
``input_crc_errors``, ``input_total_errors``,``input_discards``,``input_drops``, ``input_crc_errors``, ``input_total_errors``,``input_discards``,``input_drops``,
``output_drops`` ``output_drops``, ``oper_state_change_count`` ,``crc_align_errors``,
``fcs_errors``
The created error points will be returned by ``mock_influx_client`` fixture The created error points will be returned by ``mock_influx_client`` fixture
""" """
...@@ -241,6 +242,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro ...@@ -241,6 +242,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro
input_discards=6, input_discards=6,
input_drops=7, input_drops=7,
output_drops=8, output_drops=8,
oper_state_change_count=9,
crc_align_errors=10,
fcs_errors=11,
) )
errors = get_interface_errors() errors = get_interface_errors()
assert errors == { assert errors == {
...@@ -258,6 +262,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro ...@@ -258,6 +262,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro
"input-discards": 6, "input-discards": 6,
"input-drops": 7, "input-drops": 7,
"output-drops": 8, "output-drops": 8,
"oper-state-change-count": 9,
"crc-align-errors": 10,
"fcs-errors": 11,
}, },
"diff": { "diff": {
"framing-errors": 1, "framing-errors": 1,
...@@ -268,6 +275,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro ...@@ -268,6 +275,9 @@ def test_interface_errors_with_new_errors(create_error_point, get_interface_erro
"input-discards": 6, "input-discards": 6,
"input-drops": 7, "input-drops": 7,
"output-drops": 8, "output-drops": 8,
"oper-state-change-count": 9,
"crc-align-errors": 10,
"fcs-errors": 11,
}, },
"errors_yesterday": DEFAULT_ERRORS_YESTERDAY, "errors_yesterday": DEFAULT_ERRORS_YESTERDAY,
} }
......
...@@ -34,11 +34,44 @@ NOKIA_PORT_XML = """\ ...@@ -34,11 +34,44 @@ NOKIA_PORT_XML = """\
<out-errors>7</out-errors> <out-errors>7</out-errors>
<out-discards>8</out-discards> <out-discards>8</out-discards>
</statistics> </statistics>
<ethernet>
<oper-state-change-count>20</oper-state-change-count>
<statistics>
<crc-align-errors>21</crc-align-errors>
<ethernet-like-medium>
<error>
<fcs>22</fcs>
</error>
</ethernet-like-medium>
</statistics>
</ethernet>
</port> </port>
</state> </state>
</data> </data>
</rpc-reply>""" </rpc-reply>"""
NOKIA_LAG_XML = """\
<rpc-reply>
<data>
<state>
<lag>
<lag-name>lag-1</lag-name>
<oper-state>up</oper-state>
<statistics>
<in-octets>1</in-octets>
<in-packets>2</in-packets>
<out-octets>3</out-octets>
<out-packets>4</out-packets>
<in-errors>5</in-errors>
<in-discards>6</in-discards>
<out-errors>7</out-errors>
<out-discards>8</out-discards>
</statistics>
</lag>
</state>
</data>
</rpc-reply>"""
NOKIA_ROUTER_INTERFACE_XML = """ NOKIA_ROUTER_INTERFACE_XML = """
<rpc-reply> <rpc-reply>
<data> <data>
...@@ -71,33 +104,10 @@ NOKIA_ROUTER_INTERFACE_XML = """ ...@@ -71,33 +104,10 @@ NOKIA_ROUTER_INTERFACE_XML = """
""" """
@pytest.fixture
def nokia_port_doc_containing_every_field():
return etree.fromstring(NOKIA_PORT_XML)
@pytest.fixture
def nokia_lag_doc_containing_every_field():
return etree.fromstring(
NOKIA_PORT_XML.replace("port>", "lag>").replace(
"<port-id>1/1/c1</port-id>", "<lag-name>lag-1</lag-name>"
)
)
@pytest.fixture
def nokia_router_interface_doc_containing_every_field():
return etree.fromstring(NOKIA_ROUTER_INTERFACE_XML)
def nokia_docs_containing_every_field(): def nokia_docs_containing_every_field():
return { return {
"port": etree.fromstring(NOKIA_PORT_XML), "port": etree.fromstring(NOKIA_PORT_XML),
"lag": etree.fromstring( "lag": etree.fromstring(NOKIA_LAG_XML),
NOKIA_PORT_XML.replace("port>", "lag>").replace(
"<port-id>1/1/c1</port-id>", "<lag-name>lag-1</lag-name>"
)
),
"router-interface": etree.fromstring(NOKIA_ROUTER_INTERFACE_XML), "router-interface": etree.fromstring(NOKIA_ROUTER_INTERFACE_XML),
} }
...@@ -121,6 +131,9 @@ def test_nokia_counters(): ...@@ -121,6 +131,9 @@ def test_nokia_counters():
"input_discards": 6, "input_discards": 6,
"output_total_errors": 7, "output_total_errors": 7,
"output_discards": 8, "output_discards": 8,
"oper_state_change_count": 20,
"crc_align_errors": 21,
"fcs_errors": 22,
}, },
}, },
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment