From 21f62fccc7e5447fc91acaa6b4cb927c08c01d3a Mon Sep 17 00:00:00 2001 From: Din Music Date: Thu, 1 Aug 2024 08:33:51 +0000 Subject: [PATCH 1/2] tests/conversion: Test raw image import and conversion on all storage drivers Signed-off-by: Din Music --- tests/conversion | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/conversion b/tests/conversion index 7ee8c8c38..fb2be443f 100755 --- a/tests/conversion +++ b/tests/conversion @@ -117,7 +117,11 @@ conversion() { lxdMigrateCmd="lxd-migrate --conversion format" # Create storage pool. - lxc storage create "${poolName}" "${poolType}" + if [ "$poolType" = "dir" ]; then + lxc storage create "${poolName}" "${poolType}" + else + lxc storage create "${poolName}" "${poolType}" size=11GiB + fi elif [ "${instType}" = "container" ]; then echo "==> TEST: Conversion: Import container '${instName}'" @@ -234,7 +238,10 @@ rm "${tmpdir}/vm-tmp.tar.gz" # Test VM migration using conversion mode. If server does not support # conversion API extension, lxd-migrate must fallback to migration # mode and successfully transfer the VM disk. +conversion_vm vm-alpine-raw-btrfs btrfs "${tmpdir}/backup/virtual-machine.img" "no" +conversion_vm vm-alpine-raw-lvm lvm "${tmpdir}/backup/virtual-machine.img" "no" conversion_vm vm-alpine-raw-zfs zfs "${tmpdir}/backup/virtual-machine.img" "no" +conversion_vm vm-alpine-raw-dir dir "${tmpdir}/backup/virtual-machine.img" "no" rm -rf "${tmpdir}/backup" # Test VM conversion using non-raw disk formats only if server supports @@ -255,7 +262,7 @@ if hasNeededAPIExtension instance_import_conversion; then wget -q -O "${IMAGE_PATH}" https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.vmdk conversion_vm vm-u24-vmdk-dir dir "${IMAGE_PATH}" "yes" - conversion_vm vm-u24-vmdk-zfs zfs "${IMAGE_PATH}" "yes" + conversion_vm vm-u24-vmdk-lvm lvm "${IMAGE_PATH}" "yes" # Use custom volume for backups. Images for conversion will be uploaded here. lxc storage create backups-pool zfs From cd24284c82b5a285d80edca91d34854abc10a563 Mon Sep 17 00:00:00 2001 From: Din Music Date: Fri, 2 Aug 2024 10:13:57 +0000 Subject: [PATCH 2/2] github/workflows/tests: Free up the runner space before conversion test The conversion tests are failing on 22.04 because the runner runs out of space. Try freeing some space up, as we are short only for around 1GiB. Signed-off-by: Din Music --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5581679ec..862f3bd7e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -195,7 +195,7 @@ jobs: echo "force-unsafe-io" | sudo tee /etc/dpkg/dpkg.cfg.d/force-unsafe-io - name: Reclaim some space (storage tests only) - if: ${{ startsWith(matrix.test, 'storage') || matrix.test == 'vm-nesting' }} + if: ${{ startsWith(matrix.test, 'storage') || matrix.test == 'vm-nesting' || matrix.test == 'conversion' }} run: | set -eux df -h