use of org.ovirt.engine.core.common.action.ImportVmParameters in project ovirt-engine by oVirt.
the class ImportValidatorTest method insufficientDiskSpaceWithSnapshots.
@Test
public void insufficientDiskSpaceWithSnapshots() {
ImportVmParameters parameters = createParameters();
ImportValidator validator = setupDiskSpaceTest(parameters);
parameters.setCopyCollapse(false);
doReturn(new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)).when(multipleSdValidator).allDomainsHaveSpaceForDisksWithSnapshots(any());
assertThat(validator.validateSpaceRequirements(Collections.emptyList()), failsWith(EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN));
verify(multipleSdValidator, never()).allDomainsHaveSpaceForClonedDisks(any());
verify(multipleSdValidator).allDomainsHaveSpaceForDisksWithSnapshots(any());
verify(multipleSdValidator, never()).allDomainsHaveSpaceForNewDisks(any());
}
use of org.ovirt.engine.core.common.action.ImportVmParameters in project ovirt-engine by oVirt.
the class ImportVmCommandTest method createParameters.
protected ImportVmParameters createParameters() {
final VM vm = createVmWithSnapshots();
vm.setName("testVm");
Guid clusterId = Guid.newGuid();
vm.setClusterId(clusterId);
Guid spId = Guid.newGuid();
return new ImportVmParameters(vm, Guid.newGuid(), Guid.newGuid(), spId, clusterId);
}
Aggregations