From c721acf082a720ea6ccdf6bc4726215754239237 Mon Sep 17 00:00:00 2001 From: cdoern Date: Tue, 12 Apr 2022 22:21:33 -0400 Subject: podman machine starting test add a test to make sure machines are not running while still starting in order to do this, I added a parameter to `run()` to delineate whether or not the command should block or not. The non blocking run allows for tests to get and use the `machineSession` pointer and check the exit code to see if it has finished. also fix a bug (created by #13996) that before started, the machines would always say "LastUp" and "Created" Less than one second ago Signed-off-by: cdoern --- pkg/machine/qemu/machine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/machine/qemu') diff --git a/pkg/machine/qemu/machine.go b/pkg/machine/qemu/machine.go index 969acb760..78c621111 100644 --- a/pkg/machine/qemu/machine.go +++ b/pkg/machine/qemu/machine.go @@ -1065,11 +1065,11 @@ func getVMInfos() ([]*machine.ListResponse, error) { return err } - if !vm.LastUp.IsZero() { + if !vm.LastUp.IsZero() { // this means we have already written a time to the config listEntry.LastUp = vm.LastUp - } else { + } else { // else we just created the machine AKA last up = created time listEntry.LastUp = vm.Created - vm.Created = time.Now() + vm.LastUp = listEntry.LastUp if err := vm.writeConfig(); err != nil { return err } -- cgit v1.2.3-54-g00ecf