From 48fe6a92c4d07c01f050a06f7802817b60e0bb98 Mon Sep 17 00:00:00 2001 From: Albin Suresh Date: Fri, 24 May 2024 13:08:45 +0000 Subject: [PATCH] fix(mqtt): Publish mosquitto bridge status to c8y when enabled --- crates/extensions/c8y_mapper_ext/src/converter.rs | 3 ++- .../cumulocity/service_monitoring/service_monitoring.robot | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/extensions/c8y_mapper_ext/src/converter.rs b/crates/extensions/c8y_mapper_ext/src/converter.rs index b8d35b9ed01..46bfc0af887 100644 --- a/crates/extensions/c8y_mapper_ext/src/converter.rs +++ b/crates/extensions/c8y_mapper_ext/src/converter.rs @@ -359,7 +359,8 @@ impl CumulocityConverter { let ancestors_external_ids = self.entity_store.ancestors_external_ids(entity_topic_id)?; - if entity_topic_id.is_bridge_health_topic() { + if self.config.bridge_in_mapper && entity_topic_id.is_bridge_health_topic() { + // Skip service creation for the mapper-inbuilt bridge, as it is part of the mapper service itself return Ok(vec![]); } diff --git a/tests/RobotFramework/tests/cumulocity/service_monitoring/service_monitoring.robot b/tests/RobotFramework/tests/cumulocity/service_monitoring/service_monitoring.robot index 6b5308269e1..cccada04b1e 100644 --- a/tests/RobotFramework/tests/cumulocity/service_monitoring/service_monitoring.robot +++ b/tests/RobotFramework/tests/cumulocity/service_monitoring/service_monitoring.robot @@ -27,6 +27,10 @@ Test if all c8y services are up tedge-agent c8y-firmware-plugin +Test bridge service status up + External Identity Should Exist ${DEVICE_SN}:device:main:service:mosquitto-c8y-bridge show_info=False + Cumulocity.Managed Object Should Have Fragment Values status\=up timeout=${TIMEOUT} + Test if all c8y services are down [Template] Check if a service is down tedge-mapper-c8y