-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run tests from docker image directly
Signed-off-by: Avi Deitcher <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
eden.escript.test -test.run TestEdenScripts/update_eve_image_http -test.timeout 60m | ||
eden.escript.test -test.run TestEdenScripts/update_eve_image_oci -test.timeout 60m |
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,50 @@ | ||
# Default EVE version to update | ||
{{$eve_ver := "6.0.0"}} | ||
|
||
# Obtain EVE version from environment variable EVE_VERSION | ||
{{$env := EdenGetEnv "EVE_VERSION"}} | ||
|
||
# If environment variable EVE_VERSION set, use it instead of default | ||
{{if $env}}{{$eve_ver = $env}}{{end}} | ||
|
||
# Obtain eve.hv from config | ||
{{$eve_hv := EdenConfig "eve.hv"}} | ||
|
||
# Obtain eve.arch from config | ||
{{$eve_arch := EdenConfig "eve.arch"}} | ||
|
||
# Combine variables into $short_version | ||
{{$short_version := printf "%s-%s-%s" $eve_ver $eve_hv $eve_arch}} | ||
|
||
# Use eden.lim.test for access Infos with timewait 30m | ||
{{$test := "test eden.lim.test -test.v -timewait 30m -test.run TestInfo"}} | ||
|
||
# Send command to update eveimage from OCI image | ||
message 'EVE update request' | ||
eden -t 10m controller edge-node eveimage-update oci://docker.io/lfedge/eve:{{$eve_ver}}-{{$eve_hv}} -m adam:// | ||
|
||
# Check stderr, it must be empty | ||
! stderr . | ||
|
||
# Run monitoring of Info messages to obtain info with PartitionState inprogress or active and previously defined ShortVersion | ||
message 'Waiting for EVE update...' | ||
{{$test}} -out InfoContent.dinfo.SwList[0].ShortVersion 'InfoContent.dinfo.SwList[0].PartitionState:inprogress|active InfoContent.dinfo.SwList[0].ShortVersion:{{ $short_version }}' | ||
|
||
# Check stdout of previous command. Expected to get previously defined ShortVersion | ||
stdout '{{ $short_version }}' | ||
|
||
# Reset EVE version | ||
test eden.escript.test -test.run TestEdenScripts/revert_eve_image_update -test.v -testdata {{EdenConfig "eden.tests"}}/update_eve_image/testdata/ | ||
|
||
# Reset EVE config | ||
eden eve reset | ||
|
||
# Test's config file | ||
-- eden-config.yml -- | ||
test: | ||
controller: adam://{{EdenConfig "adam.ip"}}:{{EdenConfig "adam.port"}} | ||
eve: | ||
{{EdenConfig "eve.name"}}: | ||
onboard-cert: {{EdenConfigPath "eve.cert"}} | ||
serial: "{{EdenConfig "eve.serial"}}" | ||
model: {{EdenConfig "eve.devmodel"}} |
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