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

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

parent 3d835737
Branches
Tags
1 merge request!33Feature/POL1-803 add ANA dashboard tag for GA/ANA interfaces
...@@ -126,6 +126,7 @@ class BRIAN_DASHBOARDS(Enum): ...@@ -126,6 +126,7 @@ class BRIAN_DASHBOARDS(Enum):
CAE1 = auto() CAE1 = auto()
IC1 = auto() IC1 = auto()
COPERNICUS = auto() COPERNICUS = auto()
ANA = auto()
# NREN customer # NREN customer
NREN = auto() NREN = auto()
...@@ -514,6 +515,8 @@ def _get_dashboards(interface): ...@@ -514,6 +515,8 @@ def _get_dashboards(interface):
regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s' regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER\s'
if re.match(regex, description): if re.match(regex, description):
yield BRIAN_DASHBOARDS.NREN yield BRIAN_DASHBOARDS.NREN
if "GA-" in description and "ANA-" in description:
yield BRIAN_DASHBOARDS.ANA
def _get_dashboard_data(ifc, customers): def _get_dashboard_data(ifc, customers):
......
...@@ -333,6 +333,26 @@ def test_ae12_aggregate_dashboards(router, interface, exp_dashboards): ...@@ -333,6 +333,26 @@ def test_ae12_aggregate_dashboards(router, interface, exp_dashboards):
assert [d.name for d in dashboards] == 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', [ @pytest.mark.parametrize('interface,customers,dashboard_info', [
({ ({
'description': 'SRV_IAS CUSTOMER JISC #JISC-AP1-IAS IASPS | ASN786', '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.
Please register or to comment