-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from thin-edge/fix-self-update-from-older-vers…
…ions fix(self-update): add compatibility script to update from older versions
- Loading branch information
Showing
5 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
# Compatibility script for updating of images from older versions <= 20241126.1855 | ||
# | ||
|
||
# | ||
# Argument parsing | ||
# | ||
ACTION="$1" | ||
shift | ||
|
||
IMAGE= | ||
CURRENT_CONTAINER_ID= | ||
|
||
DOCKER_CMD=docker | ||
if ! docker ps >/dev/null 2>&1; then | ||
if command -V sudo >/dev/null 2>&1; then | ||
DOCKER_CMD="sudo docker" | ||
fi | ||
fi | ||
|
||
while [ $# -gt 0 ]; do | ||
case "$1" in | ||
--image) | ||
IMAGE="$2" | ||
shift | ||
;; | ||
--container-name) | ||
# not used | ||
shift | ||
;; | ||
--container-id) | ||
CURRENT_CONTAINER_ID="$2" | ||
shift | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
case "$ACTION" in | ||
update) | ||
# In previous images, only docker was supported | ||
echo "Calling legacy update script (upgrading from an image <= 20241126.1855)" | ||
$DOCKER_CMD run -t --rm \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
"$IMAGE" sudo tedge-container tools container-clone --container "$CURRENT_CONTAINER_ID" --image "$IMAGE" | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
*** Settings *** | ||
Resource ../resources/common.resource | ||
Library DateTime | ||
|
||
Test Teardown Stop Device | ||
|
||
Test Tags self-update | ||
|
||
|
||
*** Test Cases *** | ||
Update From Legacy Versions | ||
[Template] Upgrade From Base Image | ||
ghcr.io/thin-edge/tedge-container-bundle:20241126.1855 tedge-container-bundle:20241126.1855 | ||
|
||
|
||
*** Keywords *** | ||
Upgrade From Base Image | ||
[Arguments] ${IMAGE} ${SOFTWARE_VERSION} | ||
# pre-condition | ||
Setup Device image=${IMAGE} | ||
|
||
${major_version}= Execute Command | ||
... podman --version | cut -d' ' -f3 | cut -d. -f1 | ||
... ignore_exit_code=${True} | ||
... strip=${True} | ||
Skip If '${major_version}' == '4' Legacy images didn't support podman 4.x | ||
|
||
Device Should Have Installed Software | ||
... {"name": "tedge", "version": "${SOFTWARE_VERSION}", "softwareType": "self"} timeout=10 | ||
|
||
${operation}= Cumulocity.Install Software | ||
... {"name": "tedge", "version": "ghcr.io/thin-edge/tedge-container-bundle:99.99.1", "softwareType": "self"} | ||
|
||
Cumulocity.Operation Should Be SUCCESSFUL ${operation} timeout=120 | ||
Device Should Have Installed Software | ||
... {"name": "tedge", "version": "tedge-container-bundle:99.99.1", "softwareType": "self"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry
47b65d2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
Passed Tests
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Self-Update-Compat
Self-Update
Self-Update
Self-Update
Self-Update
Telemetry
Telemetry
Telemetry