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;
}
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);
}
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;
}
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);
}
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;
}
Aggregations