Search in sources :

Example 1 with HostNetworkQos

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

the class BaseNetworkImplementationDetailsUtilsTest method createQos.

private HostNetworkQos createQos(Integer outAverageLinkshare, Integer outAverageUpperlimit, Integer outAverageRealtime) {
    HostNetworkQos qos = new HostNetworkQos();
    qos.setId(Guid.newGuid());
    qos.setOutAverageLinkshare(outAverageLinkshare);
    qos.setOutAverageUpperlimit(outAverageUpperlimit);
    qos.setOutAverageRealtime(outAverageRealtime);
    return qos;
}
Also used : AnonymousHostNetworkQos(org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos) HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)

Example 2 with HostNetworkQos

use of org.ovirt.engine.core.common.businessentities.network.HostNetworkQos 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 3 with HostNetworkQos

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

the class BaseNetworkImplementationDetailsUtilsTest method createAndMockQos.

private HostNetworkQos createAndMockQos(int outAverageLinkshare, int outAverageUpperlimit, int outAverageRealtime) {
    HostNetworkQos qos = createQos(outAverageLinkshare, outAverageUpperlimit, outAverageRealtime);
    when(hostNetworkQosDaoMock.get(qos.getId())).thenReturn(qos);
    return qos;
}
Also used : AnonymousHostNetworkQos(org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos) HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)

Example 4 with HostNetworkQos

use of org.ovirt.engine.core.common.businessentities.network.HostNetworkQos 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 5 with HostNetworkQos

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

the class EffectiveHostNetworkQosTest method createNetworkAttachentWithOverriddenQos.

private NetworkAttachment createNetworkAttachentWithOverriddenQos() {
    NetworkAttachment networkAttachment = new NetworkAttachment();
    HostNetworkQos hostNetworkQos = createHostNetworkQos();
    networkAttachment.setHostNetworkQos(AnonymousHostNetworkQos.fromHostNetworkQos(hostNetworkQos));
    return networkAttachment;
}
Also used : AnonymousHostNetworkQos(org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos) HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos) NetworkAttachment(org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)

Aggregations

HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)32 AnonymousHostNetworkQos (org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos)11 Network (org.ovirt.engine.core.common.businessentities.network.Network)9 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)7 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)6 Test (org.junit.Test)5 DnsResolverConfiguration (org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)5 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)3 Guid (org.ovirt.engine.core.compat.Guid)3 StringUtils (org.apache.commons.lang.StringUtils)2 Before (org.junit.Before)2 HostNic (org.ovirt.engine.api.model.HostNic)2 NameServer (org.ovirt.engine.core.common.businessentities.network.NameServer)2 VdsNetworkStatistics (org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics)2 EffectiveHostNetworkQos (org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos)2 Path (java.nio.file.Path)1