Add test: We shouldn't error when main remote options are unset

This commit is contained in:
DanHam 2018-07-02 18:07:05 +01:00
parent efcdf60d96
commit 939aa7e289
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 14 additions and 0 deletions

View File

@ -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"