Fix existing tests as they were not doing what they should have been

* Fix test to check for remote_host when remote_type is set
* Fix tests by including remote_password where required
This commit is contained in:
DanHam 2018-06-08 11:29:10 +01:00
parent eee16262b6
commit 0d9134bdbc
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 5 additions and 2 deletions

View File

@ -145,6 +145,7 @@ func TestBuilderPrepare_RemoteType(t *testing.T) {
config["format"] = "ovf"
config["remote_host"] = "foobar.example.com"
config["remote_password"] = "supersecret"
// Bad
config["remote_type"] = "foobar"
warns, err := b.Prepare(config)
@ -155,9 +156,10 @@ func TestBuilderPrepare_RemoteType(t *testing.T) {
t.Fatal("should have error")
}
config["remote_host"] = ""
config["remote_type"] = ""
config["remote_type"] = "esx5"
// Bad
config["remote_host"] = ""
b = Builder{}
warns, err = b.Prepare(config)
if len(warns) > 0 {
t.Fatalf("bad: %#v", warns)
@ -169,6 +171,7 @@ func TestBuilderPrepare_RemoteType(t *testing.T) {
// Good
config["remote_type"] = "esx5"
config["remote_host"] = "foobar.example.com"
config["remote_password"] = "supersecret"
b = Builder{}
warns, err = b.Prepare(config)
if len(warns) > 0 {