use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class DiskValidatorTest method testDiskAttachedToVMValid.
@Test
public void testDiskAttachedToVMValid() {
VM vm = createVM();
when(vmDao.getVmsListForDisk(any(), anyBoolean())).thenReturn(Collections.singletonList(vm));
assertThat(validator.isDiskAttachedToVm(vm), isValid());
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class DiskValidatorTest method testDiskAttachedToVMFail.
@Test
public void testDiskAttachedToVMFail() {
VM vm = createVM();
assertThat(validator.isDiskAttachedToVm(vm), failsWith(EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_ATTACHED_TO_VM));
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class DiskValidatorTest method prepareForCheckingIfDiskPluggedToVmsThatAreNotDown.
public List<Pair<VM, VmDevice>> prepareForCheckingIfDiskPluggedToVmsThatAreNotDown() {
VM vm1 = createVM();
VM vm2 = createVM();
VmDevice device1 = createVmDeviceForDisk(vm1, disk);
VmDevice device2 = createVmDeviceForDisk(vm1, disk);
List<Pair<VM, VmDevice>> vmsInfo = new LinkedList<>();
vmsInfo.add(new Pair<>(vm1, device1));
vmsInfo.add(new Pair<>(vm2, device2));
return vmsInfo;
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class DiskVmElementValidatorTest method diskInterfaceSupportedByOs.
@Test
public void diskInterfaceSupportedByOs() {
VM vm = createVM(OS_WITH_SUPPORTED_INTERFACES);
initializeInterfaceValidation(DiskInterface.VirtIO);
dve.setDiskInterface(DiskInterface.VirtIO);
assertThat(validator.isDiskInterfaceSupported(vm), isValid());
}
use of org.ovirt.engine.core.common.businessentities.VM in project ovirt-engine by oVirt.
the class DiskVmElementValidatorTest method diskInterfaceNotSupportedByOs.
@Test
public void diskInterfaceNotSupportedByOs() {
VM vm = createVM(OS_WITH_NO_SUPPORTED_INTERFACES);
initializeInterfaceValidation(DiskInterface.VirtIO);
dve.setDiskInterface(DiskInterface.VirtIO);
assertThat(validator.isDiskInterfaceSupported(vm), failsWith(EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED));
}
Aggregations