diff --git a/hackfest/mock_osm/WimconnectorIETFL2VPN.py b/hackfest/mock_osm/WimconnectorIETFL2VPN.py index aa4ca045f41ffdc69d2ebf2fcd9b5db99ce45dbe..c3f35a2a5f7a8d09961e0430104f06bc857a7dc5 100644 --- a/hackfest/mock_osm/WimconnectorIETFL2VPN.py +++ b/hackfest/mock_osm/WimconnectorIETFL2VPN.py @@ -167,7 +167,7 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): """ SETTINGS = { # min_endpoints, max_endpoints, vpn_service_type 'ELINE': (2, 2, 'vpws'), # Virtual Private Wire Service - 'ELAN' : (2, None, 'vpls'), # Virtual Private LAN Service + 'ELAN' : (2, None, 'bgp-vpls'), # Virtual Private LAN Service } settings = SETTINGS.get(service_type) if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type))) @@ -291,12 +291,12 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): if access_priority is not None: availability = {} availability["access-priority"] = access_priority - availability["single-active"] = [None] + availability["single-active"] = None site_network_access["availability"] = availability constraint = {} constraint['constraint-type'] = 'end-to-end-diverse' - constraint['target'] = {'all-other-accesses': [None]} + constraint['target'] = {'all-other-accesses': None} access_diversity = {} access_diversity['constraints'] = {'constraint': []} diff --git a/src/device/service/drivers/ietf_l2vpn/WimconnectorIETFL2VPN.py b/src/device/service/drivers/ietf_l2vpn/WimconnectorIETFL2VPN.py index 34ff184c022f379e7420de237bd08fc1dc6282a6..ff2cf6db59666e5105da67806ac6233b2e5fcbb2 100644 --- a/src/device/service/drivers/ietf_l2vpn/WimconnectorIETFL2VPN.py +++ b/src/device/service/drivers/ietf_l2vpn/WimconnectorIETFL2VPN.py @@ -165,7 +165,7 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): """ SETTINGS = { # min_endpoints, max_endpoints, vpn_service_type 'ELINE': (2, 2, 'vpws'), # Virtual Private Wire Service - 'ELAN' : (2, None, 'vpls'), # Virtual Private LAN Service + 'ELAN' : (2, None, 'bgp-vpls'), # Virtual Private LAN Service } settings = SETTINGS.get(service_type) if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type))) @@ -288,12 +288,12 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): if access_priority is not None: availability = {} availability["access-priority"] = access_priority - availability["single-active"] = [None] + availability["single-active"] = None site_network_access["availability"] = availability constraint = {} constraint['constraint-type'] = 'end-to-end-diverse' - constraint['target'] = {'all-other-accesses': [None]} + constraint['target'] = {'all-other-accesses': None} access_diversity = {} access_diversity['constraints'] = {'constraint': []} diff --git a/src/nbi/service/ietf_l2vpn/Handlers.py b/src/nbi/service/ietf_l2vpn/Handlers.py index 1b8fc2b93dfc7d724e26954ea18f9e263a85cf3a..48b2eff147c6afb6f905c19aa57bad0a26f275a2 100644 --- a/src/nbi/service/ietf_l2vpn/Handlers.py +++ b/src/nbi/service/ietf_l2vpn/Handlers.py @@ -183,15 +183,14 @@ def process_site_network_access( constraint['constraint-type']:([ target[0] for target in constraint['target'].items() - if len(target[1]) == 1 ][0], raise_if_differs) for constraint in diversity_constraints } network_access_availability = network_access.get('availability', {}) access_priority : Optional[int] = network_access_availability.get('access-priority') - single_active : bool = len(network_access_availability.get('single-active', [])) > 0 - all_active : bool = len(network_access_availability.get('all-active', [])) > 0 + single_active : bool = 'single-active' in network_access_availability + all_active : bool = 'all-active' in network_access_availability context_client = ContextClient() service = get_service_by_uuid( diff --git a/src/nbi/service/ietf_l2vpn/yang/ietf-l2vpn-svc@2018-10-09.yang b/src/nbi/service/ietf_l2vpn/yang/ietf-l2vpn-svc@2018-10-09.yang index f2f5ddfb22e30e9232e914d071062f754bd7bc3f..f5c750733737352a2ee089d3f999d4d8ad68d5fb 100644 --- a/src/nbi/service/ietf_l2vpn/yang/ietf-l2vpn-svc@2018-10-09.yang +++ b/src/nbi/service/ietf_l2vpn/yang/ietf-l2vpn-svc@2018-10-09.yang @@ -971,6 +971,12 @@ module ietf-l2vpn-svc { "Identity for having sites connected using the same bearer."; } + identity end-to-end-diverse { + base placement-diversity; + description + "CUSTOM TERAFLOWSDN - Identity for having full end-to-end diverse connections."; + } + identity tagged-inf-type { description "Identity for the tagged interface type."; diff --git a/src/service/service/service_handlers/__init__.py b/src/service/service/service_handlers/__init__.py index 7a607acddff625b4413e8f3ae172523a8853fdd3..9535e6ba5664886a84918c89526229977e6ded09 100644 --- a/src/service/service/service_handlers/__init__.py +++ b/src/service/service/service_handlers/__init__.py @@ -106,7 +106,10 @@ SERVICE_HANDLERS = [ (TapiServiceHandler, [ { FilterFieldEnum.SERVICE_TYPE : ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE, - FilterFieldEnum.DEVICE_DRIVER : [DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API], + FilterFieldEnum.DEVICE_DRIVER : [ + DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API, + DeviceDriverEnum.DEVICEDRIVER_UNDEFINED, + ], } ]), (TapiXrServiceHandler, [ diff --git a/src/service/service/task_scheduler/TaskExecutor.py b/src/service/service/task_scheduler/TaskExecutor.py index a46be6414396bc8b997a93d01926d49fb6707bb7..ed9586629ed7de1127bab89123f72f0211ee123f 100644 --- a/src/service/service/task_scheduler/TaskExecutor.py +++ b/src/service/service/task_scheduler/TaskExecutor.py @@ -468,7 +468,7 @@ class TaskExecutor: except ( UnsatisfiedFilterException, UnsupportedFilterFieldException, UnsupportedFilterFieldValueException - ): + ) as e: dict_connection_devices = { cd_data.name : ( cd_uuid, @@ -488,6 +488,7 @@ class TaskExecutor: grpc_message_to_json_string(service), grpc_message_to_json_string(connection), str(dict_connection_devices) )) + raise e return service_handlers diff --git a/src/tests/ecoc22/Dockerfile b/src/tests/ecoc22/Dockerfile index 57a39950c4059c07efb8d333bc33690aa71c002a..a3f8af0cc2992c1b57297a9994704f3e0b520cab 100644 --- a/src/tests/ecoc22/Dockerfile +++ b/src/tests/ecoc22/Dockerfile @@ -88,6 +88,7 @@ COPY src/tests/tools/. ./tests/tools/ RUN tee ./run_tests.sh < Connections[{:d}] = {:s}'.format( grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) - if service.service_type == ServiceTypeEnum.SERVICETYPE_L2NM: + if service.service_type in {ServiceTypeEnum.SERVICETYPE_L2NM, ServiceTypeEnum.SERVICETYPE_L3NM}: assert len(response.connections) == 2 # 2 connections per service (primary + backup) elif service.service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE: assert len(response.connections) == 1 # 1 connection per service else: str_service = grpc_message_to_json_string(service) raise Exception('Unexpected ServiceType: {:s}'.format(str_service)) + + if service.service_status.service_status != ServiceStatusEnum.SERVICESTATUS_ACTIVE: + str_service = grpc_message_to_json_string(service) + raise Exception('Unexpected ServiceStatusEnum: {:s}'.format(str_service)) + diff --git a/src/tests/ecoc22/tests/test_functional_delete_service.py b/src/tests/ecoc22/tests/test_functional_delete_service.py index 550a42656a365560b050f019cfcd88fbad169740..2b50d6e0f44d73125afbf0d34f6a81611793a903 100644 --- a/src/tests/ecoc22/tests/test_functional_delete_service.py +++ b/src/tests/ecoc22/tests/test_functional_delete_service.py @@ -15,7 +15,7 @@ import logging, os from common.Constants import DEFAULT_CONTEXT_NAME -from common.proto.context_pb2 import ContextId, ServiceTypeEnum +from common.proto.context_pb2 import ContextId, ServiceStatusEnum, ServiceTypeEnum from common.tools.descriptor.Loader import DescriptorLoader from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.object_factory.Context import json_context_id @@ -34,11 +34,11 @@ def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # p # Ensure slices and services are created response = context_client.ListSlices(ADMIN_CONTEXT_ID) LOGGER.info('Slices[{:d}] = {:s}'.format(len(response.slices), grpc_message_to_json_string(response))) - assert len(response.slices) == 1 # OSM slice + assert len(response.slices) == 0 response = context_client.ListServices(ADMIN_CONTEXT_ID) LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response))) - assert len(response.services) == 3 # 1xL2NM + 2xTAPI + assert len(response.services) == 3 # 1xLxNM + 2xTAPI service_uuids = set() for service in response.services: @@ -47,7 +47,7 @@ def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # p LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format( grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response))) - if service.service_type == ServiceTypeEnum.SERVICETYPE_L2NM: + if service.service_type in {ServiceTypeEnum.SERVICETYPE_L2NM, ServiceTypeEnum.SERVICETYPE_L3NM}: assert len(response.connections) == 2 # 2 connections per service (primary + backup) service_uuid = service_id.service_uuid.uuid service_uuids.add(service_uuid) @@ -58,6 +58,10 @@ def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # p str_service = grpc_message_to_json_string(service) raise Exception('Unexpected ServiceType: {:s}'.format(str_service)) + if service.service_status.service_status != ServiceStatusEnum.SERVICESTATUS_ACTIVE: + str_service = grpc_message_to_json_string(service) + raise Exception('Unexpected ServiceStatusEnum: {:s}'.format(str_service)) + # Identify service to delete assert len(service_uuids) == 1 # assume a single L2NM service has been created service_uuid = set(service_uuids).pop() diff --git a/src/tests/ofc22/Dockerfile b/src/tests/ofc22/Dockerfile index 5fbf129223688e02933575c9fe65891e2c586bb7..ba19ecb4d6ff750ce79a70b300ba36b729c2c238 100644 --- a/src/tests/ofc22/Dockerfile +++ b/src/tests/ofc22/Dockerfile @@ -88,6 +88,7 @@ COPY src/tests/tools/. ./tests/tools/ RUN tee ./run_tests.sh < - while ! docker logs qkd-node-01 2>&1 | grep -q "All log messages before absl::InitializeLog() is called are written to STDERR"; do + while ! docker logs qkd-node-01 2>&1 | grep -q "Other threads are currently calling into gRPC, skipping fork() handlers"; do printf "%c" "." sleep 1 done - > - while ! docker logs qkd-node-02 2>&1 | grep -q "All log messages before absl::InitializeLog() is called are written to STDERR"; do + while ! docker logs qkd-node-02 2>&1 | grep -q "Other threads are currently calling into gRPC, skipping fork() handlers"; do printf "%c" "." sleep 1 done - > - while ! docker logs qkd-node-03 2>&1 | grep -q "All log messages before absl::InitializeLog() is called are written to STDERR"; do + while ! docker logs qkd-node-03 2>&1 | grep -q "Other threads are currently calling into gRPC, skipping fork() handlers"; do printf "%c" "." sleep 1 done diff --git a/src/tests/tools/mock_osm/WimconnectorIETFL2VPN.py b/src/tests/tools/mock_osm/WimconnectorIETFL2VPN.py index de940a7d2546885fe50dedbe8aa7d402730f6aa6..aaaac001407fbcd89dc46ab14886306f3b9d98ef 100644 --- a/src/tests/tools/mock_osm/WimconnectorIETFL2VPN.py +++ b/src/tests/tools/mock_osm/WimconnectorIETFL2VPN.py @@ -167,7 +167,7 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): """ SETTINGS = { # min_endpoints, max_endpoints, vpn_service_type 'ELINE': (2, 2, 'vpws'), # Virtual Private Wire Service - 'ELAN' : (2, None, 'vpls'), # Virtual Private LAN Service + 'ELAN' : (2, None, 'bgp-vpls'), # Virtual Private LAN Service } settings = SETTINGS.get(service_type) if settings is None: raise NotImplementedError('Unsupported service_type({:s})'.format(str(service_type))) @@ -291,12 +291,12 @@ class WimconnectorIETFL2VPN(SdnConnectorBase): if access_priority is not None: availability = {} availability["access-priority"] = access_priority - availability["single-active"] = [None] + availability["single-active"] = None site_network_access["availability"] = availability constraint = {} constraint['constraint-type'] = 'end-to-end-diverse' - constraint['target'] = {'all-other-accesses': [None]} + constraint['target'] = {'all-other-accesses': None} access_diversity = {} access_diversity['constraints'] = {'constraint': []}