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

FIX: brian counters are floats while error counters are integers

parent 3599e1bd
No related branches found
No related tags found
No related merge requests found
......@@ -14,17 +14,17 @@ BRIAN_POINT_FIELDS_SCHEMA = {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"egressOctets": {"type": "integer"},
"egressPackets": {"type": "integer"},
"ingressOctets": {"type": "integer"},
"ingressPackets": {"type": "integer"},
"egressOctetsv6": {"type": "integer"},
"egressPacketsv6": {"type": "integer"},
"ingressOctetsv6": {"type": "integer"},
"ingressPacketsv6": {"type": "integer"},
"egressErrors": {"type": "integer"},
"ingressDiscards": {"type": "integer"},
"ingressErrors": {"type": "integer"},
"egressOctets": {"type": "number"},
"egressPackets": {"type": "number"},
"ingressOctets": {"type": "number"},
"ingressPackets": {"type": "number"},
"egressOctetsv6": {"type": "number"},
"egressPacketsv6": {"type": "number"},
"ingressOctetsv6": {"type": "number"},
"ingressPacketsv6": {"type": "number"},
"egressErrors": {"type": "number"},
"ingressDiscards": {"type": "number"},
"ingressErrors": {"type": "number"},
},
"required": [
"egressOctets",
......
......@@ -61,6 +61,7 @@ PHYSICAL_INTERFACE_COUNTERS = {
# "l2_output_unicast": {"path": "./ethernet-mac-statistics/output-unicasts"},
},
"errors": {
"__defaults__": {"transform": int},
"input_fifo_errors": {"path": "./input-error-list/input-fifo-errors"},
"input_discards": {"path": "./input-error-list/input-discards"},
"input_drops": {"path": "./input-error-list/input-drops"},
......
......@@ -39,6 +39,7 @@ INTERFACE_COUNTERS = {
"ingressDiscards": {"path": "./statistics/in-discards"},
},
"errors": {
"__defaults__": {"transform": int},
"output_total_errors": {"path": "./statistics/out-errors"},
"input_total_errors": {"path": "./statistics/in-errors"},
"input_discards": {"path": "./statistics/in-discards"},
......@@ -67,7 +68,10 @@ INTERFACE_COUNTERS_ALT = {
"egressOctetsv6": {"path": "./ipv6/statistics/out-octets"},
"egressPacketsv6": {"path": "./ipv6/statistics/out-packets"},
},
"errors": {"output_discards": {"path": "./statistics/ip/out-discard-packets"}},
"errors": {
"__defaults__": {"transform": int},
"output_discards": {"path": "./statistics/ip/out-discard-packets"},
},
}
......
......@@ -200,7 +200,8 @@ def test_validate_interface_counters_and_influx_points_for_all_juniper_routers(
for point in bpoints:
jsonschema.validate(point, influx.INFLUX_POINT)
jsonschema.validate(point["fields"], common.BRIAN_POINT_FIELDS_SCHEMA)
for value in point['fields'].values():
assert isinstance(value, float)
epoints = list(
common.error_points(
juniper_router_fqdn,
......@@ -213,7 +214,8 @@ def test_validate_interface_counters_and_influx_points_for_all_juniper_routers(
for point in epoints:
jsonschema.validate(point, influx.INFLUX_POINT)
jsonschema.validate(point["fields"], common.ERROR_POINT_FIELDS_SCHEMA)
for value in point['fields'].values():
assert isinstance(value, int)
class TestGetJuniperNetConf:
RAW_RESPONSE_FILE = "raw-response-juniper-sample.xml"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment