use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommandTest method testAllDomainsWithinThreshold.
@Test
public void testAllDomainsWithinThreshold() {
doReturn(Collections.emptyList()).when(cmd).getDisksList();
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)).when(multipleStorageDomainsValidator).allDomainsExistAndActive();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommandTest method testVMIsNotValid.
@Test
public void testVMIsNotValid() {
when(vmValidator.vmNotSavingRestoring()).thenReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING));
doReturn(getEmptyDiskList()).when(cmd).getDisksList();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_VM_IS_SAVING_RESTORING);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommandTest method testSaveMemoryPciPassthroughFailure.
@Test
public void testSaveMemoryPciPassthroughFailure() {
cmd.getParameters().setSaveMemory(true);
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES)).when(vmValidator).vmNotHavingPciPassthroughDevices();
doReturn(getEmptyDiskList()).when(cmd).getDisksList();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class CreateSnapshotForVmCommandTest method testImagesLocked.
@Test
public void testImagesLocked() {
doReturn(getNonEmptyDiskList()).when(cmd).getDisksList();
doReturn(getNonEmptyDiskList()).when(cmd).getDisksListForChecks();
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED)).when(diskImagesValidator).diskImagesNotLocked();
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED);
}
use of org.ovirt.engine.core.bll.ValidationResult in project ovirt-engine by oVirt.
the class RemoveSnapshotCommandTest method testValidateNotEnoughSpace.
@Test
public void testValidateNotEnoughSpace() {
prepareForVmValidatorTests();
spySdValidator();
cmd.getVm().setStatus(VMStatus.Up);
mockDisksList(2);
doReturn(ValidationResult.VALID).when(snapshotValidator).vmSnapshotDisksNotDuringMerge(any(), any());
when(storageDomainsValidator.allDomainsHaveSpaceForMerge(any(), any())).thenReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN));
ValidateTestUtils.runAndAssertValidateFailure(cmd, EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN);
}
Aggregations