use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class VmMapperTest method testGuestFQDN.
@Test
public void testGuestFQDN() {
org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM();
VmDynamic vmDynamic = new VmDynamic();
vmDynamic.setStatus(VMStatus.Up);
vmDynamic.setFqdn("localhost.localdomain");
vm.setDynamicData(vmDynamic);
Vm map = VmMapper.map(vm, (Vm) null);
assertNotNull(map.getFqdn());
assertEquals("localhost.localdomain", map.getFqdn());
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class VmMapperTest method testGuestOs.
@Test
public void testGuestOs() {
org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM();
VmDynamic vmDynamic = new VmDynamic();
vmDynamic.setStatus(VMStatus.Up);
vmDynamic.setGuestOsType(OsType.Linux);
vmDynamic.setGuestOsCodename("Santiago");
vmDynamic.setGuestOsDistribution("Red Hat Enterprise Linux Server");
vmDynamic.setGuestOsVersion("6.5");
vmDynamic.setGuestOsArch(ArchitectureType.x86_64);
vmDynamic.setGuestOsKernelVersion("2.6.32-431.el6.x86_64");
vm.setDynamicData(vmDynamic);
Vm map = VmMapper.map(vm, (Vm) null);
assertNotNull(map.getGuestOperatingSystem());
assertEquals("Linux", map.getGuestOperatingSystem().getFamily());
assertEquals("Santiago", map.getGuestOperatingSystem().getCodename());
assertEquals("Red Hat Enterprise Linux Server", map.getGuestOperatingSystem().getDistribution());
assertEquals("6.5", map.getGuestOperatingSystem().getVersion().getFullVersion());
assertNotNull(map.getGuestOperatingSystem().getVersion().getMajor());
assertEquals(6, (long) map.getGuestOperatingSystem().getVersion().getMajor());
assertNotNull(map.getGuestOperatingSystem().getVersion().getMinor());
assertEquals(5, (long) map.getGuestOperatingSystem().getVersion().getMinor());
assertNull(map.getGuestOperatingSystem().getVersion().getBuild());
assertNull(map.getGuestOperatingSystem().getVersion().getRevision());
assertEquals("x86_64", map.getGuestOperatingSystem().getArchitecture());
assertEquals("2.6.32-431.el6.x86_64", map.getGuestOperatingSystem().getKernel().getVersion().getFullVersion());
assertEquals(2, (long) map.getGuestOperatingSystem().getKernel().getVersion().getMajor());
assertEquals(6, (long) map.getGuestOperatingSystem().getKernel().getVersion().getMinor());
assertEquals(32, (long) map.getGuestOperatingSystem().getKernel().getVersion().getBuild());
assertEquals(431, (long) map.getGuestOperatingSystem().getKernel().getVersion().getRevision());
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class VmDaoTest method createHostedEngineVm.
private void createHostedEngineVm(Guid id) {
VmStatic vmStatic = new VmStatic();
vmStatic.setId(id);
vmStatic.setClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI);
vmStatic.setName("HostedEngine");
vmStatic.setOrigin(OriginType.HOSTED_ENGINE);
vmStatic.setCpuProfileId(FixturesTool.CPU_PROFILE_1);
getDbFacade().getVmStaticDao().save(vmStatic);
VmDynamic vmDynamic = new VmDynamic();
vmDynamic.setId(id);
getDbFacade().getVmDynamicDao().save(vmDynamic);
VmStatistics vmStatistics = new VmStatistics();
vmStatistics.setId(id);
getDbFacade().getVmStatisticsDao().save(vmStatistics);
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class VmDynamicDaoTest method testUpdateConsoleUserWithOptimisticLockingFailure.
/**
* Make sure that saving a new console user id and console user name to a virtual machine
* that already as a previous console user fails and returns {@code false}.
*/
@Test
public void testUpdateConsoleUserWithOptimisticLockingFailure() throws Exception {
VmDynamic vmWithoutConsoleUser = dao.get(FixturesTool.VM_RHEL5_POOL_57);
vmWithoutConsoleUser.setConsoleUserId(new Guid("9bf7c640-b620-456f-a550-0348f366544b"));
boolean result = dao.updateConsoleUserWithOptimisticLocking(vmWithoutConsoleUser);
assertFalse(result);
}
use of org.ovirt.engine.core.common.businessentities.VmDynamic in project ovirt-engine by oVirt.
the class VmDynamicDaoTest method testClearMigratingToVds.
@Test
public void testClearMigratingToVds() throws Exception {
VmDynamic vmDynamic = dao.get(FixturesTool.VM_RHEL5_POOL_51);
assertNotNull("migrating_to_vds field should not be null before we clear it", vmDynamic.getMigratingToVds());
dao.clearMigratingToVds(FixturesTool.VM_RHEL5_POOL_51);
vmDynamic = dao.get(FixturesTool.VM_RHEL5_POOL_51);
assertNull("migrating_to_vds field should be null after we clear it", vmDynamic.getMigratingToVds());
}
Aggregations