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

Add NREN type and test cases

parent 315c2f64
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,9 @@ class BRIAN_DASHBOARDS(Enum):
LHCONE = auto()
CAE1 = auto()
# NREN customer
NREN = auto()
# only used in INTERFACE_LIST_SCHEMA and sphinx docs
_DASHBOARD_IDS = [d.name for d in list(BRIAN_DASHBOARDS)]
......@@ -397,6 +400,9 @@ def _get_dashboards(interface):
yield BRIAN_DASHBOARDS.CAE1
if re.match('^PHY UPSTREAM', description):
yield BRIAN_DASHBOARDS.GWS_PHY_UPSTREAM
regex = r'(PHY|LAG|(SRV_(GLOBAL|LHCONE|MDVPN|IAS|CLS|L3VPN))) CUSTOMER'
if re.match(regex, description):
yield BRIAN_DASHBOARDS.NREN
def _add_dashboards(interfaces):
......@@ -778,9 +784,9 @@ def eumetsat_multicast(hostname=None):
MX1_FRA = 'mx1.fra.de.geant.net'
SUBSCRIPTIONS = [{
'subscription': f'232.223.222.{idx}',
'endpoint': '193.17.9.3',
} for idx in range(1, 73)]
'subscription': f'232.223.222.{idx}',
'endpoint': '193.17.9.3',
} for idx in range(1, 73)]
SUBSCRIPTIONS.append(
{'subscription': '232.223.223.1', 'endpoint': '193.17.9.7'})
......
......@@ -55,7 +55,7 @@ def test_eumetsat_multicast(mocker, client):
# routers don't have snmp acl's for us
mocker.patch('inventory_provider.juniper.snmp_community_string') \
.return_value = 'blah'
.return_value = 'blah'
rv = client.get(
'/poller/eumetsat-multicast',
......@@ -219,9 +219,31 @@ def test_fw_counter_bytes_oid_values(customer, interface_name, expected_oid):
@pytest.mark.parametrize('description,expected_dashboards', [
('SRV_IAS CUSTOMER JISC #JISC-AP1-IAS IASPS | ASN786',
['IAS_CUSTOMER']),
['IAS_CUSTOMER', 'NREN']),
('SRV_L2CIRCUIT CUSTOMER JISC JISC #DUB-LON-NRENBBEXT-JANET-13015 | backup for niran ', # noqa: E501
['L2_CIRCUIT'])
['L2_CIRCUIT']),
('SRV_L3VPN CUSTOMER EENET #EENET-AP2-LHCONE | ASN3221',
['LHCONE', 'LHCONE_CUST', 'NREN']),
('SRV_IAS PRIVATE OPTIMA-TELEKOM #HR-EduZone | For Eduzone',
['IAS_PEERS', 'IAS_PRIVATE']),
('SRV_CLS PRIVATE AWS #AT-AWS-CLS|ASN16509 | ',
['CLS', 'CLS_PEERS']),
('SRV_IAS PUBLIC MIX #IX_Peerings_in_MIX |',
['IAS_PEERS', 'IAS_PUBLIC']),
('LAG INFRASTRUCTURE BACKBONE SRF0000001 | bil-por',
['INFRASTRUCTURE_BACKBONE']),
('SRV_GCS CUSTOMER FCCN MICROSOFT #FCCN_NoveSBE_ExpressRoute_Vlan1945 | UNIT CONFIGURATION HAS BEEN SYSTEM GENERATED', # noqa: E501
['GCS']),
('PHY UPSTREAM TELIA SRF9940473 | Telia ID: IC-326863',
['GWS_PHY_UPSTREAM']),
('SRV_IAS UPSTREAM COGENT #COGENT_GWS_VIE | ASN174',
['IAS_UPSTREAM']),
('SRV_L3VPN RE_INTERCONNECT CLARA #REDCLARA-LIS-LHCONE | ASN27750',
['LHCONE', 'LHCONE_PEER']),
('SRV_MDVPN CUSTOMER REDIRIS #RedIRIS_AP1_BGP_LU_CoC_1 | MD VPN CoC-REDIRIS - ', # noqa: E501
['MDVPN_CUSTOMERS', 'NREN']),
('SRV_L2CIRCUIT CUSTOMER TENET PSNC #lon-lon-GEANTOPEN-PSNC-TENET-18067 |', # noqa: E501
['GEANTOPEN', 'L2_CIRCUIT'])
])
def test_interface_dashboard_mapping(description, expected_dashboards):
interface = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment