test unknown variables and locals
This commit is contained in:
parent
652878059c
commit
161879b98a
|
@ -15,6 +15,33 @@ func Test_commands(t *testing.T) {
|
|||
env []string
|
||||
expected string
|
||||
}{
|
||||
{[]string{"inspect", filepath.Join(testFixture("var-arg"), "fruit_builder.pkr.hcl")}, nil, `Packer Inspect: HCL2 mode
|
||||
|
||||
> input-variables:
|
||||
|
||||
var.fruit: "<unknown>"
|
||||
|
||||
> local-variables:
|
||||
|
||||
local.fruit: "<unknown>"
|
||||
|
||||
> builds:
|
||||
|
||||
> <unnamed build 0>:
|
||||
|
||||
sources:
|
||||
|
||||
null.builder
|
||||
|
||||
provisioners:
|
||||
|
||||
shell-local
|
||||
|
||||
post-processors:
|
||||
|
||||
<no post-processor>
|
||||
|
||||
`},
|
||||
{[]string{"inspect", "-var=fruit=banana", filepath.Join(testFixture("var-arg"), "fruit_builder.pkr.hcl")}, nil, `Packer Inspect: HCL2 mode
|
||||
|
||||
> input-variables:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"variables": {
|
||||
"fruit": ""
|
||||
"fruit": null
|
||||
},
|
||||
"builders": [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue