use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class AbstractSanStorageList method updateSelectedLunWarning.
protected void updateSelectedLunWarning(LunModel lunModel) {
LUNs lun = lunModel.getEntity();
String warning = constants.empty();
// Adding 'GrayedOutReasons'
if (lun.getStorageDomainId() != null) {
warning = messages.lunAlreadyPartOfStorageDomainWarning(lun.getStorageDomainName());
} else if (lun.getDiskId() != null) {
warning = messages.lunUsedByDiskWarning(lun.getDiskAlias());
}
model.setSelectedLunWarning(warning);
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class GetDeviceListQueryTest method internalExecuteQuery.
/**
* Test query execution
*/
private void internalExecuteQuery() {
// Run 'GetDeviceList' command
VDSReturnValue returnValue = new VDSReturnValue();
returnValue.setSucceeded(true);
returnValue.setReturnValue(lunsInput);
when(vdsBrokerFrontendMock.runVdsCommand(eq(VDSCommandType.GetDeviceList), any())).thenReturn(returnValue);
// Return 'lunsFromDb'
when(lunDaoMock.getAll()).thenReturn(lunsFromDb);
// Execute command
getQuery().executeQueryCommand();
// Assert the query's results
List<LUNs> lunsActual = getQuery().getQueryReturnValue().getReturnValue();
assertEquals(lunsExpected, lunsActual);
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class GetDeviceListQueryTest method createInputLUNs.
/**
* Create the input list of LUNs
*/
private void createInputLUNs() {
LUNs lunWithVG = new LUNs();
lunWithVG.setLUNId(Guid.newGuid().toString());
lunWithVG.setVolumeGroupId(Guid.newGuid().toString());
LUNs lunExistsInDB = new LUNs();
lunExistsInDB.setLUNId(Guid.newGuid().toString());
lunsInput = new ArrayList<>();
lunsInput.add(lunWithVG);
lunsInput.add(lunExistsInDB);
lunsFromDb = new ArrayList<>();
lunsFromDb.add(lunExistsInDB);
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class GetLunsByVgIdQueryTest method checkReturnValue.
@SuppressWarnings("unchecked")
private void checkReturnValue() {
assertNotNull(getQuery().getQueryReturnValue().getReturnValue());
List<LUNs> luns = getQuery().getQueryReturnValue().getReturnValue();
assertEquals(GUIDS.length, luns.size());
for (int i = 0; i < GUIDS.length; i++) {
LUNs lun = luns.get(i);
assertNotNull(lun);
assertEquals(GUIDS[i], lun.getLUNId());
assertNotNull(lun.getLunConnections());
assertEquals(1, lun.getLunConnections().size());
StorageServerConnections cnx = lun.getLunConnections().get(0);
assertEquals(ADDRESS, cnx.getConnection());
assertEquals(PORT, cnx.getPort());
assertEquals(GUIDS[i], cnx.getId());
assertEquals(IQNS[i], cnx.getIqn());
assertEquals(StorageType.ISCSI, cnx.getStorageType());
assertNotNull(lun.getPathsDictionary());
assertEquals(1, lun.getPathsDictionary().size());
}
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class AddDiskCommandTest method createISCSILunDisk.
private static LunDisk createISCSILunDisk() {
LunDisk disk = new LunDisk();
LUNs lun = new LUNs();
lun.setLUNId("lunid");
lun.setLunType(StorageType.ISCSI);
StorageServerConnections connection = new StorageServerConnections();
connection.setIqn("a");
connection.setConnection("0.0.0.0");
connection.setPort("1234");
ArrayList<StorageServerConnections> connections = new ArrayList<>();
connections.add(connection);
lun.setLunConnections(connections);
disk.setLun(lun);
disk.setId(Guid.newGuid());
return disk;
}
Aggregations