From e60a7e60b93b159ff06ffbdc9203a3b78367ec16 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 26 Apr 2021 17:31:22 +0200 Subject: [PATCH] add test to repro #10975 --- .../hcl/validation/wrong_pause_before.pkr.hcl | 12 ++++++++++++ command/validate_test.go | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 command/test-fixtures/hcl/validation/wrong_pause_before.pkr.hcl diff --git a/command/test-fixtures/hcl/validation/wrong_pause_before.pkr.hcl b/command/test-fixtures/hcl/validation/wrong_pause_before.pkr.hcl new file mode 100644 index 000000000..a30aa55c2 --- /dev/null +++ b/command/test-fixtures/hcl/validation/wrong_pause_before.pkr.hcl @@ -0,0 +1,12 @@ +source "null" "example1" { + communicator = "none" +} + +build { + sources = ["source.null.example1"] + + provisioner "shell-local" { + pause_before = "5" + inline = ["echo Did I wait a bit?"] + } +} diff --git a/command/validate_test.go b/command/validate_test.go index 1644f4395..6c05c5297 100644 --- a/command/validate_test.go +++ b/command/validate_test.go @@ -22,6 +22,8 @@ func TestValidateCommand(t *testing.T) { {path: filepath.Join(testFixture("validate"), "null_var.json"), exitCode: 1}, {path: filepath.Join(testFixture("validate"), "var_foo_with_no_default.pkr.hcl"), exitCode: 1}, + {path: testFixture("hcl", "validation", "wrong_pause_before.pkr.hcl"), exitCode: 1}, + // wrong version fails {path: filepath.Join(testFixture("version_req", "base_failure")), exitCode: 1}, {path: filepath.Join(testFixture("version_req", "base_success")), exitCode: 0},