diff --git a/crates/core/tedge_agent/src/agent.rs b/crates/core/tedge_agent/src/agent.rs index 1e60556ff58..3137a1306a0 100644 --- a/crates/core/tedge_agent/src/agent.rs +++ b/crates/core/tedge_agent/src/agent.rs @@ -280,9 +280,6 @@ impl Agent { &self.config.service, ); - // Tedge to Te topic converter - let tedge_to_te_converter = create_tedge_to_te_converter(&mut mqtt_actor_builder)?; - let mut fs_watch_actor_builder = FsWatchActorBuilder::new(); let mut downloader_actor_builder = DownloaderActor::new( self.config.identity.clone(), @@ -347,6 +344,8 @@ impl Agent { if is_main_device { info!("Running as a main device, starting tedge_to_te_converter and File Transfer Service"); + // Tedge to Te topic converter + let tedge_to_te_converter = create_tedge_to_te_converter(&mut mqtt_actor_builder)?; runtime.spawn(tedge_to_te_converter).await?; let file_transfer_server_builder = diff --git a/tests/RobotFramework/tests/tedge_agent/tedge_agent_as_child.robot b/tests/RobotFramework/tests/tedge_agent/tedge_agent_as_child.robot index a51c519505a..fdf9118646f 100644 --- a/tests/RobotFramework/tests/tedge_agent/tedge_agent_as_child.robot +++ b/tests/RobotFramework/tests/tedge_agent/tedge_agent_as_child.robot @@ -14,6 +14,12 @@ Run agent with a custom topic prefix #3031 Should Not Contain ${output} te/ Should Contain ${output} custom_root/device/customname// +tedge-agent should not subscribe to legacy topics when running as a child device #3034 + # Only run tedge-agent for a few seconds + ${output}= Execute Command timeout 5 tedge-agent --mqtt-device-topic-id "device/pump//" 2>&1 ignore_exit_code=${True} + Should Contain ${output} Running as a child device, tedge_to_te_converter and File Transfer Service disabled + Should Not Contain ${output} item=${SPACE}tedge/ + *** Keywords ***