From 768bc9963192406ccdb312da78f04d2f41e03c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Thu, 11 Apr 2024 15:51:44 +0200 Subject: [PATCH 1/2] tests/storage-vm: Cleanup trust after removing remote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- tests/storage-vm | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/storage-vm b/tests/storage-vm index 64800a8d0..754112b57 100755 --- a/tests/storage-vm +++ b/tests/storage-vm @@ -188,6 +188,7 @@ for poolDriver in $poolDriverList; do lxc delete -f v2 lxc delete v1/snap0 lxc remote rm localhost + lxc config trust rm "$(lxc query /1.0/certificates?recursion=1 | jq -r '.[].fingerprint')" lxc storage rm "${poolName}2" echo "==> Check QEMU crash behavior and recovery" From d4ca244597702c30538b105f98d72b757ea55c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Peliz=C3=A4us?= Date: Fri, 12 Apr 2024 10:38:20 +0200 Subject: [PATCH 2/2] tests/storage: Move VM to image publishing test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julian Pelizäus --- tests/storage-vm | 13 ++++++++++++- tests/storage-volumes-vm | 11 ----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/storage-vm b/tests/storage-vm index 754112b57..95d53b5d9 100755 --- a/tests/storage-vm +++ b/tests/storage-vm @@ -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` diff --git a/tests/storage-volumes-vm b/tests/storage-volumes-vm index 7153d0a45..9efe72b9c 100755 --- a/tests/storage-volumes-vm +++ b/tests/storage-volumes-vm @@ -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