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

Merge branch 'feature/POL1-703-IC1-dashboard' into 'develop'

[POL1-0703] add support for IC1 dashboard

See merge request !28
parents 6595ae2e 171a3c93
No related branches found
No related tags found
1 merge request!28[POL1-0703] add support for IC1 dashboard
......@@ -13,3 +13,5 @@ venv
.vscode
docs/build
errors.log
info.log
\ No newline at end of file
......@@ -118,6 +118,7 @@ class BRIAN_DASHBOARDS(Enum):
GWS_UPSTREAMS = auto()
LHCONE = auto()
CAE1 = auto()
IC1 = auto()
COPERNICUS = auto()
# NREN customer
......@@ -480,6 +481,9 @@ def _get_dashboards(interface):
if router == 'mx1.lon.uk.geant.net' \
and re.match(r'^ae12(\.\d+|$)$', ifc_name):
yield BRIAN_DASHBOARDS.CAE1
if router == 'rt1.mar.fr.geant.net' \
and re.match(r'^ae12(\.\d+|$)$', ifc_name):
yield BRIAN_DASHBOARDS.IC1
if re.match(r'PHY UPSTREAM\s', description):
yield BRIAN_DASHBOARDS.GWS_PHY_UPSTREAM
regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s'
......
......@@ -315,8 +315,27 @@ def test_interface_dashboard_mapping(description, expected_dashboards):
'description': description
}
dashboards = poller._get_dashboards(interface)
dashboards = [d.name for d in dashboards]
assert set(list(dashboards)) == set(expected_dashboards)
assert set(d.name for d in dashboards) == set(expected_dashboards)
def test__CAE_1_dashboards():
interface = {
'router': 'mx1.lon.uk.geant.net',
'name': 'ae12.123',
'description': ''
}
dashboards = poller._get_dashboards(interface)
assert set(d.name for d in dashboards) == {"CAE1"}
def test_POL1_703_IC1_dashboards():
interface = {
'router': 'rt1.mar.fr.geant.net',
'name': 'ae12.123',
'description': ''
}
dashboards = poller._get_dashboards(interface)
assert set(d.name for d in dashboards) == {"IC1"}
@pytest.mark.parametrize('interface,customers,dashboard_info', [
......
......@@ -2,7 +2,6 @@
envlist = py311
[flake8]
exclude = venv,.tox,build
max-line-length = 120
[coverage:run]
......@@ -13,7 +12,7 @@ passenv = TEST_OPSDB_HOSTNAME,TEST_OPSDB_DBNAME,TEST_OPSDB_USERNAME,TEST_OPSDB_P
deps =
pytest-xdist
pytest-cov
flake8
flake8 inventory_provider test circuit_tree.py
-r requirements.txt
#install_command = pip install --pre --extra-index-url http://pip.geant.net/ --trusted-host pip.geant.net {opts} {packages}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment