From e7390f30b95daf90c0f32e8cf963dce3f8d5cf9d Mon Sep 17 00:00:00 2001 From: Ashley Cui Date: Thu, 21 Apr 2022 09:09:49 -0400 Subject: 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 --- pkg/machine/qemu/machine_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pkg/machine/qemu/machine_test.go (limited to 'pkg/machine/qemu/machine_test.go') 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"}) +} -- cgit v1.2.3-54-g00ecf