diff --git a/src/pathcomp/frontend/tests/test_ero_path.py b/src/pathcomp/frontend/tests/test_ero_path.py index 82fca7570007aacd4317525c7e4058d8880f15f1..e263544a00e104065495fda3f2c85f1528ad8561 100644 --- a/src/pathcomp/frontend/tests/test_ero_path.py +++ b/src/pathcomp/frontend/tests/test_ero_path.py @@ -1,3 +1,17 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import logging from typing import Any, Dict, List, Tuple #from common.proto.context_pb2 import Link diff --git a/src/service/.gitlab-ci.yml b/src/service/.gitlab-ci.yml index b1657dd9fd823441cc218eda8dd21f6e40fcf66a..c9ff94ac915386ac05d91661fc2cb1a53bb0e65d 100644 --- a/src/service/.gitlab-ci.yml +++ b/src/service/.gitlab-ci.yml @@ -136,7 +136,6 @@ unit_test service: # Service preparation - > docker run --name $IMAGE_NAME -d -p 3030:3030 - --env "LOG_LEVEL=DEBUG" --env "CONTEXTSERVICE_SERVICE_HOST=${CONTEXTSERVICE_SERVICE_HOST}" --env "DEVICESERVICE_SERVICE_HOST=${DEVICESERVICE_SERVICE_HOST}" --env "PATHCOMPSERVICE_SERVICE_HOST=${PATHCOMPSERVICE_SERVICE_HOST}" diff --git a/src/service/service/ServiceServiceServicerImpl.py b/src/service/service/ServiceServiceServicerImpl.py index 2df710a564e2ac72ee5fe5cbd4499bd5b686c2e1..141c6cb3ce84709d601b0510a61e1c497aa3f598 100644 --- a/src/service/service/ServiceServiceServicerImpl.py +++ b/src/service/service/ServiceServiceServicerImpl.py @@ -102,9 +102,9 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): if constraint.WhichOneof('constraint') != 'endpoint_location': continue location_aware = True - LOGGER.warning('location_aware={:s}'.format(str(location_aware))) + LOGGER.debug('location_aware={:s}'.format(str(location_aware))) if _service is not None and location_aware: - LOGGER.warning('removing previous service') + LOGGER.debug(' Removing previous service') tasks_scheduler = TasksScheduler(self.service_handler_factory) tasks_scheduler.compose_from_service(_service, is_delete=True) tasks_scheduler.execute_all() @@ -122,7 +122,7 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): device_list = context_client.ListDevices(Empty()) - LOGGER.warning('[before] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[before] request={:s}'.format(grpc_message_to_json_string(request))) for constraint in request.service_constraints: if constraint.action == ConstraintActionEnum.CONSTRAINTACTION_UNDEFINED: # Field action is new; assume if not set, it means SET @@ -150,8 +150,8 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): if closer_endpoint_id not in service_endpoint_ids: service.service_endpoint_ids.append(closer_endpoint_id) - LOGGER.warning('[after] request={:s}'.format(grpc_message_to_json_string(request))) - LOGGER.warning('[after] service={:s}'.format(grpc_message_to_json_string(service))) + LOGGER.debug('[after] request={:s}'.format(grpc_message_to_json_string(request))) + LOGGER.debug('[after] service={:s}'.format(grpc_message_to_json_string(service))) del service.service_constraints[:] # pylint: disable=no-member for constraint in request.service_constraints: @@ -187,11 +187,11 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): else: pathcomp_request.k_disjoint_path.num_disjoint = num_disjoint_paths # pylint: disable=no-member - LOGGER.warning('pathcomp_request={:s}'.format(grpc_message_to_json_string(pathcomp_request))) + LOGGER.debug('pathcomp_request={:s}'.format(grpc_message_to_json_string(pathcomp_request))) pathcomp = PathCompClient() pathcomp_reply = pathcomp.Compute(pathcomp_request) pathcomp.close() - LOGGER.warning('pathcomp_reply={:s}'.format(grpc_message_to_json_string(pathcomp_reply))) + LOGGER.debug('pathcomp_reply={:s}'.format(grpc_message_to_json_string(pathcomp_reply))) # Feed TaskScheduler with this path computation reply. TaskScheduler identifies inter-dependencies among # the services and connections retrieved and produces a schedule of tasks (an ordered list of tasks to be diff --git a/src/service/tests/test_unitary.py b/src/service/tests/test_unitary.py index b8bb0b7ed52d9be19d1eb64f2d7ff005079fc1f9..366add517994c255abd29056f2ab523de3752a37 100644 --- a/src/service/tests/test_unitary.py +++ b/src/service/tests/test_unitary.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import copy, grpc, json, logging, pytest +import copy, grpc, logging, pytest from common.proto.context_pb2 import ( Context, ContextId, Device, DeviceId, Link, LinkId, Service, ServiceId, Topology, TopologyId) from common.tests.PytestGenerateTests import pytest_generate_tests # (required) pylint: disable=unused-import @@ -47,9 +47,7 @@ class TestServiceHandlers: for context in contexts: context_client.SetContext(Context(**context)) for topology in topologies: context_client.SetTopology(Topology(**topology)) - for device in devices: - LOGGER.warning('device: {:s}'.format(json.dumps(device))) - device_client.AddDevice(Device(**device)) + for device in devices: device_client.AddDevice(Device(**device)) for link in links: context_client.SetLink(Link(**link))