builder/vmware: tests for vnc_port_* settings
This commit is contained in:
parent
7a5dce0dc9
commit
16295dfbf3
2
TODO.md
2
TODO.md
|
@ -1,7 +1,7 @@
|
|||
* builder/amazonebs: Copy AMI to multiple regions
|
||||
* builder/amazonebs: Add unique ID to AMI name so multiple can be made
|
||||
* 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 key/values
|
||||
* communicator/ssh: Ability to re-establish connection
|
||||
|
|
|
@ -137,3 +137,31 @@ func TestBuilderPrepare_SSHWaitTimeout(t *testing.T) {
|
|||
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue