Search in sources :

Example 31 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class UpdateStoragePoolCommandTest method addNetworksToPool.

private void addNetworksToPool(int numberOfNetworks, boolean isManagement) {
    List<Network> allDcNetworks = new ArrayList<>();
    for (int i = 0; i < numberOfNetworks; i++) {
        final Guid networkId = Guid.newGuid();
        Network network = createNetwork(networkId);
        network.setId(networkId);
        allDcNetworks.add(network);
        when(managementNetworkUtil.isManagementNetwork(networkId)).thenReturn(isManagement);
    }
    when(networkDao.getAllForDataCenter(any())).thenReturn(allDcNetworks);
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) Guid(org.ovirt.engine.core.compat.Guid)

Example 32 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class BackendOpenStackNetworksResource method mapCollection.

private OpenStackNetworks mapCollection(Map<Network, Set<Guid>> entities) {
    OpenStackNetworks collection = new OpenStackNetworks();
    if (entities != null) {
        for (Map.Entry<Network, Set<Guid>> entry : entities.entrySet()) {
            Network network = entry.getKey();
            collection.getOpenStackNetworks().add(addLinks(populate(map(network), network)));
        }
    }
    return collection;
}
Also used : OpenStackNetworks(org.ovirt.engine.api.model.OpenStackNetworks) Set(java.util.Set) OpenStackNetwork(org.ovirt.engine.api.model.OpenStackNetwork) Network(org.ovirt.engine.core.common.businessentities.network.Network) Map(java.util.Map)

Example 33 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class JsonObjectSerializerTest method serializeNetwork.

@Test
public void serializeNetwork() {
    Network net = new Network();
    JsonObjectSerializer serializer = new JsonObjectSerializer();
    assertTrue(serializer.serialize(net).length() > 0);
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) Test(org.junit.Test)

Example 34 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class BaseNetworkImplementationDetailsUtilsTest method calculateNetworkImplementationDetailsNetworkQosOutOfSync.

@Test
public void calculateNetworkImplementationDetailsNetworkQosOutOfSync() throws Exception {
    HostNetworkQos qos = qosB;
    Network network = createNetwork(testIface.isBridged(), testIface.getMtu(), testIface.getVlanId());
    calculateNetworkImplementationDetailsAndAssertSync(testIface, false, qos, network);
}
Also used : AnonymousHostNetworkQos(org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos) HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos) Network(org.ovirt.engine.core.common.businessentities.network.Network) Test(org.junit.Test)

Example 35 with Network

use of org.ovirt.engine.core.common.businessentities.network.Network in project ovirt-engine by oVirt.

the class BaseNetworkImplementationDetailsUtilsTest method calculateNetworkImplementationDetailsNetworkQosOverridden.

@Test
public void calculateNetworkImplementationDetailsNetworkQosOverridden() throws Exception {
    Network network = createNetwork(testIface.isBridged(), testIface.getMtu(), testIface.getVlanId());
    calculateNetworkImplementationDetailsAndAssertSync(testIface, false, unlimitedHostNetworkQos, network);
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) Test(org.junit.Test)

Aggregations

Network (org.ovirt.engine.core.common.businessentities.network.Network)292 Test (org.junit.Test)105 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)63 FindActiveVmsUsingNetwork (org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetwork)47 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)46 ArrayList (java.util.ArrayList)44 Guid (org.ovirt.engine.core.compat.Guid)44 ProviderNetwork (org.ovirt.engine.core.common.businessentities.network.ProviderNetwork)39 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)23 List (java.util.List)21 EngineMessage (org.ovirt.engine.core.common.errors.EngineMessage)21 HashMap (java.util.HashMap)19 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)19 Map (java.util.Map)13 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)13 VnicProfile (org.ovirt.engine.core.common.businessentities.network.VnicProfile)13 HashSet (java.util.HashSet)9 Set (java.util.Set)9 BusinessEntityMap (org.ovirt.engine.core.common.businessentities.BusinessEntityMap)9 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)9