2013-12-26 17:14:19 -05:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2019-06-14 04:55:10 -04:00
|
|
|
|
2020-11-11 13:21:37 -05:00
|
|
|
"github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate"
|
2013-12-26 17:14:19 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestVMXConfigPrepare(t *testing.T) {
|
|
|
|
c := new(VMXConfig)
|
|
|
|
c.VMXData = map[string]string{
|
|
|
|
"one": "foo",
|
|
|
|
"two": "bar",
|
|
|
|
}
|
|
|
|
|
2019-06-14 04:55:10 -04:00
|
|
|
errs := c.Prepare(interpolate.NewContext())
|
2013-12-26 17:14:19 -05:00
|
|
|
if len(errs) > 0 {
|
|
|
|
t.Fatalf("bad: %#v", errs)
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(c.VMXData) != 2 {
|
|
|
|
t.Fatal("should have two items in VMXData")
|
|
|
|
}
|
|
|
|
}
|