diff options
author | Manuel Bentele | 2021-11-16 08:43:18 +0100 |
---|---|---|
committer | Manuel Bentele | 2021-11-16 08:43:18 +0100 |
commit | 0d172ab55c6eb9a235870d8f98d619078bb91078 (patch) | |
tree | 20c1cb9b97d35e5846d8b2793c2af6519f38c771 /src/test/java/org/openslx | |
parent | Merge branch 'feature/docker-data-container' (diff) | |
download | master-sync-shared-0d172ab55c6eb9a235870d8f98d619078bb91078.tar.gz master-sync-shared-0d172ab55c6eb9a235870d8f98d619078bb91078.tar.xz master-sync-shared-0d172ab55c6eb9a235870d8f98d619078bb91078.zip |
Add CPU topology functionality for Libvirt domain XML configs
Diffstat (limited to 'src/test/java/org/openslx')
-rw-r--r-- | src/test/java/org/openslx/libvirt/domain/DomainTest.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/test/java/org/openslx/libvirt/domain/DomainTest.java b/src/test/java/org/openslx/libvirt/domain/DomainTest.java index 6b53125..00bf83b 100644 --- a/src/test/java/org/openslx/libvirt/domain/DomainTest.java +++ b/src/test/java/org/openslx/libvirt/domain/DomainTest.java @@ -323,6 +323,74 @@ public class DomainTest } @Test + @DisplayName( "Get VM CPU dies from libvirt XML file" ) + public void testGetCpuDies() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + assertEquals( 2, vm.getCpuDies() ); + } + + @Test + @DisplayName( "Set VM CPU dies in libvirt XML file" ) + public void testSetCpuDies() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + vm.setCpuDies( 3 ); + assertEquals( 3, vm.getCpuDies() ); + } + + @Test + @DisplayName( "Get VM CPU sockets from libvirt XML file" ) + public void testGetCpuSockets() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + assertEquals( 3, vm.getCpuSockets() ); + } + + @Test + @DisplayName( "Set VM CPU sockets in libvirt XML file" ) + public void testSetCpuSockets() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + vm.setCpuSockets( 2 ); + assertEquals( 2, vm.getCpuSockets() ); + } + + @Test + @DisplayName( "Get VM CPU cores from libvirt XML file" ) + public void testGetCpuCores() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + assertEquals( 4, vm.getCpuCores() ); + } + + @Test + @DisplayName( "Set VM CPU cores in libvirt XML file" ) + public void testSetCpuCores() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + vm.setCpuCores( 8 ); + assertEquals( 8, vm.getCpuCores() ); + } + + @Test + @DisplayName( "Get VM CPU threads from libvirt XML file" ) + public void testGetCpuThreads() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + assertEquals( 1, vm.getCpuThreads() ); + } + + @Test + @DisplayName( "Set VM CPU threads in libvirt XML file" ) + public void testSetCpuThreads() + { + Domain vm = this.newDomainInstance( "qemu-kvm_default-ubuntu-20-04-vm_cpu-topology.xml" ); + vm.setCpuThreads( 2 ); + assertEquals( 2, vm.getCpuThreads() ); + } + + @Test @DisplayName( "Get VM emulator binary from libvirt XML file" ) public void testGetDevicesEmulator() { |