diff --git a/src/nbi/service/ietf_l2vpn/Constants.py b/src/nbi/service/ietf_l2vpn/Constants.py index b097454524d0b559be547f8d60783df7b0b67537..3f532f58f9d4189a42d54a2fa33195fe58a97691 100644 --- a/src/nbi/service/ietf_l2vpn/Constants.py +++ b/src/nbi/service/ietf_l2vpn/Constants.py @@ -33,6 +33,10 @@ BEARER_MAPPINGS = { 'OSM-E2E:r1:Ethernet11': ('r1', 'Ethernet11', None, None, 0, '172.17.1.1', 24, None, None), 'OSM-E2E:r3:Ethernet11': ('r3', 'Ethernet11', None, None, 0, '172.17.3.1', 24, None, None), + # NSC tests + 'SDP1': ('r1', 'Ethernet10', None, None, 0, '172.16.1.10', 24, None, None), + 'SDP2': ('r3', 'Ethernet10', None, None, 0, '172.16.2.10', 24, None, None), + # SNS4SNS'26 'SNS4SNS26:SiteA': ('router-1', 'Ethernet10', None, None, 0, '192.168.251.5', 24, None, None), 'SNS4SNS26:SiteB': ('router-3', 'Ethernet10', None, None, 0, '192.168.252.5', 24, None, None), diff --git a/src/nbi/service/ietf_l2vpn/Handlers.py b/src/nbi/service/ietf_l2vpn/Handlers.py index a3af7b2dba40aa56d0b6eec71f51759e726bccb2..42c0bb5fb41a3f0bc7d6f901ac8a632b1df159cb 100644 --- a/src/nbi/service/ietf_l2vpn/Handlers.py +++ b/src/nbi/service/ietf_l2vpn/Handlers.py @@ -171,18 +171,16 @@ def process_site_network_access( availability = None service_bandwidth_bps = 0 - service_input_bandwidth = network_access_service.get('svc-input-bandwidth') - if service_input_bandwidth is not None: - service_input_bandwidth = float(service_input_bandwidth) - service_bandwidth_bps = max(service_bandwidth_bps, service_input_bandwidth) - - service_output_bandwidth = network_access_service.get('svc-output-bandwidth') - if service_output_bandwidth is not None: - service_output_bandwidth = float(service_output_bandwidth) - if service_bandwidth_bps is None: - service_bandwidth_bps = service_output_bandwidth - else: - service_bandwidth_bps = max(service_bandwidth_bps, service_output_bandwidth) + + svc_bandwidth = network_access_service.get("svc-bandwidth", {}) + bandwidth_list = svc_bandwidth.get("bandwidth", []) + + for bandwidth_entry in bandwidth_list: + cir = bandwidth_entry.get("cir") + + if cir is not None: + cir = float(cir) + service_bandwidth_bps = max(service_bandwidth_bps, cir) if service_bandwidth_bps > 1.e-12: max_bandwidth_gbps = service_bandwidth_bps / 1.e9 @@ -201,11 +199,11 @@ def process_site_network_access( qos_profile_class_direction = qos_profile_class['direction'] qos_profile_class_direction = qos_profile_class_direction.replace('ietf-l2vpn-svc:', '') - if qos_profile_class_direction != 'both': + if qos_profile_class_direction != 'bidirectional': MSG = 'Site Network Access QoS Class Direction: {:s}' raise NotImplementedError(MSG.format(str(qos_profile_class['direction']))) - max_e2e_latency_ms = float(qos_profile_class['latency']['latency-boundary']) + max_e2e_latency_ms = float(qos_profile_class['frame-delay']['delay-bound']) availability = float(qos_profile_class['bandwidth']['guaranteed-bw-percent']) network_access_diversity = network_access.get('access-diversity', {})