30 lines
529 B
Go
30 lines
529 B
Go
package hcl2template
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/packer/packer"
|
|
)
|
|
|
|
func TestParse_variables(t *testing.T) {
|
|
defaultParser := getBasicParser()
|
|
|
|
tests := []parseTest{
|
|
{"basic variables",
|
|
defaultParser,
|
|
parseTestArgs{"testdata/variables/basic.pkr.hcl"},
|
|
&PackerConfig{
|
|
Variables: PackerV1Variables{
|
|
"image_name": "foo-image-{{user `my_secret`}}",
|
|
"key": "value",
|
|
"my_secret": "foo",
|
|
},
|
|
},
|
|
false, false,
|
|
[]packer.Build{},
|
|
false,
|
|
},
|
|
}
|
|
testParse(t, tests)
|
|
}
|