summaryrefslogtreecommitdiff
path: root/pkg/machine/qemu/machine_test.go
diff options
context:
space:
mode:
authorAshley Cui <acui@redhat.com>2022-04-21 09:09:49 -0400
committerAshley Cui <acui@redhat.com>2022-04-27 13:56:14 -0400
commite7390f30b95daf90c0f32e8cf963dce3f8d5cf9d (patch)
treec0b962e598a1643f6f91cfd365c04cf0dc2a2d86 /pkg/machine/qemu/machine_test.go
parent5ac00a7287e4a9e6292f4a6ca5dfa9a02e5ca907 (diff)
downloadpodman-e7390f30b95daf90c0f32e8cf963dce3f8d5cf9d.tar.gz
podman-e7390f30b95daf90c0f32e8cf963dce3f8d5cf9d.tar.bz2
podman-e7390f30b95daf90c0f32e8cf963dce3f8d5cf9d.zip
Allow changing of CPUs, Memory, and Disk Size
Allow podman machine set to change CPUs, Memory and Disk size of a QEMU machine after its been created. Disk size can only be increased. If one setting fails to be changed, the other settings will still be applied. Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'pkg/machine/qemu/machine_test.go')
-rw-r--r--pkg/machine/qemu/machine_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/machine/qemu/machine_test.go b/pkg/machine/qemu/machine_test.go
new file mode 100644
index 000000000..62ca6068a
--- /dev/null
+++ b/pkg/machine/qemu/machine_test.go
@@ -0,0 +1,17 @@
+package qemu
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestEditCmd(t *testing.T) {
+ vm := new(MachineVM)
+ vm.CmdLine = []string{"command", "-flag", "value"}
+
+ vm.editCmdLine("-flag", "newvalue")
+ vm.editCmdLine("-anotherflag", "anothervalue")
+
+ require.Equal(t, vm.CmdLine, []string{"command", "-flag", "newvalue", "-anotherflag", "anothervalue"})
+}