From 4bb16ac22361efeb96adf8ecadcbab83862fb1ae Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 27 May 2015 14:30:59 -0700 Subject: [PATCH] fix failing tests --- builder/parallels/common/config_test.go | 12 ++++-------- .../parallels/common/step_type_boot_command_test.go | 3 +-- builder/parallels/common/tools_config_test.go | 8 -------- builder/virtualbox/common/config_test.go | 12 ++++-------- builder/vmware/common/config_test.go | 12 ++++-------- 5 files changed, 13 insertions(+), 34 deletions(-) diff --git a/builder/parallels/common/config_test.go b/builder/parallels/common/config_test.go index a84c51bc1..eeeda864a 100644 --- a/builder/parallels/common/config_test.go +++ b/builder/parallels/common/config_test.go @@ -1,15 +1,11 @@ package common import ( - "github.com/mitchellh/packer/packer" "testing" -) -func testConfigTemplate(t *testing.T) *packer.ConfigTemplate { - result, err := packer.NewConfigTemplate() - if err != nil { - t.Fatalf("err: %s", err) - } + "github.com/mitchellh/packer/template/interpolate" +) - return result +func testConfigTemplate(t *testing.T) *interpolate.Context { + return &interpolate.Context{} } diff --git a/builder/parallels/common/step_type_boot_command_test.go b/builder/parallels/common/step_type_boot_command_test.go index 6dbbe9e1c..2570e7fbe 100644 --- a/builder/parallels/common/step_type_boot_command_test.go +++ b/builder/parallels/common/step_type_boot_command_test.go @@ -9,7 +9,6 @@ import ( func TestStepTypeBootCommand(t *testing.T) { state := testState(t) - tpl, _ := packer.NewConfigTemplate() var bootcommand = []string{ "1234567890-=", @@ -27,7 +26,7 @@ func TestStepTypeBootCommand(t *testing.T) { BootCommand: bootcommand, HostInterfaces: []string{}, VMName: "myVM", - Tpl: tpl, + Ctx: *testConfigTemplate(t), } comm := new(packer.MockCommunicator) diff --git a/builder/parallels/common/tools_config_test.go b/builder/parallels/common/tools_config_test.go index 5f5a8a35d..8755ec090 100644 --- a/builder/parallels/common/tools_config_test.go +++ b/builder/parallels/common/tools_config_test.go @@ -70,14 +70,6 @@ func TestToolsConfigPrepare_ParallelsToolsGuestPath(t *testing.T) { t.Fatal("should not be empty") } - // Test with a bad value - c = testToolsConfig() - c.ParallelsToolsGuestPath = "{{{nope}" - errs = c.Prepare(testConfigTemplate(t)) - if len(errs) == 0 { - t.Fatal("should have error") - } - // Test with a good one c = testToolsConfig() c.ParallelsToolsGuestPath = "foo" diff --git a/builder/virtualbox/common/config_test.go b/builder/virtualbox/common/config_test.go index a84c51bc1..eeeda864a 100644 --- a/builder/virtualbox/common/config_test.go +++ b/builder/virtualbox/common/config_test.go @@ -1,15 +1,11 @@ package common import ( - "github.com/mitchellh/packer/packer" "testing" -) -func testConfigTemplate(t *testing.T) *packer.ConfigTemplate { - result, err := packer.NewConfigTemplate() - if err != nil { - t.Fatalf("err: %s", err) - } + "github.com/mitchellh/packer/template/interpolate" +) - return result +func testConfigTemplate(t *testing.T) *interpolate.Context { + return &interpolate.Context{} } diff --git a/builder/vmware/common/config_test.go b/builder/vmware/common/config_test.go index a84c51bc1..eeeda864a 100644 --- a/builder/vmware/common/config_test.go +++ b/builder/vmware/common/config_test.go @@ -1,15 +1,11 @@ package common import ( - "github.com/mitchellh/packer/packer" "testing" -) -func testConfigTemplate(t *testing.T) *packer.ConfigTemplate { - result, err := packer.NewConfigTemplate() - if err != nil { - t.Fatalf("err: %s", err) - } + "github.com/mitchellh/packer/template/interpolate" +) - return result +func testConfigTemplate(t *testing.T) *interpolate.Context { + return &interpolate.Context{} }