use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class VfSchedulerImplTest method multipleVnicCommonTest.
private void multipleVnicCommonTest(boolean allNicsValid) {
VmNetworkInterface vnic1 = mockVnic(true, "net1");
VmNetworkInterface vnic2 = mockVnic(true, "net2");
VmNetworkInterface vnic3 = mockVnic(false);
VmNetworkInterface vnic4 = mockVnic(false);
HostNicVfsConfig hostNicVfsConfig1 = new HostNicVfsConfig();
updateVfsConfig(hostNicVfsConfig1, vnic1, true, false, true);
HostNicVfsConfig hostNicVfsConfig2 = new HostNicVfsConfig();
updateVfsConfig(hostNicVfsConfig2, vnic2, false, allNicsValid, allNicsValid);
mockVfsConfigsOnHost(Arrays.asList(hostNicVfsConfig1, hostNicVfsConfig2));
List<VmNetworkInterface> allVnics = Arrays.asList(vnic1, vnic2, vnic3, vnic4);
if (allNicsValid) {
assertHostValid(allVnics);
} else {
assertHostNotValid(allVnics, Collections.singletonList(vnic2.getName()));
}
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class VfSchedulerImplTest method findFreeVfForVnicCommon.
private void findFreeVfForVnicCommon(boolean existFreeVf) {
VmNetworkInterface vnic = mockVnic(true, "net1");
HostNicVfsConfig hostNicVfsConfig = new HostNicVfsConfig();
updateVfsConfig(hostNicVfsConfig, vnic, true, false, existFreeVf);
mockVfsConfigsOnHost(Collections.singletonList(hostNicVfsConfig));
String freeVf = vfScheduler.findFreeVfForVnic(hostId, createNetwork(vnic.getNetworkName()), vmId);
if (existFreeVf) {
assertNotNull(freeVf);
} else {
assertNull(freeVf);
}
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class VfSchedulerImplTest method hostNicHaveOneFreeVfWhichShareIommuGroup.
@Test
public void hostNicHaveOneFreeVfWhichShareIommuGroup() {
VmNetworkInterface vnic = mockVnic(true);
initHostWithOneVfsConfig(Collections.singletonList(vnic), 1, true, false, false, true, true, false);
assertHostNotValid(Collections.singletonList(vnic), Collections.singletonList(vnic.getName()));
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class VfSchedulerImplTest method validAllNetworksAllowed.
@Test
public void validAllNetworksAllowed() {
VmNetworkInterface vnic = mockVnic(true);
initHostWithOneVfsConfig(Collections.singletonList(vnic), 5, true, false, false, true);
assertHostValid(Collections.singletonList(vnic));
}
use of org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface in project ovirt-engine by oVirt.
the class VfSchedulerImplTest method validNetworkInSriovConfig.
@Test
public void validNetworkInSriovConfig() {
VmNetworkInterface vnic = mockVnic(true);
initHostWithOneVfsConfig(Collections.singletonList(vnic), 5, false, true, false, true);
assertHostValid(Collections.singletonList(vnic));
}
Aggregations