use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class RunVmValidatorTest method testVmWithDisks.
@Test
public void testVmWithDisks() {
List<Disk> disks = new ArrayList<>();
disks.add(new DiskImage());
validateResult(runVmValidator.validateBootSequence(new VM(), disks), true, null);
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class RunVmValidatorTest method testNoIsoDomainIsoOnIsoDomain.
@Test
public void testNoIsoDomainIsoOnIsoDomain() {
VM vm = new VM();
vm.setBootSequence(BootSequence.CD);
validateResult(runVmValidator.validateIsoPath(vm, "Iso_name.iso", null, null), false, EngineMessage.VM_CANNOT_RUN_FROM_CD_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO);
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class RunVmValidatorTest method validateDisksPassDiscardFails.
@Test
public void validateDisksPassDiscardFails() {
EngineMessage failureEngineMessage = EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE;
mockPassDiscardSupport(new ValidationResult(failureEngineMessage));
VM vm = new VM();
vm.setId(Guid.newGuid());
assertThat(runVmValidator.validateDisksPassDiscard(vm), failsWith(failureEngineMessage));
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class RunVmValidatorTest method canRunVmAsStateless.
private void canRunVmAsStateless(boolean autoStartUp, final boolean vmInPreview, boolean isVmStateless, Boolean isStatelessParam, boolean shouldPass, EngineMessage message) {
Guid vmId = Guid.newGuid();
when(snapshotValidator.vmNotInPreview(vmId)).thenReturn(vmInPreview ? new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW) : ValidationResult.VALID);
VM vm = new VM();
vm.setId(vmId);
vm.setAutoStartup(autoStartUp);
vm.setStateless(isVmStateless);
validateResult(runVmValidator.validateStatelessVm(vm, isStatelessParam), shouldPass, message);
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class RunVmValidatorTest method testIsoOnDataDomainNotExists.
@Test
public void testIsoOnDataDomainNotExists() {
VM vm = new VM();
vm.setBootSequence(BootSequence.CD);
when(diskDao.get(any(Guid.class))).thenReturn(null);
validateResult(runVmValidator.validateIsoPath(vm, Guid.newGuid().toString(), null, null), false, EngineMessage.ERROR_CANNOT_FIND_ISO_IMAGE_PATH);
}
Aggregations