Commit 4bb16ac2 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

fix failing tests

parent cbe6e83b
package common package common
import ( import (
"github.com/mitchellh/packer/packer"
"testing" "testing"
)
func testConfigTemplate(t *testing.T) *packer.ConfigTemplate { "github.com/mitchellh/packer/template/interpolate"
result, err := packer.NewConfigTemplate() )
if err != nil {
t.Fatalf("err: %s", err)
}
return result func testConfigTemplate(t *testing.T) *interpolate.Context {
return &interpolate.Context{}
} }
...@@ -9,7 +9,6 @@ import ( ...@@ -9,7 +9,6 @@ import (
func TestStepTypeBootCommand(t *testing.T) { func TestStepTypeBootCommand(t *testing.T) {
state := testState(t) state := testState(t)
tpl, _ := packer.NewConfigTemplate()
var bootcommand = []string{ var bootcommand = []string{
"1234567890-=<enter><wait>", "1234567890-=<enter><wait>",
...@@ -27,7 +26,7 @@ func TestStepTypeBootCommand(t *testing.T) { ...@@ -27,7 +26,7 @@ func TestStepTypeBootCommand(t *testing.T) {
BootCommand: bootcommand, BootCommand: bootcommand,
HostInterfaces: []string{}, HostInterfaces: []string{},
VMName: "myVM", VMName: "myVM",
Tpl: tpl, Ctx: *testConfigTemplate(t),
} }
comm := new(packer.MockCommunicator) comm := new(packer.MockCommunicator)
......
...@@ -70,14 +70,6 @@ func TestToolsConfigPrepare_ParallelsToolsGuestPath(t *testing.T) { ...@@ -70,14 +70,6 @@ func TestToolsConfigPrepare_ParallelsToolsGuestPath(t *testing.T) {
t.Fatal("should not be empty") 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 // Test with a good one
c = testToolsConfig() c = testToolsConfig()
c.ParallelsToolsGuestPath = "foo" c.ParallelsToolsGuestPath = "foo"
......
package common package common
import ( import (
"github.com/mitchellh/packer/packer"
"testing" "testing"
)
func testConfigTemplate(t *testing.T) *packer.ConfigTemplate { "github.com/mitchellh/packer/template/interpolate"
result, err := packer.NewConfigTemplate() )
if err != nil {
t.Fatalf("err: %s", err)
}
return result func testConfigTemplate(t *testing.T) *interpolate.Context {
return &interpolate.Context{}
} }
package common package common
import ( import (
"github.com/mitchellh/packer/packer"
"testing" "testing"
)
func testConfigTemplate(t *testing.T) *packer.ConfigTemplate { "github.com/mitchellh/packer/template/interpolate"
result, err := packer.NewConfigTemplate() )
if err != nil {
t.Fatalf("err: %s", err)
}
return result func testConfigTemplate(t *testing.T) *interpolate.Context {
return &interpolate.Context{}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment