Commit e7747b3e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: default boot_wait

parent 7f458df5
......@@ -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]
......
......@@ -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
}
......
......@@ -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")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment