builder/vmware: tests for vnc_port_* settings

This commit is contained in:
Mitchell Hashimoto 2013-06-07 15:11:13 -07:00
parent 7a5dce0dc9
commit 16295dfbf3
2 changed files with 29 additions and 1 deletions

View File

@ -1,7 +1,7 @@
* builder/amazonebs: Copy AMI to multiple regions * builder/amazonebs: Copy AMI to multiple regions
* builder/amazonebs: Add unique ID to AMI name so multiple can be made * builder/amazonebs: Add unique ID to AMI name so multiple can be made
* builder/vmware: Downloading the ISO * builder/vmware: Downloading the ISO
* builder/vmware: Find open port for HTTP/VNC * builder/vmware: Find open port for HTTP
* builder/vmware: VMX templates * builder/vmware: VMX templates
* builder/vmware: VMX key/values * builder/vmware: VMX key/values
* communicator/ssh: Ability to re-establish connection * communicator/ssh: Ability to re-establish connection

View File

@ -137,3 +137,31 @@ func TestBuilderPrepare_SSHWaitTimeout(t *testing.T) {
t.Fatalf("should not have error: %s", err) t.Fatalf("should not have error: %s", err)
} }
} }
func TestBuilderPrepare_VNCPort(t *testing.T) {
var b Builder
config := testConfig()
// Bad
config["vnc_port_min"] = 1000
config["vnc_port_max"] = 500
err := b.Prepare(config)
if err == nil {
t.Fatal("should have error")
}
// Bad
config["vnc_port_min"] = -500
err = b.Prepare(config)
if err == nil {
t.Fatal("should have error")
}
// Good
config["vnc_port_min"] = 500
config["vnc_port_max"] = 1000
err = b.Prepare(config)
if err != nil {
t.Fatalf("should not have error: %s", err)
}
}