Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend volumes test with purging and EVE-OS update #797

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const (
DefaultRegistryPort = 5050

//tags, versions, repos
DefaultEVETag = "8.6.0" // DefaultEVETag tag for EVE image
DefaultEVETag = "8.7.0" // DefaultEVETag tag for EVE image
DefaultAdamTag = "0.0.39"
DefaultRedisTag = "7"
DefaultRegistryTag = "2.7"
Expand Down
51 changes: 40 additions & 11 deletions tests/volume/testdata/volumes_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stdout 'create volume v-vhdx with file://{{EdenConfig "eden.root"}}/empty.vhdx r
test eden.vol.test -test.v -timewait 10m DELIVERED v-qcow2 v-docker v-qcow v-vmdk v-vhdx

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

# allocate volume with size of half total space
Expand All @@ -31,7 +31,7 @@ test eden.vol.test -test.v -timewait 1m 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&

exec sleep 30
exec sleep 10

# this volume expected to fail because we cannot create two volumes with half of total persist space
eden -t 1m volume create -n blank-vol-2 blank --disk-size=$half_total
Expand All @@ -44,6 +44,33 @@ eden -t 1m volume delete blank-vol-1
test eden.vol.test -test.v -timewait 5m - blank-vol-1
test eden.vol.test -test.v -timewait 5m CREATED_VOLUME blank-vol-2

exec sleep 10

# wait for error from app with large volume
test eden.lim.test -test.v -timewait 5m -test.run TestInfo -out InfoContent.ainfo 'InfoContent.ainfo.appErr:Remaining' 'InfoContent.ainfo.appName:eclient-mount' &errorwait&

eden pod deploy -n eclient-mount --memory=512MB {{template "eclient_image"}} --mount=src={{EdenConfig "eden.tests"}}/eclient/testdata,dst=/dir --volume-size=$half_total

# wait for error from the app creation process
wait errorwait

# delete old volume and check if app goes into running state
eden -t 1m volume delete blank-vol-2
test eden.vol.test -test.v -timewait 5m - blank-vol-2
test eden.app.test -test.v -timewait 5m RUNNING eclient-mount

exec sleep 10

# check purging of app with large volume
eden pod purge eclient-mount
test eden.app.test -test.v -timewait 5m PURGING eclient-mount
test eden.app.test -test.v -timewait 5m RUNNING eclient-mount

exec sleep 10

eden pod delete eclient-mount
test eden.app.test -test.v -timewait 5m - eclient-mount

# Volume detecting
eden -t 1m volume ls
cp stdout vol_ls
Expand All @@ -52,7 +79,6 @@ grep '^v-qcow2\s*' vol_ls
grep '^v-qcow\s*' vol_ls
grep '^v-vmdk\s*' vol_ls
grep '^v-vhdx\s*' vol_ls
grep '^blank-vol-2\s*' vol_ls

# Delete by volume's actor
eden -t 1m volume delete v-docker
Expand All @@ -65,18 +91,15 @@ eden -t 1m volume delete v-vmdk
stdout 'volume v-vmdk delete done'
eden -t 1m volume delete v-vhdx
stdout 'volume v-vhdx delete done'
eden -t 1m volume delete blank-vol-2
stdout 'volume blank-vol-2 delete done'

# Wait for delete
test eden.vol.test -test.v -timewait 5m - v-qcow2 v-docker v-qcow v-vmdk v-vhdx blank-vol-2
test eden.vol.test -test.v -timewait 5m - v-qcow2 v-docker v-qcow v-vmdk v-vhdx
cp stdout vol_ls
grep 'o volume with v-docker found' vol_ls
grep 'o volume with v-qcow2 found' vol_ls
grep 'o volume with v-qcow found' vol_ls
grep 'o volume with v-vmdk found' vol_ls
grep 'o volume with v-vhdx found' vol_ls
grep 'o volume with blank-vol-2 found' vol_ls

# Volumes detecting
eden -t 1m volume ls
Expand All @@ -88,12 +111,18 @@ cp stdout vol_ls
! grep '^v-vhdx\s*' vol_ls
! grep '^blank-vol-1\s*' vol_ls
! grep '^blank-vol-2\s*' vol_ls
! grep '^eclient-mount\s*' vol_ls

-- get-half-total.sh --
-- wait-and-get-half-total.sh --
EDEN={{EdenConfig "eden.root"}}/{{EdenConfig "eden.bin-dist"}}/{{EdenConfig "eden.eden-bin"}}
TOTAL=$($EDEN metric --tail=1 --format=json|jq -r '.dm.disk[] | select(.mountPath=="/persist") | .total')

echo half_total="$(( TOTAL*1024*1024/2 ))">>.env
while true; do
TOTAL=$($EDEN metric --tail=1 --format=json|jq -r '.dm.disk[] | select(.mountPath=="/persist") | .total')
if [ "$TOTAL" -gt 0 ]; then
echo half_total="$(( TOTAL*1024*1024/2 ))">>.env
exit 0
fi
sleep 10
done

# Test's config. file
-- eden-config.yml --
Expand Down