Skip to content

Commit

Permalink
run tests from docker image directly
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Deitcher <[email protected]>
  • Loading branch information
deitch committed Mar 11, 2021
1 parent 00b9769 commit 7db2341
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/update_eve_image/eden.update_eve_image.tests.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
eden.escript.test -test.run TestEdenScripts/update_eve_image -test.timeout 10m
eden.escript.test -test.run TestEdenScripts/update_eve_image_oci -test.timeout 10m
45 changes: 45 additions & 0 deletions tests/update_eve_image/testdata/update_eve_image_oci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Default EVE version to update
{{$eve_ver := "6.1.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://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 }}'


# 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"}}

0 comments on commit 7db2341

Please sign in to comment.