summaryrefslogtreecommitdiff
path: root/pkg/machine/qemu/machine.go
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2022-04-12 22:21:33 -0400
committercdoern <cbdoer23@g.holycross.edu>2022-04-27 20:12:43 -0400
commitc721acf082a720ea6ccdf6bc4726215754239237 (patch)
tree21a661db172d728640c29b4e584eb7322c25e921 /pkg/machine/qemu/machine.go
parent5ac00a7287e4a9e6292f4a6ca5dfa9a02e5ca907 (diff)
downloadpodman-c721acf082a720ea6ccdf6bc4726215754239237.tar.gz
podman-c721acf082a720ea6ccdf6bc4726215754239237.tar.bz2
podman-c721acf082a720ea6ccdf6bc4726215754239237.zip
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 <cbdoer23@g.holycross.edu>
Diffstat (limited to 'pkg/machine/qemu/machine.go')
-rw-r--r--pkg/machine/qemu/machine.go6
1 files changed, 3 insertions, 3 deletions
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
}