Search in sources :

Example 36 with Network

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

the class BaseNetworkImplementationDetailsUtilsTest method createNetwork.

protected Network createNetwork(boolean vmNetwork, int mtu, Integer vlanId) {
    Network network = new Network();
    network.setId(Guid.newGuid());
    network.setVmNetwork(vmNetwork);
    network.setMtu(mtu);
    network.setVlanId(vlanId);
    return network;
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network)

Example 37 with Network

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

the class EffectiveHostNetworkQosTest method createNetworkWithQos.

private Network createNetworkWithQos(HostNetworkQos hostNetworkQos) {
    Network network = new Network();
    network.setQosId(hostNetworkQos.getId());
    return network;
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network)

Example 38 with Network

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

the class EffectiveHostNetworkQosTest method testGetQosWhenNetworkAttachmentDoesNotHaveOverriddenQos.

@Test
public void testGetQosWhenNetworkAttachmentDoesNotHaveOverriddenQos() throws Exception {
    HostNetworkQos hostNetworkQos = createHostNetworkQos();
    Network network = createNetworkWithQos(hostNetworkQos);
    NetworkAttachment networkAttachment = createNetworkAttachmentWithoutOverriddenQos();
    when(hostNetworkQosDao.get(network.getQosId())).thenReturn(hostNetworkQos);
    assertThat(effectiveHostNetworkQos.getQos(networkAttachment, network), is(hostNetworkQos));
    verify(hostNetworkQosDao).get(eq(network.getQosId()));
    verifyNoMoreInteractions(hostNetworkQosDao);
}
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) NetworkAttachment(org.ovirt.engine.core.common.businessentities.network.NetworkAttachment) Test(org.junit.Test)

Example 39 with Network

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

the class NetworkImplementationDetailsUtilsUsingVlanNicTest method calculateNetworkImplementationDetailsNetworkVlanOutOfSyncNicAndNetworkHasNoVlanId.

@Test
public void calculateNetworkImplementationDetailsNetworkVlanOutOfSyncNicAndNetworkHasNoVlanId() throws Exception {
    Network network = createNetwork(getTestIface().isBridged(), getTestIface().getMtu(), null);
    calculateNetworkImplementationDetailsAndAssertSync(getTestIface(), false, qosA, network);
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) Test(org.junit.Test)

Example 40 with Network

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

the class HostSetupNetworksModel method createUnmanagedNetworkModel.

private LogicalNetworkModel createUnmanagedNetworkModel(String networkName, VdsNetworkInterface nic) {
    Network unmanagedNetwork = new Network();
    unmanagedNetwork.setName(networkName);
    unmanagedNetwork.setVlanId(nic.getVlanId());
    unmanagedNetwork.setMtu(nic.getMtu());
    unmanagedNetwork.setVmNetwork(nic.isBridged());
    LogicalNetworkModel networkModel = new LogicalNetworkModel(unmanagedNetwork, null, this);
    return networkModel;
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) LogicalNetworkModel(org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel)

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