diff --git a/nova/tests/unit/virt/libvirt/test_imagebackend.py b/nova/tests/unit/virt/libvirt/test_imagebackend.py index 124d303512cf..21271922ad8f 100644 --- a/nova/tests/unit/virt/libvirt/test_imagebackend.py +++ b/nova/tests/unit/virt/libvirt/test_imagebackend.py @@ -365,6 +365,7 @@ class FlatTestCase(_ImageTestCase, test.NoDBTestCase): return_value=imageutils.QemuImgInfo()) def test_create_image_extend(self, fake_qemu_img_info): fn = self.prepare_mocks() + fake_qemu_img_info.return_value.virtual_size = 1024 fn(target=self.TEMPLATE_PATH, image_id=None) imagebackend.libvirt_utils.copy_image(self.TEMPLATE_PATH, self.PATH) image = imgmodel.LocalFileImage(self.PATH, imgmodel.FORMAT_RAW) @@ -1487,7 +1488,7 @@ class RbdTestCase(_ImageTestCase, test.NoDBTestCase): self.INSTANCE["uuid"] + "_fake.vm", "FakePool", "FakeUser", - "MTIzNDU2Cg==", + b"MTIzNDU2Cg==", ["server1:1899", "server2:1920"]), model) diff --git a/nova/virt/libvirt/imagebackend.py b/nova/virt/libvirt/imagebackend.py index 144a000d8d25..61ca7629c283 100644 --- a/nova/virt/libvirt/imagebackend.py +++ b/nova/virt/libvirt/imagebackend.py @@ -685,7 +685,7 @@ class Lvm(Image): def create_lvm_image(base, size): base_size = disk.get_disk_size(base) self.verify_base_size(base, size, base_size=base_size) - resize = size > base_size + resize = size > base_size if size else False size = size if resize else base_size lvm.create_volume(self.vg, self.lv, size, sparse=self.sparse) diff --git a/tests-py3.txt b/tests-py3.txt index 252bd5490e1f..ab647bf059a4 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -1,10 +1,6 @@ nova.tests.unit.api.openstack.compute.test_user_data.ServersControllerCreateTest nova.tests.unit.test_wsgi.TestWSGIServerWithSSL nova.tests.unit.virt.libvirt.test_firewall.IptablesFirewallTestCase -nova.tests.unit.virt.libvirt.test_imagebackend.EncryptedLvmTestCase -nova.tests.unit.virt.libvirt.test_imagebackend.LvmTestCase -nova.tests.unit.virt.libvirt.test_imagebackend.FlatTestCase -nova.tests.unit.virt.libvirt.test_imagebackend.RbdTestCase nova.tests.unit.virt.libvirt.test_vif.LibvirtVifTestCase nova.tests.unit.virt.xenapi.test_vm_utils.ResizeFunctionTestCase nova.tests.unit.virt.xenapi.test_vm_utils.ScanSrTestCase