Skip to content

Commit

Permalink
tests/storage: Move VM to image publishing test
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Pelizäus <[email protected]>
  • Loading branch information
roosterfish committed Apr 12, 2024
1 parent fcc9525 commit da9aaed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 12 additions & 1 deletion tests/storage-vm
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,20 @@ for poolDriver in $poolDriverList; do
echo "==> VM Generation ID in LXD config does not match VM Generation ID in QEMU process"
false
fi

lxc delete -f v1

echo "==> Publishing VM to image"
lxc init "${TEST_IMG:-ubuntu-minimal-daily:22.04}" v1 --vm -s "${poolName}"
lxc storage volume create "${poolName}" images
lxc config set storage.images_volume "${poolName}"/images
lxc publish v1 --alias v1image
lxc launch v1image v2 -s "${poolName}"
waitInstanceReady v2
lxc delete v1 v2 -f
lxc image delete v1image
lxc config unset storage.images_volume
lxc storage volume delete "${poolName}" images

if hasNeededAPIExtension instances_migration_stateful; then
echo "==> Checking setting instances.migration.stateful for VMs"
# Check that migration.stateful is set in the instance's expanded config to the value of `instances.migration.stateful`
Expand Down
11 changes: 0 additions & 11 deletions tests/storage-volumes-vm
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,6 @@ do
lxc storage volume detach "${poolName}" vol3 v1
lxc storage volume detach "${poolName}" vol6 v1 || true # optional ISO

echo "==> Publishing VM to image"
lxc storage volume create "${poolName}" images --project=default
lxc config set storage.images_volume "${poolName}"/images
lxc publish v1 --alias v1image
lxc launch v1image v2 -s "${poolName}"
waitInstanceReady v2
lxc delete v2 -f
lxc image delete v1image
lxc config unset storage.images_volume
lxc storage volume delete "${poolName}" images --project=default

echo "==> Deleting VM"
lxc delete v1

Expand Down

0 comments on commit da9aaed

Please sign in to comment.