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
pull/6424/head
DanHam 8 years ago
parent eee16262b6
commit 0d9134bdbc
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E

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

Loading…
Cancel
Save