diff options
author | Ashley Cui <acui@redhat.com> | 2022-04-21 09:09:49 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-05-03 13:30:19 -0400 |
commit | 3226561cf3960d76aa633daf134dbfc3ec9e7fa6 (patch) | |
tree | ac5e4f5bc63f220ea0ea269c5e909dab8a910b90 /pkg/machine/qemu/machine_test.go | |
parent | 3af1396f269463aa7640e9cf1dcc84a413d99ee0 (diff) | |
download | podman-3226561cf3960d76aa633daf134dbfc3ec9e7fa6.tar.gz podman-3226561cf3960d76aa633daf134dbfc3ec9e7fa6.tar.bz2 podman-3226561cf3960d76aa633daf134dbfc3ec9e7fa6.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.go | 17 |
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"}) +} |