Skip to content

Commit

Permalink
Merge pull request #106 from thin-edge/fix-firmware-publish-retain
Browse files Browse the repository at this point in the history
fix(systemd): publish firmware information with retain flag
  • Loading branch information
reubenmiller authored Oct 5, 2024
2 parents 994160b + 7515f3a commit 7d592be
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion images/common/utils/set-startup-info
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
TARGET="$(tedge config get mqtt.topic_root)/$(tedge config get mqtt.device_topic_id)"

# firmware
tedge mqtt pub --qos 1 "$TARGET/twin/firmware" "$(printf '{"name": "iot-linux", "version": "1.0.0"}')"
tedge mqtt pub -r --qos 1 "$TARGET/twin/firmware" "$(printf '{"name": "iot-linux", "version": "1.0.0"}')"

# Trigger inventory service on startup
if command -V systemd; then
Expand Down
3 changes: 3 additions & 0 deletions tests/debian-systemd/children-systemd/operations.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Suite Setup Set Child Device2

*** Test Cases ***

Firmware information should be shown on startup
Cumulocity.Managed Object Should Have Fragment Values c8y_Firmware.name\=iot-linux c8y_Firmware.version\=1.0.0

Install Firmware
Cumulocity.Should Have Services name=tedge-agent status=up
${date_from}= Get Test Start Time
Expand Down
12 changes: 12 additions & 0 deletions tests/debian-systemd/main/operations.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ Suite Setup Set Main Device

*** Test Cases ***

Firmware information should be shown on startup
Cumulocity.Managed Object Should Have Fragment Values c8y_Firmware.name\=iot-linux c8y_Firmware.version\=1.0.0

Install Firmware
Cumulocity.Should Have Services name=tedge-agent status=up
${date_from}= Get Test Start Time
Sleep 1s
${binary_url}= Cumulocity.Create Inventory Binary iot-linux child-firmware contents=dummy_file
${operation}= Cumulocity.Install Firmware name=iot-linux version=2.0.0 url=${binary_url}
Operation Should Be SUCCESSFUL ${operation} timeout=90
Cumulocity.Managed Object Should Have Fragment Values c8y_Firmware.name\=iot-linux c8y_Firmware.version\=2.0.0 c8y_Firmware.url\=${binary_url}

Restart device
${date_from}= Get Test Start Time
Sleep 1s
Expand Down

3 comments on commit 7d592be

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
14 0 0 14 100 1m3.584s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
7 0 0 7 100 51.273999999s

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
11 0 2 11 100 50.379s

Please sign in to comment.