-
Notifications
You must be signed in to change notification settings - Fork 56
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 #2399 from albinsuresh/bug/2396/tedge-plugin-migra…
…te-c8y-plugin-config Tedge operation plugins to migrate legacy config file contents
- Loading branch information
Showing
6 changed files
with
83 additions
and
1 deletion.
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
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
25 changes: 25 additions & 0 deletions
25
tests/RobotFramework/tests/cumulocity/configuration/backward_compatibility.robot
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,25 @@ | ||
*** Settings *** | ||
Resource ../../../resources/common.resource | ||
Library ThinEdgeIO | ||
Library Cumulocity | ||
|
||
Test Teardown Get Logs name=${DEVICE_SN} | ||
|
||
Test Tags theme:configuration theme:installation | ||
|
||
*** Test Cases *** | ||
|
||
Migrate Legacy Configuration Files | ||
${DEVICE_SN}= Setup skip_bootstrap=${True} | ||
Set Suite Variable $DEVICE_SN | ||
|
||
# Copy old c8y-configuration-plugin's config file before bootstrapping | ||
ThinEdgeIO.Execute Command rm -f /etc/tedge/plugins/* | ||
ThinEdgeIO.Transfer To Device ${CURDIR}/c8y-configuration-plugin.toml /etc/tedge/c8y/ | ||
ThinEdgeIO.Transfer To Device ${CURDIR}/config1.json /etc/ | ||
|
||
# Bootstrap the tedge-config-plugin so that it picks up the old c8y-configuration-plugin.toml | ||
Execute Command ./bootstrap.sh | ||
Cumulocity.Device Should Exist ${DEVICE_SN} | ||
${operation}= Cumulocity.Get Configuration TEST_CONFIG | ||
${operation}= Operation Should Be SUCCESSFUL ${operation} |
3 changes: 3 additions & 0 deletions
3
tests/RobotFramework/tests/cumulocity/configuration/c8y-configuration-plugin.toml
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,3 @@ | ||
files = [ | ||
{ path = '/etc/config1.json', type = 'TEST_CONFIG', user = 'tedge', group = 'tedge', mode = 0o640 }, | ||
] |
29 changes: 29 additions & 0 deletions
29
tests/RobotFramework/tests/cumulocity/log/backward_compatibility.robot
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,29 @@ | ||
*** Settings *** | ||
Resource ../../../resources/common.resource | ||
Library ThinEdgeIO | ||
Library Cumulocity | ||
|
||
Test Teardown Get Logs name=${DEVICE_SN} | ||
|
||
Test Tags theme:troubleshooting theme:installation | ||
|
||
*** Test Cases *** | ||
|
||
Migrate Legacy Configuration Files | ||
${DEVICE_SN}= Setup skip_bootstrap=${True} | ||
Set Suite Variable $DEVICE_SN | ||
|
||
# Copy old c8y-log-plugin's config file before bootstrapping | ||
ThinEdgeIO.Execute Command rm -f /etc/tedge/plugins/* | ||
ThinEdgeIO.Transfer To Device ${CURDIR}/tedge-log-plugin.toml /etc/tedge/c8y/c8y-log-plugin.toml | ||
ThinEdgeIO.Transfer To Device ${CURDIR}/example.log /var/log/example/ | ||
# touch file again to change last modified timestamp, otherwise the logfile retrieval could be outside of the requested range | ||
Execute Command | ||
... chown root:root /etc/tedge/c8y/c8y-log-plugin.toml /var/log/example/example.log && touch /var/log/example/example.log | ||
|
||
# Bootstrap the tedge-log-plugin so that it picks up the old c8y-log-plugin.toml | ||
Execute Command ./bootstrap.sh | ||
Cumulocity.Device Should Exist ${DEVICE_SN} | ||
|
||
${operation}= Cumulocity.Get Log File example | ||
${operation}= Operation Should Be SUCCESSFUL ${operation} |