Skip to content
Snippets Groups Projects
Commit c8d00461 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Finished feature POL1-643-poller-port-type.

parents 5ecfdcd5 f8c9fbe3
No related branches found
No related tags found
No related merge requests found
...@@ -120,11 +120,13 @@ class BRIAN_DASHBOARDS(Enum): ...@@ -120,11 +120,13 @@ class BRIAN_DASHBOARDS(Enum):
# NREN customer # NREN customer
NREN = auto() NREN = auto()
class PORT_TYPES(Enum): class PORT_TYPES(Enum):
ACCESS = auto() ACCESS = auto()
SERVICE = auto() SERVICE = auto()
UNKNOWN = auto() UNKNOWN = auto()
# only used in INTERFACE_LIST_SCHEMA and sphinx docs # only used in INTERFACE_LIST_SCHEMA and sphinx docs
_DASHBOARD_IDS = [d.name for d in list(BRIAN_DASHBOARDS)] _DASHBOARD_IDS = [d.name for d in list(BRIAN_DASHBOARDS)]
......
...@@ -102,7 +102,7 @@ def test_extract_ims_data(mocker): ...@@ -102,7 +102,7 @@ def test_extract_ims_data(mocker):
assert res['lg_routers'] == ['lg router 1', 'lg router 2'] assert res['lg_routers'] == ['lg router 1', 'lg router 2']
assert res['customer_contacts'] == {'123': 'CON A', '456': 'CON B'} assert res['customer_contacts'] == {'123': 'CON A', '456': 'CON B'}
assert res['planned_work_contacts'] == \ assert res['planned_work_contacts'] == \
{'223': 'CON PW A', '556': 'CON PW B'} {'223': 'CON PW A', '556': 'CON PW B'}
assert res['circuit_ids_to_monitor'] == [123, 456, 789] assert res['circuit_ids_to_monitor'] == [123, 456, 789]
assert res['additional_circuit_customers'] == \ assert res['additional_circuit_customers'] == \
[ [
...@@ -113,7 +113,7 @@ def test_extract_ims_data(mocker): ...@@ -113,7 +113,7 @@ def test_extract_ims_data(mocker):
] ]
}, },
{'id b': [{'id': 'B', 'name': 'customer b'}]} {'id b': [{'id': 'B', 'name': 'customer b'}]}
] ]
assert res['hierarchy'] == { assert res['hierarchy'] == {
'1': {'id': '1', 'value': 'A'}, '1': {'id': '1', 'value': 'A'},
'2': {'id': '2', 'value': 'B'} '2': {'id': '2', 'value': 'B'}
...@@ -246,7 +246,7 @@ def test_transform_ims_data(): ...@@ -246,7 +246,7 @@ def test_transform_ims_data():
"status": "operational", "status": "operational",
"port_a_id": "port_id_3", "port_a_id": "port_id_3",
"port_b_id": "port_id_4", "port_b_id": "port_id_4",
} }
], ],
"port_id_4": [ "port_id_4": [
{ {
...@@ -600,7 +600,7 @@ def test_populate_poller_interfaces_cache( ...@@ -600,7 +600,7 @@ def test_populate_poller_interfaces_cache(
"name": "ae_a", "name": "ae_a",
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "DESCRIPTION B", "description": "DESCRIPTION B $GA-0001",
"circuits": [] "circuits": []
}, },
{ {
...@@ -616,7 +616,7 @@ def test_populate_poller_interfaces_cache( ...@@ -616,7 +616,7 @@ def test_populate_poller_interfaces_cache(
"name": "lab_interface_a", "name": "lab_interface_a",
"bundle": ["ae_c"], "bundle": ["ae_c"],
"bundle-parents": [], "bundle-parents": [],
"description": "DESCRIPTION C", "description": "DESCRIPTION C $GA-0001",
"circuits": [] "circuits": []
}, },
{ {
...@@ -624,7 +624,7 @@ def test_populate_poller_interfaces_cache( ...@@ -624,7 +624,7 @@ def test_populate_poller_interfaces_cache(
"name": "ae_c", "name": "ae_c",
"bundle": [], "bundle": [],
"bundle-parents": [], "bundle-parents": [],
"description": "DESCRIPTION D", "description": "DESCRIPTION D $GS-0001",
"circuits": [] "circuits": []
}, },
] ]
...@@ -690,43 +690,45 @@ def test_populate_poller_interfaces_cache( ...@@ -690,43 +690,45 @@ def test_populate_poller_interfaces_cache(
} }
} }
} }
no_lab_res = [ no_lab_res = [
{ {
"router": "router_a.geant.net", 'router': 'router_a.geant.net',
"name": "interface_a", 'name': 'interface_a',
"bundle": ["ae_a"], 'bundle': ['ae_a'],
"bundle-parents": [], 'bundle-parents': [],
"description": "DESCRIPTION A", 'description': 'DESCRIPTION A',
"circuits": [], 'circuits': [],
"snmp-index": 12, 'port_type': 'UNKNOWN',
"dashboards": [] 'snmp-index': 12,
'dashboards': []
}, },
{ {
"router": "router_a.geant.net", 'router': 'router_a.geant.net',
"name": "ae_a", 'name': 'ae_a',
"bundle": [], 'bundle': [],
"bundle-parents": ["interface_a"], 'bundle-parents': ['interface_a'],
"description": "DESCRIPTION B", 'description': 'DESCRIPTION B $GA-0001',
"circuits": [], 'circuits': [],
"snmp-index": 1, 'port_type': 'ACCESS',
"dashboards": [] 'snmp-index': 1,
'dashboards': []
}, },
{ {
"router": "router_a.geant.net", 'router': 'router_a.geant.net',
"name": "ae_a.123", 'name': 'ae_a.123',
"bundle": [], 'bundle': [],
"bundle-parents": ["interface_a"], 'bundle-parents': ['interface_a'],
"description": "DESCRIPTION C", 'description': 'DESCRIPTION C',
"circuits": [{ 'circuits': [{
"id": 321, 'id': 321,
"name": "SERVICE A", 'name': 'SERVICE A',
"type": "SERVICE TYPE", 'type': 'SERVICE TYPE',
"status": "operational" 'status': 'operational'
}], }],
"snmp-index": 1231, 'port_type': 'UNKNOWN',
"dashboards": [] 'snmp-index': 1231,
}, 'dashboards': []
}
] ]
lab_res = [ lab_res = [
{ {
...@@ -734,11 +736,12 @@ def test_populate_poller_interfaces_cache( ...@@ -734,11 +736,12 @@ def test_populate_poller_interfaces_cache(
"name": "ae_c", "name": "ae_c",
"bundle": [], "bundle": [],
"bundle-parents": ["lab_interface_a"], "bundle-parents": ["lab_interface_a"],
"description": "DESCRIPTION D", "description": "DESCRIPTION D $GS-0001",
"circuits": [], "circuits": [],
"snmp-index": 3, "snmp-index": 3,
"dashboards": [] "dashboards": [],
}, "port_type": "SERVICE"
}
] ]
for k in r.keys("lab:netconf-interfaces-hosts:*"): for k in r.keys("lab:netconf-interfaces-hosts:*"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment