Skip to content

Commit

Permalink
Small fixes for unstable eden tests
Browse files Browse the repository at this point in the history
Mostly just increasing timeouts where we often see EVE not being fast
enough when run by slow Github runners.

Signed-off-by: Milan Lenco <milan@zededa.com>
  • Loading branch information
milan-zededa authored and giggsoff committed May 11, 2023
1 parent 22b7624 commit f8748ae
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 18 deletions.
18 changes: 13 additions & 5 deletions tests/eclient/testdata/dev_local_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test eden.network.test -test.v -timewait 10m ACTIVATED {{template "network"}}

# Deploy local-manager
eden pod deploy -n local-manager --memory=512MB {{template "eclient_image"}} -p {{template "mngr_port"}}:22 --networks={{template "network"}}
test eden.app.test -test.v -timewait 10m RUNNING local-manager
test eden.app.test -test.v -timewait 15m RUNNING local-manager

# Wait for ssh access
exec -t 5m bash wait-ssh.sh {{template "mngr_port"}}
Expand All @@ -54,7 +54,7 @@ exec -t 10m bash get-devinfo-status.sh

# STEP 2: Deploy the second app
eden pod deploy -n app1 --memory=512MB {{template "eclient_image"}} -p {{template "app_port"}}:22 --networks={{template "network"}}
test eden.app.test -test.v -timewait 10m RUNNING app1
test eden.app.test -test.v -timewait 15m RUNNING app1

# Wait for ssh access
exec -t 5m bash wait-ssh.sh {{template "app_port"}}
Expand Down Expand Up @@ -123,9 +123,7 @@ exec -t 1m bash eden-pod-ps.sh local-manager
! stderr .

# STEP 7: Check qemu process is gone aka powered off
exec sleep 120
eden eve status
stdout 'EVE.*process not running'
exec -t 5m bash wait-for-eve-to-stop.sh

# STEP 8: Restart EVE; check apps come up
message 'Restart EVE'
Expand Down Expand Up @@ -234,6 +232,16 @@ while true; do
sleep 1
done

-- wait-for-eve-to-stop.sh --

EDEN={{EdenConfig "eden.root"}}/{{EdenConfig "eden.bin-dist"}}/{{EdenConfig "eden.eden-bin"}}

while true; do
STATUS="$($EDEN eve status)"
echo "$STATUS" | grep "EVE.*process not running" && break
sleep 3
done

-- eden-config.yml --
{{/* Test's config file */}}
test:
Expand Down
14 changes: 12 additions & 2 deletions tests/eclient/testdata/networking_light.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ exec sleep 10
exec -t 1m bash setup_srv.sh
exec sleep 10
exec -t 1m bash run_srv.sh &
exec sleep 10
exec -t 1m bash run_client.sh
exec sleep 10
exec -t 1m bash get_result.sh
Expand All @@ -55,7 +54,6 @@ exec sleep 10
exec -t 1m bash setup_srv.sh
exec sleep 10
exec -t 1m bash run_srv.sh &
exec sleep 10
exec -t 1m bash run_client.sh
exec sleep 10
exec -t 1m bash get_result.sh
Expand Down Expand Up @@ -104,6 +102,18 @@ $EDEN sdn fwd eth0 {{template "port"}} -- {{template "ssh"}} 'sh /tmp/server > /
EDEN={{EdenConfig "eden.root"}}/{{EdenConfig "eden.bin-dist"}}/{{EdenConfig "eden.eden-bin"}}
. ./env

function check_server_port {
# get to server app via client app
listeners=$($EDEN sdn fwd eth0 {{template "port"}} -- {{template "ssh"}} ssh -o StrictHostKeyChecking=no root@$ESERVER_IP netstat -tlpn)
echo "Current listeners: $listeners"
if echo "$listeners" | grep -q ":1234"; then
return 0
fi
return 1
}

until check_server_port; do sleep 3; done

echo $EDEN sdn fwd eth0 {{template "port"}} -- {{template "ssh"}} "echo {{$test_msg}} | nc -N $ESERVER_IP 1234"
$EDEN sdn fwd eth0 {{template "port"}} -- {{template "ssh"}} "echo {{$test_msg}} | nc -N $ESERVER_IP 1234"

Expand Down
16 changes: 8 additions & 8 deletions tests/eclient/testdata/profile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ eden controller edge-node update --device global_profile=profile-1

# We set default_profile to profile-1, so app-profile-2 should be in HALTED state
test eden.app.test -test.v -timewait 15m HALTED app-profile-2
test eden.app.test -test.v -timewait 5m RUNNING app-profile-1 app-profile-1-2 local-manager
test eden.app.test -test.v -timewait 15m RUNNING app-profile-1 app-profile-1-2 local-manager

exec sleep 20

Expand All @@ -49,15 +49,15 @@ eden controller edge-node update --device global_profile=profile-2

# We set default_profile to profile-2, so app-profile-1 should be in HALTED state
test eden.app.test -test.v -timewait 15m HALTED app-profile-1
test eden.app.test -test.v -timewait 5m RUNNING app-profile-2 app-profile-1-2 local-manager
test eden.app.test -test.v -timewait 15m RUNNING app-profile-2 app-profile-1-2 local-manager

# STEP 3: global_profile=profile-3

eden controller edge-node update --device global_profile=profile-3

# We set default_profile to profile-3, so all apps against local-manager should be in HALTED state
test eden.app.test -test.v -timewait 15m HALTED app-profile-1 app-profile-2 app-profile-1-2
test eden.app.test -test.v -timewait 5m RUNNING local-manager
test eden.app.test -test.v -timewait 15m RUNNING local-manager

exec sleep 20

Expand All @@ -66,7 +66,7 @@ eden pod stop local-manager
test eden.app.test -test.v -timewait 15m HALTED local-manager

eden pod start local-manager
test eden.app.test -test.v -timewait 5m RUNNING local-manager
test eden.app.test -test.v -timewait 15m RUNNING local-manager

# Wait for ssh access
exec -t 5m bash wait_ssh.sh 2223
Expand All @@ -85,7 +85,7 @@ exec -t 1m bash local-manager-profile.sh 2223 profile-1

# We set local_manager and use profile-1 in it, so app-profile-2 should be in HALTED state
test eden.app.test -test.v -timewait 15m HALTED app-profile-2
test eden.app.test -test.v -timewait 5m RUNNING app-profile-1 app-profile-1-2 local-manager
test eden.app.test -test.v -timewait 15m RUNNING app-profile-1 app-profile-1-2 local-manager

exec sleep 20

Expand All @@ -96,7 +96,7 @@ exec -t 1m bash local-manager-profile.sh 2223 profile-2

# We set local_manager and use profile-2 in it, so app-profile-1 should be in HALTED state
test eden.app.test -test.v -timewait 15m HALTED app-profile-1
test eden.app.test -test.v -timewait 5m RUNNING app-profile-2 app-profile-1-2 local-manager
test eden.app.test -test.v -timewait 15m RUNNING app-profile-2 app-profile-1-2 local-manager

exec sleep 20

Expand All @@ -107,7 +107,7 @@ exec -t 1m bash local-manager-profile.sh 2223 profile-3

# We set local_manager and use profile-3 in it, so all apps against local-manager should be in HALTED state
test eden.app.test -test.v -timewait 15m HALTED app-profile-1 app-profile-2 app-profile-1-2
test eden.app.test -test.v -timewait 5m RUNNING local-manager
test eden.app.test -test.v -timewait 15m RUNNING local-manager

exec sleep 20

Expand All @@ -118,7 +118,7 @@ eden controller edge-node update --device local_profile_server=""

exec sleep 30
# We have empty local_manager and empty default_profile, so apps should come back to RUNNING state now
test eden.app.test -test.v -timewait 5m RUNNING app-profile-1 app-profile-2 app-profile-1-2 local-manager
test eden.app.test -test.v -timewait 15m RUNNING app-profile-1 app-profile-2 app-profile-1-2 local-manager

exec sleep 20

Expand Down
2 changes: 1 addition & 1 deletion tests/reboot/reboot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func checkReboot(t *testing.T, edgeNode *device.Ctx) projects.ProcInfoFunc {
currentLastRebootTime := im.GetDinfo().LastRebootTime
if !proto.Equal(lastRebootTime, currentLastRebootTime) {
if im.GetDinfo().LastRebootReason == "" &&
lastRebootTime.AsTime().IsZero() {
currentLastRebootTime.AsTime().Unix() == 0 {
// device may not fill the info
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions tests/volume/testdata/volumes_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ eden -t 1m volume create -n v-vhdx file://{{EdenConfig "eden.root"}}/empty.vhdx
stdout 'create volume v-vhdx with file://{{EdenConfig "eden.root"}}/empty.vhdx request sent'

# Wait for ready
test eden.vol.test -test.v -timewait 10m DELIVERED v-qcow2 v-docker v-qcow v-vmdk v-vhdx
test eden.vol.test -test.v -timewait 15m DELIVERED v-qcow2 v-docker v-qcow v-vmdk v-vhdx

# measure reported total space of persist
exec -t 5m bash wait-and-get-half-total.sh
source .env

# allocate volume with size of half total space
eden -t 1m volume create -n blank-vol-1 blank --disk-size=$half_total
test eden.vol.test -test.v -timewait 1m CREATED_VOLUME blank-vol-1
test eden.vol.test -test.v -timewait 3m CREATED_VOLUME blank-vol-1

# allocate background info check for volumeErr contains Remaining word
test eden.lim.test -test.v -timewait 3m -test.run TestInfo -out InfoContent.vinfo 'InfoContent.vinfo.volumeErr:Remaining' 'InfoContent.vinfo.displayName:blank-vol-2' &errorwait&
Expand Down

0 comments on commit f8748ae

Please sign in to comment.