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