Skip to content

Commit

Permalink
add keyword to get the correct bridge service name
Browse files Browse the repository at this point in the history
Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
  • Loading branch information
reubenmiller committed Jul 31, 2024
1 parent c773ec6 commit 224c182
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions tests/RobotFramework/libraries/ThinEdgeIO/ThinEdgeIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,20 @@ def configure_ssh(self, user: str = "root", device: str = None) -> str:
)
return str(key)

@keyword("Get Bridge Service Name")
def get_bridge_service_name(self, cloud: str) -> str:
"""Get the name of the bridge service.
The service name will depend if the built-in bridge
has been activated or not (on the device).
"""
output = self.execute_command("tedge config get mqtt.bridge.built_in", strip=True, ignore_exit_code=True)
if output == "true":
return f"tedge-mapper-bridge-{cloud}"

# Legacy mosquitto bridge
return f"mosquitto-{cloud}-bridge"


def to_date(value: relativetime_) -> datetime:
if isinstance(value, datetime):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ Test if all c8y services are up
c8y-firmware-plugin

Test bridge service status up
External Identity Should Exist ${DEVICE_SN}:device:main:service:mosquitto-c8y-bridge show_info=False
${SERVICE_NAME}= Get Bridge Service Name cloud=c8y
External Identity Should Exist ${DEVICE_SN}:device:main:service:${SERVICE_NAME} show_info=False
Cumulocity.Managed Object Should Have Fragment Values status\=up timeout=${TIMEOUT}

Test mosquitto bridge service status mapping
Expand Down

0 comments on commit 224c182

Please sign in to comment.