use of org.ovirt.engine.api.model.Vm in project ovirt-engine by oVirt.
the class VmMapperTest method ovfConfigurationMap.
@Test
public void ovfConfigurationMap() {
String ovfConfig = "config";
ConfigurationType configurationType = ConfigurationType.OVF;
Vm model = new Vm();
VmMapper.map(ovfConfig, ConfigurationType.OVF, model);
assertNotNull(model.getInitialization());
assertNotNull(model.getInitialization().getConfiguration());
assertEquals(ovfConfig, model.getInitialization().getConfiguration().getData());
assertEquals(model.getInitialization().getConfiguration().getType(), configurationType);
}
use of org.ovirt.engine.api.model.Vm in project ovirt-engine by oVirt.
the class VmMapperTest method testGuestOs2.
@Test
public void testGuestOs2() {
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.Windows);
vmDynamic.setGuestOsCodename("");
vmDynamic.setGuestOsDistribution("");
vmDynamic.setGuestOsVersion("6.2.4800");
vmDynamic.setGuestOsArch(ArchitectureType.x86_64);
vmDynamic.setGuestOsKernelVersion("");
vm.setDynamicData(vmDynamic);
Vm map = VmMapper.map(vm, (Vm) null);
assertNotNull(map.getGuestOperatingSystem());
assertEquals("Windows", map.getGuestOperatingSystem().getFamily());
assertEquals("", map.getGuestOperatingSystem().getCodename());
assertEquals("", map.getGuestOperatingSystem().getDistribution());
assertEquals("6.2.4800", map.getGuestOperatingSystem().getVersion().getFullVersion());
assertNotNull(map.getGuestOperatingSystem().getVersion().getMajor());
assertEquals(6, (long) map.getGuestOperatingSystem().getVersion().getMajor());
assertNotNull(map.getGuestOperatingSystem().getVersion().getMinor());
assertEquals(2, (long) map.getGuestOperatingSystem().getVersion().getMinor());
assertNotNull(map.getGuestOperatingSystem().getVersion().getBuild());
assertEquals(4800, (long) map.getGuestOperatingSystem().getVersion().getBuild());
assertNull(map.getGuestOperatingSystem().getVersion().getRevision());
assertEquals("x86_64", map.getGuestOperatingSystem().getArchitecture());
assertNull(map.getGuestOperatingSystem().getKernel());
}
use of org.ovirt.engine.api.model.Vm 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.api.model.Vm in project ovirt-engine by oVirt.
the class VmMapperTest method testMapHostId.
@Test
public void testMapHostId() {
org.ovirt.engine.core.common.businessentities.VM entity = new org.ovirt.engine.core.common.businessentities.VM();
entity.setStatus(VMStatus.Up);
Guid guid = Guid.newGuid();
entity.setRunOnVds(guid);
Vm model = VmMapper.map(entity, (Vm) null);
assertEquals(guid.toString(), model.getHost().getId());
}
use of org.ovirt.engine.api.model.Vm 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());
}
Aggregations