Search in sources :

Example 6 with PhysicalDiskFormat

use of com.cloud.utils.qemu.QemuImg.PhysicalDiskFormat in project cosmic by MissionCriticalCloud.

the class QemuImgFileTest method testFileNameAndSizeAndFormatAtContructor.

@Test
public void testFileNameAndSizeAndFormatAtContructor() {
    final PhysicalDiskFormat format = PhysicalDiskFormat.RAW;
    final long size = 1024;
    final String filename = "/tmp/test-image.qcow2";
    final QemuImgFile file = new QemuImgFile(filename, size, format);
    assertEquals(file.getFileName(), filename);
    assertEquals(file.getSize(), size);
    assertEquals(file.getFormat(), format);
}
Also used : PhysicalDiskFormat(com.cloud.utils.qemu.QemuImg.PhysicalDiskFormat) Test(org.junit.Test)

Aggregations

PhysicalDiskFormat (com.cloud.utils.qemu.QemuImg.PhysicalDiskFormat)6 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)3 Test (org.junit.Test)3 QemuImgException (com.cloud.utils.qemu.QemuImgException)2 IoCTX (com.ceph.rados.IoCTX)1 Rados (com.ceph.rados.Rados)1 RadosException (com.ceph.rados.exceptions.RadosException)1 Rbd (com.ceph.rbd.Rbd)1 RbdException (com.ceph.rbd.RbdException)1 RbdImage (com.ceph.rbd.RbdImage)1 RbdImageInfo (com.ceph.rbd.jna.RbdImageInfo)1 InternalErrorException (com.cloud.exception.InternalErrorException)1 StoragePoolType (com.cloud.storage.Storage.StoragePoolType)1 CreateObjectAnswer (com.cloud.storage.command.CreateObjectAnswer)1 PrimaryDataStoreTO (com.cloud.storage.to.PrimaryDataStoreTO)1 VolumeObjectTO (com.cloud.storage.to.VolumeObjectTO)1 QemuImg (com.cloud.utils.qemu.QemuImg)1 QemuImgFile (com.cloud.utils.qemu.QemuImgFile)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1