diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e068d8c2..224b824dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ BUG FIXES: * virtualbox: `boot_wait` defaults to "10s" rather than 0. [GH-44] * virtualbox: if `http_port_min` and max are the same, it will no longer panic [GH-53] +* vmware: `boot_wait` defaults to "10s" rather than 0. [GH-44] * vmware: if `http_port_min` and max are the same, it will no longer panic [GH-53] diff --git a/builder/vmware/builder.go b/builder/vmware/builder.go index c3dc50e9b..00616d28f 100644 --- a/builder/vmware/builder.go +++ b/builder/vmware/builder.go @@ -86,6 +86,10 @@ func (b *Builder) Prepare(raws ...interface{}) error { b.config.HTTPPortMax = 9000 } + if b.config.RawBootWait == "" { + b.config.RawBootWait = "10s" + } + if b.config.VNCPortMin == 0 { b.config.VNCPortMin = 5900 } diff --git a/builder/vmware/builder_test.go b/builder/vmware/builder_test.go index b4c1e6c2d..aab7fe505 100644 --- a/builder/vmware/builder_test.go +++ b/builder/vmware/builder_test.go @@ -28,9 +28,20 @@ func TestBuilderPrepare_BootWait(t *testing.T) { var b Builder config := testConfig() + // Test a default boot_wait + delete(config, "boot_wait") + err := b.Prepare(config) + if err != nil { + t.Fatalf("err: %s", err) + } + + if b.config.RawBootWait != "10s" { + t.Fatalf("bad value: %s", b.config.RawBootWait) + } + // Test with a bad boot_wait config["boot_wait"] = "this is not good" - err := b.Prepare(config) + err = b.Prepare(config) if err == nil { t.Fatal("should have error") }