If the qemu-img command fails when attempting to use the QCOW (v1) format,
assume that the distro does not have support for the format enabled.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
}
test_import_qcow_format() {
- case "$(lsb_release --id --short)" in
- RedHatEnterpriseWorkstation|RedHatEnterpriseServer|RedHatEnterprise|CentOS)
- # QCOW format not included in EL variants
- return
- ;;
- *)
- ;;
- esac
-
local base_image=$1
local dest_image=$2
- qemu-img convert -f raw -O qcow rbd:rbd/${base_image} ${TEMPDIR}/${base_image}.qcow
+ if ! qemu-img convert -f raw -O qcow rbd:rbd/${base_image} ${TEMPDIR}/${base_image}.qcow; then
+ echo "skipping QCOW test"
+ return 0
+ fi
qemu-img info -f qcow ${TEMPDIR}/${base_image}.qcow
cat > ${TEMPDIR}/spec.json <<EOF