From 780f5022884e319be3273245af5baddb4c3acc8b Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Tue, 31 Jan 2023 17:09:26 +0000 Subject: [PATCH 1/3] Device component: - Emulated driver: minor fix to support dot-based endpoint names --- src/device/service/drivers/emulated/EmulatedDriver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/device/service/drivers/emulated/EmulatedDriver.py b/src/device/service/drivers/emulated/EmulatedDriver.py index 5d2ac6d03..546527de0 100644 --- a/src/device/service/drivers/emulated/EmulatedDriver.py +++ b/src/device/service/drivers/emulated/EmulatedDriver.py @@ -156,6 +156,7 @@ class EmulatedDriver(_Driver): match = RE_GET_ENDPOINT_FROM_INTERFACE.match(resource_key) if match is not None: endpoint_uuid = match.group(1) + if '.' in endpoint_uuid: endpoint_uuid = endpoint_uuid.split('.')[0] self.__synthetic_sampling_parameters.set_endpoint_configured(endpoint_uuid) results.append(True) @@ -190,6 +191,7 @@ class EmulatedDriver(_Driver): match = RE_GET_ENDPOINT_FROM_INTERFACE.match(resource_key) if match is not None: endpoint_uuid = match.group(1) + if '.' in endpoint_uuid: endpoint_uuid = endpoint_uuid.split('.')[0] self.__synthetic_sampling_parameters.unset_endpoint_configured(endpoint_uuid) parent = resource_node.parent -- GitLab From cde4891ed73f0a434cb69896a910a62f64fb0c0c Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Tue, 31 Jan 2023 17:09:46 +0000 Subject: [PATCH 2/3] Monitoring component: - Fixed hardcoded table name in SQL statement --- src/monitoring/service/MonitoringServiceServicerImpl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monitoring/service/MonitoringServiceServicerImpl.py b/src/monitoring/service/MonitoringServiceServicerImpl.py index bf9e7cabd..08fb69c38 100644 --- a/src/monitoring/service/MonitoringServiceServicerImpl.py +++ b/src/monitoring/service/MonitoringServiceServicerImpl.py @@ -592,7 +592,7 @@ class MonitoringServiceServicerImpl(MonitoringServiceServicer): LOGGER.info('GetInstantKpi error: KpiID({:s}): not found in database'.format(str(kpi_id))) response.kpi_id.kpi_id.uuid = "NoID" else: - query = f"SELECT kpi_id, timestamp, kpi_value FROM monitoring WHERE kpi_id = '{kpi_id}' " \ + query = f"SELECT kpi_id, timestamp, kpi_value FROM {METRICSDB_TABLE} WHERE kpi_id = '{kpi_id}' " \ f"LATEST ON timestamp PARTITION BY kpi_id" data = self.metrics_db.run_query(query) LOGGER.debug(data) -- GitLab From cf49da53a430d3e0c144b8f385a9a6447bfefd24 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Tue, 31 Jan 2023 17:10:43 +0000 Subject: [PATCH 3/3] OFC'22 tests: - updated descriptors --- src/tests/ofc22/descriptors_emulated.json | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/tests/ofc22/descriptors_emulated.json b/src/tests/ofc22/descriptors_emulated.json index a71d454f4..aa76edecd 100644 --- a/src/tests/ofc22/descriptors_emulated.json +++ b/src/tests/ofc22/descriptors_emulated.json @@ -1,28 +1,9 @@ { "contexts": [ - { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_ids": [], - "service_ids": [] - } + {"context_id": {"context_uuid": {"uuid": "admin"}}} ], "topologies": [ - { - "topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}, - "device_ids": [ - {"device_uuid": {"uuid": "R1-EMU"}}, - {"device_uuid": {"uuid": "R2-EMU"}}, - {"device_uuid": {"uuid": "R3-EMU"}}, - {"device_uuid": {"uuid": "R4-EMU"}}, - {"device_uuid": {"uuid": "O1-OLS"}} - ], - "link_ids": [ - {"link_uuid": {"uuid": "R1-EMU/13/0/0==O1-OLS/aade6001-f00b-5e2f-a357-6a0a9d3de870"}}, - {"link_uuid": {"uuid": "R2-EMU/13/0/0==O1-OLS/eb287d83-f05e-53ec-ab5a-adf6bd2b5418"}}, - {"link_uuid": {"uuid": "R3-EMU/13/0/0==O1-OLS/0ef74f99-1acc-57bd-ab9d-4b958b06c513"}}, - {"link_uuid": {"uuid": "R4-EMU/13/0/0==O1-OLS/50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}} - ] - } + {"topology_id": {"topology_uuid": {"uuid": "admin"}, "context_id": {"context_uuid": {"uuid": "admin"}}}} ], "devices": [ { -- GitLab