Search in sources :

Example 51 with VmNetworkInterface

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

the class VfSchedulerImplTest method hostNicNotHaveFreeVfs.

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

Example 52 with VmNetworkInterface

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

the class FindActiveVmsUsingNetworkTest method createNewViewableInterface.

private static VmNetworkInterface createNewViewableInterface(boolean plugged) {
    VmNetworkInterface iface = new VmNetworkInterface();
    iface.setId(Guid.newGuid());
    iface.setMacAddress(RandomUtils.instance().nextString(10));
    iface.setPlugged(plugged);
    return iface;
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)

Example 53 with VmNetworkInterface

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

the class VmNetworkInterfaceDaoTest method assertCorrectResultForTemplate.

private void assertCorrectResultForTemplate(List<VmNetworkInterface> result) {
    assertNotNull(result);
    assertFalse(result.isEmpty());
    for (VmNetworkInterface iface : result) {
        assertEquals(TEMPLATE_ID, iface.getVmTemplateId());
    }
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)

Example 54 with VmNetworkInterface

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

the class VmNetworkInterfaceDaoTest method testGet.

/**
 * Ensures that the network interface is returned.
 */
@Test
public void testGet() {
    VmNetworkInterface result = dao.get(FixturesTool.VM_NETWORK_INTERFACE);
    assertNotNull(result);
    assertEquals(FixturesTool.VM_NETWORK_INTERFACE, result.getId());
}
Also used : VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) Test(org.junit.Test)

Example 55 with VmNetworkInterface

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

the class VmNetworkInterfaceDaoTest method testGetAllInterfacesForVmFilteredWithPermissions.

/**
 * Ensures that the VMs for a privileged user are returned
 */
@Test
public void testGetAllInterfacesForVmFilteredWithPermissions() {
    List<VmNetworkInterface> result = dao.getAllForVm(VM_ID, PRIVILEGED_USER_ID, true);
    assertNotNull(result);
    assertFalse(result.isEmpty());
    for (VmNetworkInterface iface : result) {
        assertEquals(VM_ID, iface.getVmId());
    }
}
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