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

Merge branch 'POL1-803-ana-graphs' into 'develop'

Feature/POL1-803 add ANA dashboard tag for GA/ANA interfaces

See merge request !33
parents 3d835737 c10d6382
No related branches found
No related tags found
1 merge request!33Feature/POL1-803 add ANA dashboard tag for GA/ANA interfaces
......@@ -126,6 +126,7 @@ class BRIAN_DASHBOARDS(Enum):
CAE1 = auto()
IC1 = auto()
COPERNICUS = auto()
ANA = auto()
# NREN customer
NREN = auto()
......@@ -514,6 +515,8 @@ def _get_dashboards(interface):
regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s'
if re.match(regex, description):
yield BRIAN_DASHBOARDS.NREN
if "GA-" in description and "ANA-" in description:
yield BRIAN_DASHBOARDS.ANA
def _get_dashboard_data(ifc, customers):
......
......@@ -333,6 +333,26 @@ def test_ae12_aggregate_dashboards(router, interface, exp_dashboards):
assert [d.name for d in dashboards] == exp_dashboards
@pytest.mark.parametrize(
"description, has_ana",
[
("PHY GA-1 ANA-100", True),
("PHY ANA-100", False),
("PHY GA-1", False),
("PHY", False),
],
)
def test_ana_aggregate_dashboard(description, has_ana):
interface = {
"router": "some.router",
"name": "ifc-1",
"description": description,
}
dashboards = poller._get_dashboards(interface)
expected = ["ANA"] if has_ana else []
assert [d.name for d in dashboards] == expected
@pytest.mark.parametrize('interface,customers,dashboard_info', [
({
'description': 'SRV_IAS CUSTOMER JISC #JISC-AP1-IAS IASPS | ASN786',
......
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