Skip to content
Snippets Groups Projects
Commit 6ba35ca8 authored by Release Webservice's avatar Release Webservice
Browse files

Finished release 0.51.

parents 892252bb fe67b07c
No related branches found
Tags 0.51
No related merge requests found
......@@ -2,9 +2,15 @@
All notable changes to this project will be documented in this file.
## [0.51] - 2020-08-20
- POL1-137: add remaining service categories and test vectors
## [0.50] - 2020-08-14
- performance improvment for /poller/services
## [0.49] - 2020-08-13
- performance improvement /data/interfaces
- refactored a new method for testability
- performance improvement for /data/interfaces
- refactored service category sorting for better testability
## [0.48] - 2020-07-02
- recover update gracefully in case of Kombu exceptions
......
......@@ -176,6 +176,13 @@ def get_juniper_link_info(source_equipment, interface):
'ipv4': [],
'ipv6': []
}
bundle_members = r.get(
'netconf-interface-bundles:%s:%s' % (source_equipment, interface))
if bundle_members:
result['interface']['bundle_members'] = \
json.loads(bundle_members.decode('utf-8'))
else:
result['interface']['bundle_members'] = []
def _related_services():
for related in related_interfaces(source_equipment, interface):
......
......@@ -691,31 +691,40 @@ class PollerServiceCategory(str, enum.Enum):
MDVPN = 'mdvpn'
LHCONE_CUST = 'lhcone_cust'
LHCONE_PEER = 'lhcone_peer'
L2_Circuits = 'l2_circuits'
L2_CIRCUITS = 'l2_circuits'
AUTOMATED_L2_CIRCUITS = 'automated_l2_circuits'
IAS = 'ias'
RE_CUST = 're_cust'
RE_PEER = 're_peer'
BACKBONE = 'backbone'
def _classify_interface(ifc):
if ifc['description'].startswith('SRV_MDVPN CUSTOMER'):
yield PollerServiceCategory.MDVPN
if 'LHCONE' in ifc['description'] \
and 'SRV_L3VPN CUSTOMER' in ifc['description']:
yield PollerServiceCategory.LHCONE_CUST
if 'LHCONE' in ifc['description'] \
and 'SRV_L3VPN RE' in ifc['description']:
yield PollerServiceCategory.LHCONE_PEER
if 'SRV_L2CIRCUIT' in ifc['description'] \
and 'SRV_L3VPN' in ifc['description']:
yield PollerServiceCategory.L2_Circuits
if 'SRV_L2CIRCUIT' in ifc['description']:
yield PollerServiceCategory.L2_CIRCUITS
if 'SRV_GCS' in ifc['description']:
yield PollerServiceCategory.AUTOMATED_L2_CIRCUITS
if 'PHY CUSTOMER' in ifc['description'] \
and 'LAG CUSTOMER' in ifc['description'] \
and 'SRV_GLOBAL CUSTOMER' in ifc['description']:
or 'LAG CUSTOMER' in ifc['description'] \
or 'SRV_GLOBAL CUSTOMER' in ifc['description']:
yield PollerServiceCategory.RE_CUST
if 'SRV_GLOBAL RE_INTERCONNECT' in ifc['description']:
yield PollerServiceCategory.RE_PEER
if 'SRV_IAS CUSTOMER' in ifc['description']:
yield PollerServiceCategory.IAS
......
......@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name='inventory-provider',
version="0.50",
version="0.51",
author='GEANT',
author_email='swd@geant.org',
description='Dashboard inventory provider',
......
......@@ -65,7 +65,8 @@ JUNIPER_LINK_METADATA_DEFINITIONS = {
},
# TODO: check what's changed: added to make tests pass
'bundle': {"type": "array"}
'bundle': {"type": "array"},
'bundle_members': {"type": "array"}
},
"required": ["name", "description", "ipv4", "ipv6"],
"additionalProperties": False
......@@ -203,7 +204,8 @@ def test_juniper_link_info_not_found(client):
'description': '',
'ipv4': [],
'ipv6': [],
'bundle': []
'bundle': [],
'bundle_members': []
},
'locations': [{
'a': {
......
......@@ -65,16 +65,22 @@ def test_build_interface_services(mocked_worker_module):
assert type in ('mdvpn',
'lhcone_peer',
're_peer',
're_cust',
'ias',
'lhcone',
'lhcone_cust')
'lhcone_cust',
'l2_circuits',
'automated_l2_circuits')
expected_seen_types = set(['mdvpn',
'lhcone_peer',
're_peer',
're_cust',
'ias',
'lhcone',
'lhcone_cust'])
'lhcone_cust',
'l2_circuits',
'automated_l2_circuits'])
assert seen_types == expected_seen_types
......@@ -127,15 +133,46 @@ def test_build_subnet_db(mocked_worker_module):
# ... seems the method is not yet ready for testing
@pytest.mark.parametrize('description,expected_categories', [
[
'SRV_L3VPN CUSTOMER ESNET LHCONE SRF9928635 | ASN293 | GEN-EEX-ESNET-LHCONE', # noqa
'SRV_MDVPN CUSTOMER SANET SRF9939441 | VPN-Proxy to NREN CE',
{
worker.PollerServiceCategory.MDVPN
}
],
[
'SRV_L3VPN CUSTOMER ESNET LHCONE SRF9928635 | ASN293 | GEN-EEX',
{
worker.PollerServiceCategory.LHCONE_CUST
}
],
[
'SRV_MDVPN CUSTOMER SANET SRF9939441 | VPN-Proxy to NREN CE',
'SRV_L3VPN RE KREONET LHCONE SRF17072 | ASN17579',
{
worker.PollerServiceCategory.MDVPN
worker.PollerServiceCategory.LHCONE_PEER
}
],
[
'SRV_IAS CUSTOMER ACONET SRF9947199 IASPS | ASN1853',
{
worker.PollerServiceCategory.IAS
}
],
[
'SRV_GLOBAL CUSTOMER HBKU SRF18085 | ASN34945|',
{
worker.PollerServiceCategory.RE_CUST
}
],
[
'SRV_GLOBAL RE_INTERCONNECT HBKU SRF18085 | ASN34945|',
{
worker.PollerServiceCategory.RE_PEER
}
],
[
'SRV_MDVPN CUSTOMER LHCONE SRV_L3VPN CUSTOMER SRF18085 | ASN34945|',
{
worker.PollerServiceCategory.MDVPN,
worker.PollerServiceCategory.LHCONE_CUST
}
]
])
......
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