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