diff --git a/command/build_test.go b/command/build_test.go index 18158173a..7e38221aa 100644 --- a/command/build_test.go +++ b/command/build_test.go @@ -426,6 +426,14 @@ func TestBuild(t *testing.T) { }, }, }, + + { + name: "hcl - test crash #11381", + args: []string{ + testFixture("hcl", "nil-component-crash.pkr.hcl"), + }, + expectedCode: 1, + }, } for _, tt := range tc { diff --git a/command/test-fixtures/hcl/nil-component-crash.pkr.hcl b/command/test-fixtures/hcl/nil-component-crash.pkr.hcl new file mode 100644 index 000000000..a19439649 --- /dev/null +++ b/command/test-fixtures/hcl/nil-component-crash.pkr.hcl @@ -0,0 +1,10 @@ +source "null" "basic-example" { +} + +build { + sources = ["sources.null.basic-example"] + + provisioner "foo" { + timeout = "10" + } +}