Add test: We shouldn't error when main remote options are unset
This commit is contained in:
parent
efcdf60d96
commit
939aa7e289
|
@ -168,6 +168,20 @@ func TestBuilderPrepare_RemoteType(t *testing.T) {
|
|||
t.Fatal("should have error")
|
||||
}
|
||||
|
||||
// Good
|
||||
config["remote_type"] = ""
|
||||
config["remote_host"] = ""
|
||||
config["remote_password"] = ""
|
||||
config["remote_private_key_file"] = ""
|
||||
b = Builder{}
|
||||
warns, err = b.Prepare(config)
|
||||
if len(warns) > 0 {
|
||||
t.Fatalf("bad: %#v", warns)
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatalf("should not have error: %s", err)
|
||||
}
|
||||
|
||||
// Good
|
||||
config["remote_type"] = "esx5"
|
||||
config["remote_host"] = "foobar.example.com"
|
||||
|
|
Loading…
Reference in New Issue