use of org.ovirt.engine.core.common.businessentities.storage.CinderDisk in project ovirt-engine by oVirt.
the class CinderDisksValidator method initializeVolumeProviderProxyMap.
private Map<Guid, OpenStackVolumeProviderProxy> initializeVolumeProviderProxyMap() {
if (diskProxyMap == null) {
diskProxyMap = new HashMap<>();
for (CinderDisk cinderDisk : cinderDisks) {
OpenStackVolumeProviderProxy volumeProviderProxy = getVolumeProviderProxy(cinderDisk);
diskProxyMap.put(cinderDisk.getId(), volumeProviderProxy);
}
}
return diskProxyMap;
}
use of org.ovirt.engine.core.common.businessentities.storage.CinderDisk in project ovirt-engine by oVirt.
the class DisksFilterTest method testFilterNonImageDisks.
@Test
public void testFilterNonImageDisks() {
Disk lunDisk = createDisk(DiskStorageType.LUN, false, false, false, false);
Disk imageDisk = createDisk(DiskStorageType.IMAGE, false, false, true, false);
Disk cinderDisk = createDisk(DiskStorageType.CINDER, false, false, true, false);
List<Disk> disksList = Arrays.asList(lunDisk, imageDisk, cinderDisk);
List<DiskImage> filteredList = DisksFilter.filterImageDisks(disksList);
assertEquals(1, filteredList.size());
assertThat(filteredList, containsInAnyOrder(imageDisk));
}
use of org.ovirt.engine.core.common.businessentities.storage.CinderDisk in project ovirt-engine by oVirt.
the class DisksFilterTest method createDisk.
private Disk createDisk(DiskStorageType type, boolean isActive, boolean isShareable, boolean isSnapable, boolean isPlugged) {
Disk disk = null;
switch(type) {
case IMAGE:
disk = new DiskImage();
setDiskImageProperties((DiskImage) disk, isActive, isShareable, isSnapable);
break;
case LUN:
if (isSnapable) {
throw new IllegalArgumentException("A LUN disk cannot be snapable");
}
disk = new LunDisk();
break;
case CINDER:
disk = new CinderDisk();
setDiskImageProperties((DiskImage) disk, isActive, isShareable, isSnapable);
break;
}
disk.setPlugged(isPlugged);
return disk;
}
use of org.ovirt.engine.core.common.businessentities.storage.CinderDisk in project ovirt-engine by oVirt.
the class DisksFilterTest method testFilterNonCinderDisks.
@Test
public void testFilterNonCinderDisks() {
Disk lunDisk = createDisk(DiskStorageType.LUN, false, false, false, false);
Disk imageDisk = createDisk(DiskStorageType.IMAGE, false, false, true, false);
Disk cinderDisk = createDisk(DiskStorageType.CINDER, false, false, true, false);
List<Disk> disksList = Arrays.asList(lunDisk, imageDisk, cinderDisk);
List<CinderDisk> filteredList = DisksFilter.filterCinderDisks(disksList);
assertEquals(1, filteredList.size());
assertThat(filteredList, containsInAnyOrder(cinderDisk));
}
use of org.ovirt.engine.core.common.businessentities.storage.CinderDisk in project ovirt-engine by oVirt.
the class AbstractGetDisksAndSnapshotsQueryTest method createCinderDisk.
private CinderDisk createCinderDisk() {
CinderDisk cd = new CinderDisk();
cd.setId(Guid.newGuid());
cd.setActive(true);
return cd;
}
Aggregations