use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class GetUnregisteredBlockStorageDomainsQueryTest method createGetStorageDomainInfoReturnValue.
private VDSReturnValue createGetStorageDomainInfoReturnValue() {
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(storageDomainId);
Pair<StorageDomainStatic, Object> pair = new Pair<>(storageDomain.getStorageStaticData(), null);
returnValue.setReturnValue(pair);
return returnValue;
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class GetUnregisteredBlockStorageDomainsQueryTest method createGetVGInfoReturnValue.
private static VDSReturnValue createGetVGInfoReturnValue(List<LUNs> luns) {
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
returnValue.setReturnValue(luns);
return returnValue;
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class ImportHostedEngineStorageDomainCommandTest method createVdsReturnValue.
private VDSReturnValue createVdsReturnValue(List<LUNs> luns) {
VDSReturnValue vdsReturnValue = new VDSReturnValue();
vdsReturnValue.setSucceeded(true);
vdsReturnValue.setReturnValue(luns);
return vdsReturnValue;
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class UpdateStorageServerConnectionCommandTest method succeedUpdateNFSCommandWithDomain.
@Test
public void succeedUpdateNFSCommandWithDomain() {
StorageServerConnections newNFSConnection = createNFSConnection("multipass.my.domain.tlv.company.com:/export/allstorage/data2", StorageType.NFS, NfsVersion.V4, 300, 0);
parameters.setStorageServerConnection(newNFSConnection);
VDSReturnValue returnValueConnectSuccess = new VDSReturnValue();
StoragePoolIsoMap map = new StoragePoolIsoMap();
returnValueConnectSuccess.setSucceeded(true);
StorageDomain domain = createDomain();
doReturn(Collections.singletonList(map)).when(command).getStoragePoolIsoMap(domain);
returnValueConnectSuccess.setReturnValue(domain);
doReturn(returnValueConnectSuccess).when(command).getStatsForDomain(domain);
doReturn(true).when(command).connectToStorage();
List<StorageDomain> domains = Collections.singletonList(domain);
doReturn(domains).when(command).getStorageDomainsByConnId(newNFSConnection.getId());
doNothing().when(command).changeStorageDomainStatusInTransaction(StorageDomainStatus.Locked);
doNothing().when(command).disconnectFromStorage();
doNothing().when(command).updateStorageDomain(domains);
command.executeCommand();
CommandAssertUtils.checkSucceeded(command, true);
}
use of org.ovirt.engine.core.common.vdscommands.VDSReturnValue in project ovirt-engine by oVirt.
the class DeactivateStorageDomainCommandTest method statusSetInMap.
@Test
public void statusSetInMap() {
doReturn(mock(IStorageHelper.class)).when(cmd).getStorageHelper(any());
when(storagePoolDao.get(any())).thenReturn(new StoragePool());
when(isoMapDao.get(any())).thenReturn(map);
when(storageDomainDao.getForStoragePool(any(), any())).thenReturn(new StorageDomain());
doReturn(Collections.emptyList()).when(cmd).getAllRunningVdssInPool();
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
when(vdsBrokerFrontend.runVdsCommand(any(), any())).thenReturn(returnValue);
when(vdsDao.get(any())).thenReturn(vds);
map.setStatus(StorageDomainStatus.Active);
cmd.setCompensationContext(mock(CompensationContext.class));
cmd.executeCommand();
assertEquals(StorageDomainStatus.Maintenance, map.getStatus());
}
Aggregations