use of org.ovirt.engine.core.common.businessentities.HostDevice in project ovirt-engine by oVirt.
the class HostDeviceDaoTest method updateNetworkDevice.
@Test
public void updateNetworkDevice() {
HostDevice before = getNetworkDevice();
before.setNetworkInterfaceName(before.getNetworkInterfaceName() + "new");
before.setDriver("updated driver");
dao.update(before);
HostDevice after = dao.get(before.getId());
assertNotNull(after);
assertEquals(before, after);
}
use of org.ovirt.engine.core.common.businessentities.HostDevice in project ovirt-engine by oVirt.
the class HostDeviceDaoTest method cleanDownVmsTest.
@Test
public void cleanDownVmsTest() {
HostDevice device = getNetworkDevice();
HostDeviceId deviceId = device.getId();
// Setting an id of VM with VMStatus.Down
Guid vmId = FixturesTool.VM_WITH_NO_ATTACHED_DISKS;
dao.setVmIdOnHostDevice(deviceId, vmId);
device = dao.get(deviceId);
assertNotNull(device);
assertEquals(vmId, device.getVmId());
dao.cleanDownVms();
device = dao.get(deviceId);
assertNull(device.getVmId());
}
use of org.ovirt.engine.core.common.businessentities.HostDevice in project ovirt-engine by oVirt.
the class NetworkDeviceHelperImplTest method slaveDeviceNonNetworkFree.
@Test
public void slaveDeviceNonNetworkFree() {
freeVfCommon(0, 0, 0, 0, 0, 1);
HostDevice hostDevice = getSingleMockedNonFreeDevice();
assertFalse(networkDeviceHelper.isDeviceNetworkFree(hostDevice));
}
use of org.ovirt.engine.core.common.businessentities.HostDevice in project ovirt-engine by oVirt.
the class NetworkDeviceHelperImplTest method noNicDeviceNonNetworkFree.
@Test
public void noNicDeviceNonNetworkFree() {
freeVfCommon(0, 0, 1, 0, 0, 0);
HostDevice hostDevice = getSingleMockedNonFreeDevice();
assertFalse(networkDeviceHelper.isDeviceNetworkFree(hostDevice));
}
use of org.ovirt.engine.core.common.businessentities.HostDevice in project ovirt-engine by oVirt.
the class NetworkDeviceHelperImplTest method isNonNetworkDeviceNetworkFree.
@Test
public void isNonNetworkDeviceNetworkFree() {
HostDevice device = new HostDevice();
device.setHostId(HOST_ID);
device.setDeviceName(PCI_DEVICE_NAME_2);
assertTrue(networkDeviceHelper.isDeviceNetworkFree(device));
}
Aggregations