use of org.ovirt.engine.core.common.businessentities.storage.DiskImage in project ovirt-engine by oVirt.
the class RunVmCommandTest method testFlowOnStatelessWithDisks.
@Test
public void testFlowOnStatelessWithDisks() {
final VM vm = new VM();
vm.setStatus(VMStatus.Down);
vm.getDiskList().add(new DiskImage());
command.setVm(vm);
command.getParameters().setRunAsStateless(true);
doReturn(false).when(command).isStatelessSnapshotExistsForVm();
doNothing().when(command).fetchVmDisksFromDb();
assertEquals(RunVmFlow.CREATE_STATELESS_IMAGES, command.getFlow());
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskImage in project ovirt-engine by oVirt.
the class AddVmTemplateCommandTest method testOneEmptyDiskAlias.
@Test
public void testOneEmptyDiskAlias() {
Map<Guid, DiskImage> diskInfoDestinationMap = new HashMap<>();
DiskImage disk1 = new DiskImage();
disk1.setDiskAlias("");
diskInfoDestinationMap.put(Guid.newGuid(), disk1);
cmd.diskInfoDestinationMap = diskInfoDestinationMap;
assertFalse(cmd.isDisksAliasNotEmpty());
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskImage in project ovirt-engine by oVirt.
the class AddVmTemplateCommandTest method getDisksList.
private List<DiskImage> getDisksList(Guid spId) {
DiskImage disk = new DiskImage();
disk.setStorageIds(new ArrayList<>(Collections.singletonList(spId)));
return Collections.singletonList(disk);
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskImage in project ovirt-engine by oVirt.
the class AddVmTemplateCommandTest method testOneOfManyEmptyDiskAlias.
@Test
public void testOneOfManyEmptyDiskAlias() {
Map<Guid, DiskImage> diskInfoDestinationMap = new HashMap<>();
DiskImage disk1 = new DiskImage();
DiskImage disk2 = new DiskImage();
disk1.setDiskAlias("");
disk2.setDiskAlias("disk");
diskInfoDestinationMap.put(Guid.newGuid(), disk1);
diskInfoDestinationMap.put(Guid.newGuid(), disk2);
cmd.diskInfoDestinationMap = diskInfoDestinationMap;
assertFalse(cmd.isDisksAliasNotEmpty());
}
use of org.ovirt.engine.core.common.businessentities.storage.DiskImage in project ovirt-engine by oVirt.
the class CommonVmPoolCommandTestAbstract method getDiskImageTempalteList.
private static Map<Guid, DiskImage> getDiskImageTempalteList() {
Map<Guid, DiskImage> diskTemplateList = new HashMap<>();
DiskImage diskImageTemplate = new DiskImage();
diskImageTemplate.setId(Guid.newGuid());
diskImageTemplate.setImageId(Guid.newGuid());
diskImageTemplate.setStorageIds(new ArrayList<>());
diskTemplateList.put(diskImageTemplate.getId(), diskImageTemplate);
diskImageTemplate = new DiskImage();
diskImageTemplate.setId(Guid.newGuid());
diskImageTemplate.setImageId(Guid.newGuid());
diskImageTemplate.setStorageIds(new ArrayList<>());
diskTemplateList.put(diskImageTemplate.getId(), diskImageTemplate);
return diskTemplateList;
}
Aggregations