Search in sources :

Example 36 with StorageServerConnections

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;
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ArrayList(java.util.ArrayList) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Example 37 with StorageServerConnections

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));
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ArrayList(java.util.ArrayList)

Example 38 with StorageServerConnections

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;
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ArrayList(java.util.ArrayList) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs)

Example 39 with StorageServerConnections

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;
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections)

Example 40 with StorageServerConnections

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);
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) Guid(org.ovirt.engine.core.compat.Guid) Test(org.junit.Test)

Aggregations

StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)181 Test (org.junit.Test)83 ArrayList (java.util.ArrayList)43 Guid (org.ovirt.engine.core.compat.Guid)39 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)33 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)32 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)19 List (java.util.List)18 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)17 VDS (org.ovirt.engine.core.common.businessentities.VDS)16 StorageServerConnectionParametersBase (org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)15 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)15 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)14 HashSet (java.util.HashSet)13 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)11 ActionType (org.ovirt.engine.core.common.action.ActionType)11 Set (java.util.Set)10 StorageConnection (org.ovirt.engine.api.model.StorageConnection)10 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)10 QueryType (org.ovirt.engine.core.common.queries.QueryType)10