use of org.ovirt.engine.core.common.businessentities.StorageServerConnections 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;
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class GetUnregisteredBlockStorageDomainsQueryTest method getConnections.
private List<StorageServerConnections> getConnections() {
StorageServerConnections connection1 = new StorageServerConnections();
connection1.setIqn(connectionIqn1);
StorageServerConnections connection2 = new StorageServerConnections();
connection2.setIqn(connectionIqn2);
return new ArrayList<>(Arrays.asList(connection1, connection2));
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class ImportHostedEngineStorageDomainCommandTest method createSdLuns.
protected ArrayList<LUNs> createSdLuns() {
LUNs lun = new LUNs();
lun.setVolumeGroupId(VG_ID.toString());
lun.setStorageDomainId(HE_SD_ID);
ArrayList<StorageServerConnections> connections = new ArrayList<>();
StorageServerConnections connection = new StorageServerConnections();
connection.setUserName(ISCSIUSER);
connection.setPassword(ISCSIPASS);
connections.add(connection);
lun.setLunConnections(connections);
ArrayList<LUNs> luns = new ArrayList<>();
luns.add(lun);
return luns;
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class ImportHostedEngineStorageDomainCommandTest method mockGetExistingDomain.
protected StorageDomain mockGetExistingDomain(boolean answerWithDomain) {
StorageDomain sd = null;
List<StorageDomain> domains = Collections.emptyList();
if (answerWithDomain) {
sd = new StorageDomain();
sd.getStorageStaticData().setConnection(new StorageServerConnections());
domains = Collections.singletonList(sd);
}
doReturn(createQueryReturnValueWith(domains)).when(backend).runInternalQuery(eq(QueryType.GetExistingStorageDomainList), any());
return sd;
}
use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.
the class AddStorageServerConnectionCommandTest method isLocalDomainConnWithSamePathAndPoolNotExist.
@Test
public void isLocalDomainConnWithSamePathAndPoolNotExist() {
StorageServerConnections newLocalConnection = populateBasicConnectionDetails(null, "/localSD", StorageType.LOCALFS);
StorageServerConnections existingConn = populateBasicConnectionDetails(null, "/localSD", StorageType.LOCALFS);
Guid newLocalConnectionStoragePoolId = Guid.newGuid();
Guid existingLocalConnectionStoragePoolId = Guid.newGuid();
List<StorageServerConnections> connections = Collections.singletonList(existingConn);
when(storageConnDao.getAllConnectableStorageSeverConnection(existingLocalConnectionStoragePoolId)).thenReturn(connections);
when(storageConnDao.getAllForStorage(newLocalConnection.getConnection())).thenReturn(connections);
boolean isExists = command.isConnWithSameDetailsExists(newLocalConnection, newLocalConnectionStoragePoolId);
assertFalse(isExists);
}
Aggregations