From 0d9134bdbce5685b458af5f42850a5f53616ca30 Mon Sep 17 00:00:00 2001 From: DanHam Date: Fri, 8 Jun 2018 11:29:10 +0100 Subject: [PATCH] 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 --- builder/vmware/iso/builder_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builder/vmware/iso/builder_test.go b/builder/vmware/iso/builder_test.go index 4b191b2a8..067e0483b 100644 --- a/builder/vmware/iso/builder_test.go +++ b/builder/vmware/iso/builder_test.go @@ -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 {