Search in sources :

Example 31 with StoragePool

use of org.libvirt.StoragePool in project cloudstack by apache.

the class LibvirtStoragePoolTest method testExternalSnapshot.

public void testExternalSnapshot() {
    String uuid = "60b46738-c5d0-40a9-a79e-9a4fe6295db7";
    String name = "myfirstpool";
    StorageAdaptor adapter = Mockito.mock(LibvirtStorageAdaptor.class);
    StoragePool storage = Mockito.mock(StoragePool.class);
    LibvirtStoragePool nfsPool = new LibvirtStoragePool(uuid, name, StoragePoolType.NetworkFilesystem, adapter, storage);
    assertFalse(nfsPool.isExternalSnapshot());
    LibvirtStoragePool rbdPool = new LibvirtStoragePool(uuid, name, StoragePoolType.RBD, adapter, storage);
    assertTrue(rbdPool.isExternalSnapshot());
    LibvirtStoragePool clvmPool = new LibvirtStoragePool(uuid, name, StoragePoolType.CLVM, adapter, storage);
    assertTrue(clvmPool.isExternalSnapshot());
}
Also used : StoragePool(org.libvirt.StoragePool)

Aggregations

StoragePool (org.libvirt.StoragePool)31 LibvirtException (org.libvirt.LibvirtException)27 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)13 Connect (org.libvirt.Connect)8 LibvirtStoragePoolDef (com.cloud.agent.resource.computing.LibvirtStoragePoolDef)7 LibvirtStoragePoolDef (com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef)7 StoragePoolInfo (org.libvirt.StoragePoolInfo)6 StorageVol (org.libvirt.StorageVol)4 StoragePoolType (com.cloud.storage.Storage.StoragePoolType)3 Secret (org.libvirt.Secret)3 LibvirtStorageVolumeDef (com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeDef)2 ArrayList (java.util.ArrayList)2 LibvirtStorageVolumeDef (com.cloud.agent.resource.computing.LibvirtStorageVolumeDef)1 LibvirtStorageVolumeDef.volFormat (com.cloud.agent.resource.computing.LibvirtStorageVolumeDef.volFormat)1 LibvirtSecretDef (com.cloud.hypervisor.kvm.resource.LibvirtSecretDef)1 VolumeFormat (com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeDef.VolumeFormat)1 File (java.io.File)1 URI (java.net.URI)1