summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bentele2021-04-30 10:22:59 +0200
committerManuel Bentele2021-04-30 10:22:59 +0200
commit110afb975a086cd059b695763655bcdf5f151e1e (patch)
tree7e2ff12bd635afcffff7eb3ed8b80c4aa513b99b
parentAdd unit tests for transformation logic (dozmod-server --> dozmod-client) (diff)
downloadmaster-sync-shared-110afb975a086cd059b695763655bcdf5f151e1e.tar.gz
master-sync-shared-110afb975a086cd059b695763655bcdf5f151e1e.tar.xz
master-sync-shared-110afb975a086cd059b695763655bcdf5f151e1e.zip
Add unit tests for transformation logic (dozmod-server --> stateless client)
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java2
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java5
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationQemu.java19
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualBox.java6
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java7
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClient.java4
-rw-r--r--src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToDozModClientTest.java5
-rw-r--r--src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java99
-rw-r--r--src/test/resources/libvirt/xml/qemu-kvm_default-ubuntu-20-04-vm_transform-non-persistent.xml164
-rw-r--r--src/test/resources/virtualbox/xml/virtualbox_default-ubuntu_transform-non-persistent.vbox53
-rw-r--r--src/test/resources/vmware/vmx/vmware-player_default-ubuntu_transform-non-persistent.vmx42
11 files changed, 400 insertions, 6 deletions
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java
index c5381c5..b8e46ed 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java
@@ -326,6 +326,8 @@ public abstract class VirtualizationConfiguration<T, U, W, X>
*/
public abstract String getFileNameExtension();
+ public abstract boolean addEmptyHddTemplate();
+
public abstract boolean addHddTemplate( File diskImage, String hddMode, String redoDir );
public abstract boolean addHddTemplate( String diskImagePath, String hddMode, String redoDir );
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java
index 5b1615f..d5e9abb 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java
@@ -104,6 +104,11 @@ public class VirtualizationConfigurationDocker extends VirtualizationConfigurati
public void transformPrivacy() throws VirtualizationConfigurationException {
}
+ @Override
+ public boolean addEmptyHddTemplate() {
+ return false;
+ }
+
@Override public boolean addHddTemplate(File diskImage, String hddMode, String redoDir) {
return false;
}
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationQemu.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationQemu.java
index 716a2f3..710a42d 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationQemu.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationQemu.java
@@ -313,6 +313,12 @@ public class VirtualizationConfigurationQemu extends
}
@Override
+ public boolean addEmptyHddTemplate()
+ {
+ return this.addHddTemplate( new String(), null, null );
+ }
+
+ @Override
public boolean addHddTemplate( File diskImage, String hddMode, String redoDir )
{
return this.addHddTemplate( diskImage.getAbsolutePath(), hddMode, redoDir );
@@ -348,13 +354,22 @@ public class VirtualizationConfigurationQemu extends
storageDiskDevice.setBusType( BusType.VIRTIO );
String targetDevName = VirtualizationConfigurationQemuUtils.createAlphabeticalDeviceName( "vd", index );
storageDiskDevice.setTargetDevice( targetDevName );
- storageDiskDevice.setStorage( StorageType.FILE, diskImagePath );
+
+ if ( diskImagePath == null || diskImagePath.isEmpty() ) {
+ storageDiskDevice.removeStorage();
+ } else {
+ storageDiskDevice.setStorage( StorageType.FILE, diskImagePath );
+ }
// add new created HDD to the metadata of the QemuMetaData object, too
this.addHddMetaData( storageDiskDevice );
} else {
// HDD exists, so update existing storage (HDD) device
- storageDiskDevice.setStorage( StorageType.FILE, diskImagePath );
+ if ( diskImagePath == null || diskImagePath.isEmpty() ) {
+ storageDiskDevice.removeStorage();
+ } else {
+ storageDiskDevice.setStorage( StorageType.FILE, diskImagePath );
+ }
}
return true;
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualBox.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualBox.java
index d32d496..c53a7e0 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualBox.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVirtualBox.java
@@ -132,6 +132,12 @@ public class VirtualizationConfigurationVirtualBox extends VirtualizationConfigu
}
@Override
+ public boolean addEmptyHddTemplate()
+ {
+ return this.addHddTemplate( "%VM_DISK_PATH%", "%VM_DISK_MODE%", "%VM_DISK_REDOLOGDIR%" );
+ }
+
+ @Override
public boolean addHddTemplate( String diskImage, String hddMode, String redoDir )
{
config.changeAttribute( "/VirtualBox/Machine/MediaRegistry/HardDisks/HardDisk[@location='" + PlaceHolder.HDDLOCATION.toString() + "']", "location", diskImage );
diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java
index e1102b6..3e8d913 100644
--- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java
+++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationVmware.java
@@ -239,6 +239,12 @@ public class VirtualizationConfigurationVmware extends VirtualizationConfigurati
}
@Override
+ public boolean addEmptyHddTemplate()
+ {
+ return this.addHddTemplate( "%VM_DISK_PATH%", "%VM_DISK_MODE%", "%VM_DISK_REDOLOGDIR%" );
+ }
+
+ @Override
public boolean addHddTemplate( File diskImage, String hddMode, String redoDir )
{
return addHddTemplate( diskImage.getName(), hddMode, redoDir );
@@ -251,6 +257,7 @@ public class VirtualizationConfigurationVmware extends VirtualizationConfigurati
LOGGER.error( "Empty disk image path given!" );
return false;
}
+
DriveBusType bus;
try {
bus = DriveBusType.valueOf( config.get( "#SLX_HDD_BUS" ) );
diff --git a/src/main/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClient.java b/src/main/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClient.java
index 6c573bb..580b0fc 100644
--- a/src/main/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClient.java
+++ b/src/main/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClient.java
@@ -78,8 +78,8 @@ public class ConfigurationLogicDozModServerToStatelessClient
throw new TransformationException( "Can not set display name in virtualization configuration!" );
}
- // append hard disk drive
- if ( !config.addHddTemplate( "%VM_DISK_PATH%", "%VM_DISK_MODE%", "%VM_DISK_REDOLOGDIR%" ) ) {
+ // append hard disk drive (with no referenced image as content)
+ if ( !config.addEmptyHddTemplate() ) {
throw new TransformationException( "Can not configure hard disk in virtualization configuration!" );
}
diff --git a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToDozModClientTest.java b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToDozModClientTest.java
index b3cbd8a..034269b 100644
--- a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToDozModClientTest.java
+++ b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToDozModClientTest.java
@@ -56,8 +56,8 @@ public class ConfigurationLogicDozModServerToDozModClientTest
final String transformedConfig = config.getConfigurationAsString();
final String expectedTransformedConfig = ConfigurationLogicTestUtils.readFileToString( expectedConfig );
- assertDoesNotThrow( () -> config.validate() );
assertTrue( ConfigurationLogicTestUtils.isContentEqual( expectedTransformedConfig, transformedConfig ) );
+ assertDoesNotThrow( () -> config.validate() );
}
@Test
@@ -77,7 +77,8 @@ public class ConfigurationLogicDozModServerToDozModClientTest
final String transformedConfig = config.getConfigurationAsString();
final String expectedTransformedConfig = ConfigurationLogicTestUtils.readFileToString( expectedConfig );
- assertTrue(ConfigurationLogicTestUtils.isVirtualBoxContentEqual( expectedTransformedConfig, transformedConfig ) );
+ assertTrue(
+ ConfigurationLogicTestUtils.isVirtualBoxContentEqual( expectedTransformedConfig, transformedConfig ) );
assertDoesNotThrow( () -> config.validate() );
}
diff --git a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java
new file mode 100644
index 0000000..186f422
--- /dev/null
+++ b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicDozModServerToStatelessClientTest.java
@@ -0,0 +1,99 @@
+package org.openslx.virtualization.configuration.logic;
+
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.File;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.openslx.libvirt.xml.LibvirtXmlTestResources;
+import org.openslx.virtualization.configuration.VirtualizationConfiguration;
+import org.openslx.virtualization.configuration.data.ConfigurationDataDozModServerToStatelessClient;
+import org.openslx.virtualization.configuration.transformation.TransformationException;
+
+public class ConfigurationLogicDozModServerToStatelessClientTest
+{
+ private static final String DEFAULT_DISPLAY_NAME = "Test";
+ private static final String DEFAULT_OS_ID = null;
+ private static final boolean DEFAULT_HAS_USB_ACCESS = true;
+
+ private static final ConfigurationDataDozModServerToStatelessClient DEFAULT_CONFIG_DATA = new ConfigurationDataDozModServerToStatelessClient(
+ ConfigurationLogicDozModServerToStatelessClientTest.DEFAULT_DISPLAY_NAME,
+ ConfigurationLogicDozModServerToStatelessClientTest.DEFAULT_OS_ID,
+ ConfigurationLogicDozModServerToStatelessClientTest.DEFAULT_HAS_USB_ACCESS );
+
+ @BeforeAll
+ public static void setUp()
+ {
+ // disable logging with log4j
+ LogManager.getRootLogger().setLevel( Level.OFF );
+ }
+
+ @Test
+ @DisplayName( "Test transformation logic between a dozmod-server and a stateless client for Libvirt/QEMU configuration" )
+ public void testConfigurationLogicDozModServerToStatelessClientLibvirt() throws TransformationException
+ {
+ final String inputConfigFileName = "qemu-kvm_default-ubuntu-20-04-vm_transform-privacy.xml";
+ final String expectedConfigFileName = "qemu-kvm_default-ubuntu-20-04-vm_transform-non-persistent.xml";
+ final File inputConfig = LibvirtXmlTestResources.getLibvirtXmlFile( inputConfigFileName );
+ final File expectedConfig = LibvirtXmlTestResources.getLibvirtXmlFile( expectedConfigFileName );
+ final VirtualizationConfiguration<?, ?, ?, ?> config;
+ config = ConfigurationLogicTestUtils.newVirtualizationConfigurationInstance( inputConfig );
+ final ConfigurationLogicDozModServerToStatelessClient logic = new ConfigurationLogicDozModServerToStatelessClient();
+
+ logic.apply( config, ConfigurationLogicDozModServerToStatelessClientTest.DEFAULT_CONFIG_DATA );
+
+ final String transformedConfig = config.getConfigurationAsString();
+ final String expectedTransformedConfig = ConfigurationLogicTestUtils.readFileToString( expectedConfig );
+
+ assertTrue( ConfigurationLogicTestUtils.isContentEqual( expectedTransformedConfig, transformedConfig ) );
+ assertDoesNotThrow( () -> config.validate() );
+ }
+
+ @Test
+ @DisplayName( "Test transformation logic between a dozmod-server and a stateless client for VirtualBox configuration" )
+ public void testConfigurationLogicDozModServerToStatelessClientVirtualBox() throws TransformationException
+ {
+ final String inputConfigFileName = "virtualbox_default-ubuntu_transform-privacy.vbox";
+ final String expectedConfigFileName = "virtualbox_default-ubuntu_transform-non-persistent.vbox";
+ final File inputConfig = ConfigurationLogicTestResources.getVirtualBoxXmlFile( inputConfigFileName );
+ final File expectedConfig = ConfigurationLogicTestResources.getVirtualBoxXmlFile( expectedConfigFileName );
+ final VirtualizationConfiguration<?, ?, ?, ?> config;
+ config = ConfigurationLogicTestUtils.newVirtualizationConfigurationInstance( inputConfig );
+ final ConfigurationLogicDozModServerToStatelessClient logic = new ConfigurationLogicDozModServerToStatelessClient();
+
+ logic.apply( config, ConfigurationLogicDozModServerToStatelessClientTest.DEFAULT_CONFIG_DATA );
+
+ final String transformedConfig = config.getConfigurationAsString();
+ final String expectedTransformedConfig = ConfigurationLogicTestUtils.readFileToString( expectedConfig );
+
+ assertTrue(
+ ConfigurationLogicTestUtils.isVirtualBoxContentEqual( expectedTransformedConfig, transformedConfig ) );
+ assertDoesNotThrow( () -> config.validate() );
+ }
+
+ @Test
+ @DisplayName( "Test transformation logic between dozmod-server and a stateless client for VMware configuration" )
+ public void testConfigurationLogicDozModServerToStatelessClientVmware() throws TransformationException
+ {
+ final String inputConfigFileName = "vmware-player_default-ubuntu_transform-privacy.vmx";
+ final String expectedConfigFileName = "vmware-player_default-ubuntu_transform-non-persistent.vmx";
+ final File inputConfig = ConfigurationLogicTestResources.getVmwareVmxFile( inputConfigFileName );
+ final File expectedConfig = ConfigurationLogicTestResources.getVmwareVmxFile( expectedConfigFileName );
+ final VirtualizationConfiguration<?, ?, ?, ?> config;
+ config = ConfigurationLogicTestUtils.newVirtualizationConfigurationInstance( inputConfig );
+ final ConfigurationLogicDozModServerToStatelessClient logic = new ConfigurationLogicDozModServerToStatelessClient();
+
+ logic.apply( config, ConfigurationLogicDozModServerToStatelessClientTest.DEFAULT_CONFIG_DATA );
+
+ final String transformedConfig = config.getConfigurationAsString();
+ final String expectedTransformedConfig = ConfigurationLogicTestUtils.readFileToString( expectedConfig );
+
+ assertTrue( ConfigurationLogicTestUtils.isContentEqual( expectedTransformedConfig, transformedConfig ) );
+ assertDoesNotThrow( () -> config.validate() );
+ }
+}
diff --git a/src/test/resources/libvirt/xml/qemu-kvm_default-ubuntu-20-04-vm_transform-non-persistent.xml b/src/test/resources/libvirt/xml/qemu-kvm_default-ubuntu-20-04-vm_transform-non-persistent.xml
new file mode 100644
index 0000000..2f283ca
--- /dev/null
+++ b/src/test/resources/libvirt/xml/qemu-kvm_default-ubuntu-20-04-vm_transform-non-persistent.xml
@@ -0,0 +1,164 @@
+<domain type="kvm">
+ <name>Test</name>
+ <uuid>8dc5433c-0228-49e4-b019-fa2b606aa544</uuid>
+ <title>Ubuntu 20.04</title>
+ <description>Ubuntu 20.04 desktop installation</description>
+ <metadata>
+ <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
+ <libosinfo:os id="http://ubuntu.com/ubuntu/20.04"/>
+ </libosinfo:libosinfo>
+ </metadata>
+ <memory unit="KiB">4194304</memory>
+ <currentMemory unit="KiB">4194304</currentMemory>
+ <vcpu placement="static">2</vcpu>
+ <os>
+ <type arch="x86_64" machine="pc-q35-5.1">hvm</type>
+ <boot dev="hd"/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <vmport state="off"/>
+ </features>
+ <cpu check="partial" mode="host-model"/>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <pm>
+ <suspend-to-mem enabled="no"/>
+ <suspend-to-disk enabled="no"/>
+ </pm>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk device="disk" type="block">
+ <driver cache="none" io="native" name="qemu" type="raw"/>
+ <target bus="virtio" dev="vda"/>
+ <address bus="0x03" domain="0x0000" function="0x0" slot="0x00" type="pci"/>
+ </disk>
+ <disk device="cdrom" type="file">
+ <driver name="qemu" type="raw"/>
+ <target bus="sata" dev="sda"/>
+ <readonly/>
+ <address bus="0" controller="0" target="0" type="drive" unit="0"/>
+ </disk>
+ <disk device="floppy" type="file">
+ <driver name="qemu" type="raw"/>
+ <target bus="fdc" dev="fda"/>
+ <address bus="0" controller="0" target="0" type="drive" unit="0"/>
+ </disk>
+ <controller index="0" model="ich9-ehci1" type="usb">
+ <address bus="0x00" domain="0x0000" function="0x7" slot="0x1d" type="pci"/>
+ </controller>
+ <controller index="0" model="ich9-uhci1" type="usb">
+ <master startport="0"/>
+ <address bus="0x00" domain="0x0000" function="0x0" multifunction="on" slot="0x1d" type="pci"/>
+ </controller>
+ <controller index="0" model="ich9-uhci2" type="usb">
+ <master startport="2"/>
+ <address bus="0x00" domain="0x0000" function="0x1" slot="0x1d" type="pci"/>
+ </controller>
+ <controller index="0" model="ich9-uhci3" type="usb">
+ <master startport="4"/>
+ <address bus="0x00" domain="0x0000" function="0x2" slot="0x1d" type="pci"/>
+ </controller>
+ <controller index="0" type="sata">
+ <address bus="0x00" domain="0x0000" function="0x2" slot="0x1f" type="pci"/>
+ </controller>
+ <controller index="0" model="pcie-root" type="pci"/>
+ <controller index="1" model="pcie-root-port" type="pci">
+ <model name="pcie-root-port"/>
+ <target chassis="1" port="0x10"/>
+ <address bus="0x00" domain="0x0000" function="0x0" multifunction="on" slot="0x02" type="pci"/>
+ </controller>
+ <controller index="2" model="pcie-root-port" type="pci">
+ <model name="pcie-root-port"/>
+ <target chassis="2" port="0x11"/>
+ <address bus="0x00" domain="0x0000" function="0x1" slot="0x02" type="pci"/>
+ </controller>
+ <controller index="3" model="pcie-root-port" type="pci">
+ <model name="pcie-root-port"/>
+ <target chassis="3" port="0x12"/>
+ <address bus="0x00" domain="0x0000" function="0x2" slot="0x02" type="pci"/>
+ </controller>
+ <controller index="4" model="pcie-root-port" type="pci">
+ <model name="pcie-root-port"/>
+ <target chassis="4" port="0x13"/>
+ <address bus="0x00" domain="0x0000" function="0x3" slot="0x02" type="pci"/>
+ </controller>
+ <controller index="5" model="pcie-root-port" type="pci">
+ <model name="pcie-root-port"/>
+ <target chassis="5" port="0x14"/>
+ <address bus="0x00" domain="0x0000" function="0x4" slot="0x02" type="pci"/>
+ </controller>
+ <controller index="6" model="pcie-root-port" type="pci">
+ <model name="pcie-root-port"/>
+ <target chassis="6" port="0x15"/>
+ <address bus="0x00" domain="0x0000" function="0x5" slot="0x02" type="pci"/>
+ </controller>
+ <controller index="0" type="virtio-serial">
+ <address bus="0x02" domain="0x0000" function="0x0" slot="0x00" type="pci"/>
+ </controller>
+ <controller index="0" model="virtio-scsi" type="scsi">
+ <address bus="0x06" domain="0x0000" function="0x0" slot="0x00" type="pci"/>
+ </controller>
+ <controller index="0" type="fdc"/>
+ <interface type="bridge">
+ <mac address="52:54:00:0d:90:0c"/>
+ <source bridge="nat1"/>
+ <model type="virtio"/>
+ <address bus="0x01" domain="0x0000" function="0x0" slot="0x00" type="pci"/>
+ </interface>
+ <serial type="pty">
+ <target port="0" type="isa-serial">
+ <model name="isa-serial"/>
+ </target>
+ </serial>
+ <console type="pty">
+ <target port="0" type="serial"/>
+ </console>
+ <channel type="unix">
+ <target name="org.qemu.guest_agent.0" type="virtio"/>
+ <address bus="0" controller="0" port="1" type="virtio-serial"/>
+ </channel>
+ <channel type="spicevmc">
+ <target name="com.redhat.spice.0" type="virtio"/>
+ <address bus="0" controller="0" port="2" type="virtio-serial"/>
+ </channel>
+ <input bus="usb" type="tablet">
+ <address bus="0" port="1" type="usb"/>
+ </input>
+ <input bus="ps2" type="mouse"/>
+ <input bus="ps2" type="keyboard"/>
+ <graphics autoport="yes" type="spice">
+ <listen type="address"/>
+ <image compression="off"/>
+ </graphics>
+ <sound model="ich9">
+ <address bus="0x00" domain="0x0000" function="0x0" slot="0x1b" type="pci"/>
+ </sound>
+ <video>
+ <model heads="1" primary="yes" ram="65536" type="qxl" vgamem="16384" vram="65536"/>
+ <address bus="0x00" domain="0x0000" function="0x0" slot="0x01" type="pci"/>
+ </video>
+ <redirdev bus="usb" type="spicevmc">
+ <address bus="0" port="2" type="usb"/>
+ </redirdev>
+ <redirdev bus="usb" type="spicevmc">
+ <address bus="0" port="3" type="usb"/>
+ </redirdev>
+ <memballoon model="virtio">
+ <address bus="0x04" domain="0x0000" function="0x0" slot="0x00" type="pci"/>
+ </memballoon>
+ <rng model="virtio">
+ <backend model="random">/dev/urandom</backend>
+ <address bus="0x05" domain="0x0000" function="0x0" slot="0x00" type="pci"/>
+ </rng>
+ </devices>
+</domain>
+
+
diff --git a/src/test/resources/virtualbox/xml/virtualbox_default-ubuntu_transform-non-persistent.vbox b/src/test/resources/virtualbox/xml/virtualbox_default-ubuntu_transform-non-persistent.vbox
new file mode 100644
index 0000000..8ca8cde
--- /dev/null
+++ b/src/test/resources/virtualbox/xml/virtualbox_default-ubuntu_transform-non-persistent.vbox
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?><VirtualBox xmlns="http://www.virtualbox.org/" version="1.16-linux">
+ <Machine OSType="Ubuntu_64" lastStateChange="2021-04-28T09:11:13Z" name="Test" snapshotFolder="%VM_DISK_REDOLOGDIR%" uuid="%VM_MACHINE_UUID%">
+ <MediaRegistry>
+ <HardDisks>
+ <HardDisk format="VDI" location="%VM_DISK_PATH%" type="Normal" uuid="%VM_HDD_UUID_0%"/>
+ </HardDisks>
+ </MediaRegistry>
+ <Hardware uuid="{b36f101a-a45d-41cb-8bd4-3908e75e081b}">
+ <CPU count="%VM_CPU_CORES%">
+ <PAE enabled="false"/>
+ <LongMode enabled="true"/>
+ <X2APIC enabled="true"/>
+ <HardwareVirtExLargePages enabled="false"/>
+ </CPU>
+ <Memory RAMSize="%VM_RAM%"/>
+ <Display VRAMSize="16" controller="VMSVGA"/>
+ <BIOS>
+ <IOAPIC enabled="true"/>
+ <SmbiosUuidLittleEndian enabled="true"/>
+ </BIOS>
+ <USB>
+ <Controllers>
+ <Controller name="OHCI" type="OHCI"/>
+ </Controllers>
+ </USB>
+ <Network>
+ <Adapter MACAddress="%VM_NIC_MAC%" enabled="true" slot="0" type="82540EM">
+ <HostOnlyInterface name="vboxnet1"/>
+ </Adapter>
+ </Network>
+ <AudioAdapter codec="AD1980" driver="Pulse" enabled="true" enabledIn="false"/>
+ <RTC localOrUTC="UTC"/>
+ <Clipboard/>
+ </Hardware>
+ <StorageControllers>
+ <StorageController Bootable="true" PortCount="2" name="IDE" type="PIIX4" useHostIOCache="true"/>
+ <StorageController Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3" PortCount="1" name="SATA" type="AHCI" useHostIOCache="false">
+ <AttachedDevice device="0" hotpluggable="false" port="0" type="HardDisk">
+ <Image uuid="%VM_HDD_UUID_0%"/>
+ </AttachedDevice>
+ </StorageController>
+ </StorageControllers>
+ <ExtraData>
+ <ExtraDataItem name="GUI/LastCloseAction" value="PowerOff"/>
+ <ExtraDataItem name="GUI/RestrictedRuntimeHelpMenuActions" value="All"/>
+ <ExtraDataItem name="GUI/RestrictedRuntimeMachineMenuActions" value="TakeSnapshot,Pause,SaveState"/>
+ <ExtraDataItem name="GUI/RestrictedRuntimeMenus" value="Help"/>
+ <ExtraDataItem name="GUI/PreventSnapshotOperations" value="true"/>
+ <ExtraDataItem name="GUI/PreventApplicationUpdate" value="true"/>
+ <ExtraDataItem name="GUI/RestrictedCloseActions" value="SaveState,PowerOffRestoringSnapshot,Detach"/>
+ </ExtraData>
+ </Machine>
+</VirtualBox>
diff --git a/src/test/resources/vmware/vmx/vmware-player_default-ubuntu_transform-non-persistent.vmx b/src/test/resources/vmware/vmx/vmware-player_default-ubuntu_transform-non-persistent.vmx
new file mode 100644
index 0000000..e62d33a
--- /dev/null
+++ b/src/test/resources/vmware/vmx/vmware-player_default-ubuntu_transform-non-persistent.vmx
@@ -0,0 +1,42 @@
+.encoding = "UTF-8"
+config.version = "8"
+displayName = "Test"
+ehci.present = "TRUE"
+ethernet0.connectionType = "custom"
+ethernet0.present = "TRUE"
+ethernet0.virtualDev = "e1000"
+ethernet0.vnet = "vmnet1"
+guestOS = "ubuntu-64"
+hpet0.present = "TRUE"
+mks.enable3d = "TRUE"
+pciBridge0.present = "TRUE"
+pciBridge4.functions = "8"
+pciBridge4.present = "TRUE"
+pciBridge4.virtualDev = "pcieRootPort"
+pciBridge5.functions = "8"
+pciBridge5.present = "TRUE"
+pciBridge5.virtualDev = "pcieRootPort"
+pciBridge6.functions = "8"
+pciBridge6.present = "TRUE"
+pciBridge6.virtualDev = "pcieRootPort"
+pciBridge7.functions = "8"
+pciBridge7.present = "TRUE"
+pciBridge7.virtualDev = "pcieRootPort"
+sata0:1.deviceType = "cdrom-raw"
+scsi0.present = "TRUE"
+scsi0.virtualDev = "lsilogic"
+scsi0:0.deviceType = "disk"
+scsi0:0.fileName = "%VM_DISK_PATH%"
+scsi0:0.mode = "%VM_DISK_MODE%"
+scsi0:0.present = "TRUE"
+scsi0:0.redo = ""
+scsi0:0.redoLogDir = "%VM_DISK_REDOLOGDIR%"
+sound.autoDetect = "TRUE"
+sound.fileName = "-1"
+sound.present = "TRUE"
+suspend.disabled = "TRUE"
+tools.syncTime = "FALSE"
+usb.present = "TRUE"
+usb.vbluetooth.startConnected = "TRUE"
+virtualHW.productCompatibility = "hosted"
+virtualHW.version = "18"