builder/vmware: default boot_wait
This commit is contained in:
parent
7f458df54e
commit
e7747b3ef4
|
@ -8,6 +8,7 @@ BUG FIXES:
|
||||||
* virtualbox: `boot_wait` defaults to "10s" rather than 0. [GH-44]
|
* 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
|
* virtualbox: if `http_port_min` and max are the same, it will no longer
|
||||||
panic [GH-53]
|
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
|
* vmware: if `http_port_min` and max are the same, it will no longer
|
||||||
panic [GH-53]
|
panic [GH-53]
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
|
||||||
b.config.HTTPPortMax = 9000
|
b.config.HTTPPortMax = 9000
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if b.config.RawBootWait == "" {
|
||||||
|
b.config.RawBootWait = "10s"
|
||||||
|
}
|
||||||
|
|
||||||
if b.config.VNCPortMin == 0 {
|
if b.config.VNCPortMin == 0 {
|
||||||
b.config.VNCPortMin = 5900
|
b.config.VNCPortMin = 5900
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,20 @@ func TestBuilderPrepare_BootWait(t *testing.T) {
|
||||||
var b Builder
|
var b Builder
|
||||||
config := testConfig()
|
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
|
// Test with a bad boot_wait
|
||||||
config["boot_wait"] = "this is not good"
|
config["boot_wait"] = "this is not good"
|
||||||
err := b.Prepare(config)
|
err = b.Prepare(config)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("should have error")
|
t.Fatal("should have error")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue