Pre release CI/CD fixes

Pre release CI/CD fixes

Edited by Lluis Gifre Renom

Merge request reports

Loading
+1 −1
Changes for src/context/service/database/Constraint.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ def upsert_constraints(
        stmt = delete(klass)
        if service_uuid is not None: stmt = stmt.where(klass.service_uuid == service_uuid)
        if slice_uuid   is not None: stmt = stmt.where(klass.slice_uuid   == slice_uuid  )
        stmt = stmt.where(klass.constraint_uuid.in_(uuids_to_delete)
        stmt = stmt.where(klass.constraint_uuid.in_(uuids_to_delete))
        #str_stmt = stmt.compile(dialect=postgresql.dialect(), compile_kwargs={"literal_binds": True})
        #LOGGER.warning('delete stmt={:s}'.format(str(str_stmt)))
        constraint_deletes = session.execute(stmt)
+2 −2
Changes for src/device/requirements.in: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@


anytree==2.8.0
APScheduler==3.8.1
APScheduler==3.10.1
cryptography==36.0.2
#fastcache==1.1.0
Jinja2==3.0.3
@@ -22,7 +22,7 @@ ncclient==0.6.13
p4runtime==1.3.0
paramiko==2.9.2
python-json-logger==2.0.2
pytz==2021.3
#pytz==2021.3
#redis==4.1.2
requests==2.27.1
requests-mock==1.9.3
+1 −1
Changes for src/load_generator/requirements.in: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

APScheduler==3.8.1
APScheduler==3.10.1
+5 −2
Changes for src/monitoring/service/EventTools.py: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -121,9 +121,12 @@ class EventsDeviceCollector:
                        enabled_endpoint_names.add(json_resource_value['name'])

                    for endpoint in device.device_endpoints:
                        if endpoint.name not in enabled_endpoint_names: continue

                        endpoint_uuid = endpoint.endpoint_id.endpoint_uuid.uuid
                        endpoint_name_or_uuid = endpoint.name
                        if endpoint_name_or_uuid is None or len(endpoint_name_or_uuid) == 0:
                            endpoint_name_or_uuid = endpoint_uuid
                        if endpoint_name_or_uuid not in enabled_endpoint_names: continue

                        self._name_mapping.set_endpoint_name(endpoint_uuid, endpoint.name)

                        for value in endpoint.kpi_sample_types:
+8 −4
Changes for src/monitoring/tests/test_unitary.py: 8 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
# limitations under the License.

import copy, os, pytest #, threading, time
import logging
import logging, json
#from queue import Queue
from random import random
from time import sleep
@@ -25,12 +25,13 @@ from grpc._channel import _MultiThreadedRendezvous
from common.Constants import ServiceNameEnum
from common.Settings import (
    ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc)
from common.proto.context_pb2 import DeviceOperationalStatusEnum, EventTypeEnum, DeviceEvent, Device, Empty
from common.proto.context_pb2 import ConfigActionEnum, DeviceOperationalStatusEnum, EventTypeEnum, DeviceEvent, Device, Empty
from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server
from common.proto.kpi_sample_types_pb2 import KpiSampleType
from common.proto.monitoring_pb2 import KpiId, KpiDescriptor, SubsDescriptor, SubsList, AlarmID, \
    AlarmDescriptor, AlarmList, KpiDescriptorList, SubsResponse, AlarmResponse, RawKpiTable #, Kpi, KpiList
from common.tests.MockServicerImpl_Context import MockServicerImpl_Context
from common.tools.object_factory.ConfigRule import json_config_rule_set
from common.tools.service.GenericGrpcService import GenericGrpcService
from common.tools.timestamp.Converters import timestamp_utcnow_to_float #, timestamp_string_to_float
from context.client.ContextClient import ContextClient
@@ -48,7 +49,7 @@ from monitoring.service.NameMapping import NameMapping
#from monitoring.service.SubscriptionManager import SubscriptionManager
from monitoring.tests.Messages import create_kpi_request, create_kpi_request_d, include_kpi_request, monitor_kpi_request, \
    create_kpi_request_c, kpi_query, subs_descriptor, alarm_descriptor, alarm_subscription #, create_kpi_request_b
from monitoring.tests.Objects import DEVICE_DEV1, DEVICE_DEV1_CONNECT_RULES, DEVICE_DEV1_UUID
from monitoring.tests.Objects import DEVICE_DEV1, DEVICE_DEV1_CONNECT_RULES, DEVICE_DEV1_UUID, ENDPOINT_END1_UUID

os.environ['DEVICE_EMULATED_ONLY'] = 'TRUE'
from device.service.drivers import DRIVERS  # pylint: disable=wrong-import-position,ungrouped-imports
@@ -605,11 +606,14 @@ def test_listen_events(
    assert response.device_uuid.uuid == DEVICE_DEV1_UUID

    LOGGER.info('Activating Device {:s}'.format(DEVICE_DEV1_UUID))

    device = context_client.GetDevice(response)
    device_with_op_state = Device()
    device_with_op_state.CopyFrom(device)
    device_with_op_state.device_operational_status = DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED
    config_rule = device_with_op_state.device_config.config_rules.add()
    config_rule.action = ConfigActionEnum.CONFIGACTION_SET
    config_rule.custom.resource_key = '/interface[{:s}]'.format(ENDPOINT_END1_UUID)
    config_rule.custom.resource_value = json.dumps({'name': ENDPOINT_END1_UUID, 'enabled': True})
    response = context_client.SetDevice(device_with_op_state)
    assert response.device_uuid.uuid == DEVICE_DEV1_UUID

Loading
Loading