Skip to content

Commit

Permalink
tests/conversion: conserve CPU/disk by exporting to stdout (#293)
Browse files Browse the repository at this point in the history
After chatting about #292 with @MusicDin he mentioned that I forgot
about this other case.
  • Loading branch information
simondeziel authored Sep 23, 2024
2 parents cb79b22 + 10a7bc9 commit 7c0881f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/conversion
Original file line number Diff line number Diff line change
Expand Up @@ -391,19 +391,15 @@ if hasNeededAPIExtension instance_import_conversion; then
# when re-imported.
lxc exec v1 -- sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config

# Export instance.
# Export instance and extract raw image.
lxc stop v1
lxc export v1 "${tmpdir}/vm.tar.gz"
lxc export v1 --compression=none --quiet - | tar -xf - -C "${tmpdir}" "backup/virtual-machine.img"

# Ensure instance does not boot without virtio_scsi drivers.
lxc start v1
! waitInstanceReady v1 || { echo "Instance booted without SCSI drivers!"; false; }
lxc delete -f v1

# Extract raw image.
tar -xzf "${tmpdir}/vm.tar.gz" -C "${tmpdir}" "backup/virtual-machine.img"
rm "${tmpdir}/vm.tar.gz"

# Ensure that virtio conversion adds the needed virtio_scsi module back into the initramfs.
conversion_vm centos-missing-driver zfs "${tmpdir}/backup/virtual-machine.img" "no" "virtio"
fi
Expand Down

0 comments on commit 7c0881f

Please sign in to comment.