Search in sources :

Example 46 with VmNetworkInterface

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

the class VfSchedulerImplTest method hostNicNotHaveNetworkInSriovConfig.

@Test
public void hostNicNotHaveNetworkInSriovConfig() {
    VmNetworkInterface vnic = mockVnic(true);
    initHostWithOneVfsConfig(Collections.singletonList(vnic), 5, false, false, false, true);
    assertHostNotValid(Collections.singletonList(vnic), Collections.singletonList(vnic.getName()));
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Test(org.junit.Test)

Example 47 with VmNetworkInterface

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

the class VfSchedulerImplTest method hostNotHaveSriovNics.

@Test
public void hostNotHaveSriovNics() {
    VmNetworkInterface vnic = mockVnic(true);
    assertHostNotValid(Collections.singletonList(vnic), Collections.singletonList(vnic.getName()));
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Test(org.junit.Test)

Example 48 with VmNetworkInterface

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

the class VfSchedulerImplTest method multipleVfsConfigsCommon.

private void multipleVfsConfigsCommon(boolean firstValid) {
    VmNetworkInterface vnic = mockVnic(true);
    HostNicVfsConfig hostNicVfsConfig1 = new HostNicVfsConfig();
    updateVfsConfig(hostNicVfsConfig1, vnic, firstValid, false, firstValid);
    HostNicVfsConfig hostNicVfsConfig2 = new HostNicVfsConfig();
    updateVfsConfig(hostNicVfsConfig2, vnic, !firstValid, false, !firstValid);
    mockVfsConfigsOnHost(Arrays.asList(hostNicVfsConfig1, hostNicVfsConfig2));
    assertHostValid(Collections.singletonList(vnic));
}
Also used : HostNicVfsConfig(org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)

Example 49 with VmNetworkInterface

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

the class VfSchedulerImplTest method hostNicHaveTwoFreeVfOneShouldBeDirectlyPassthrough.

@Test
public void hostNicHaveTwoFreeVfOneShouldBeDirectlyPassthrough() {
    VmNetworkInterface vnic = mockVnic(true);
    List<HostDevice> vfs = initHostWithOneVfsConfig(Collections.singletonList(vnic), 2, true, false, false, true, false, true);
    HostDevice freeVf = vfs.get(0);
    mockVfDirectlyAttached(false, freeVf);
    expectedVnicToVfMap.put(vnic.getId(), freeVf.getDeviceName());
    assertHostValid(Collections.singletonList(vnic));
}
Also used : HostDevice(org.ovirt.engine.core.common.businessentities.HostDevice) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Test(org.junit.Test)

Example 50 with VmNetworkInterface

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

the class VfSchedulerImplTest method hostNicHaveOneFreeVfWhichShouldBeDirectlyPassthrough.

@Test
public void hostNicHaveOneFreeVfWhichShouldBeDirectlyPassthrough() {
    VmNetworkInterface vnic = mockVnic(true);
    initHostWithOneVfsConfig(Collections.singletonList(vnic), 1, true, false, false, true, false, true);
    assertHostNotValid(Collections.singletonList(vnic), Collections.singletonList(vnic.getName()));
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Test(org.junit.Test)

Aggregations

VmNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)115 Test (org.junit.Test)27 ArrayList (java.util.ArrayList)25 Guid (org.ovirt.engine.core.compat.Guid)19 VM (org.ovirt.engine.core.common.businessentities.VM)16 HashMap (java.util.HashMap)11 List (java.util.List)9 Map (java.util.Map)9 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)6 PairQueryable (org.ovirt.engine.core.common.utils.PairQueryable)6 MapVnicsContext (org.ovirt.engine.core.bll.exportimport.vnics.MapVnicsContext)5 VmDevice (org.ovirt.engine.core.common.businessentities.VmDevice)5 HostNicVfsConfig (org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig)5 VmNetworkStatistics (org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics)5 Nic (org.ovirt.engine.api.model.Nic)4 VnicProfileHelper (org.ovirt.engine.core.bll.network.vm.VnicProfileHelper)4 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)4 Network (org.ovirt.engine.core.common.businessentities.network.Network)4 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)4 Collection (java.util.Collection)3