add test to repro #10975

This commit is contained in:
Adrien Delorme 2021-04-26 17:31:22 +02:00
parent 4ebc09f08f
commit e60a7e60b9
2 changed files with 14 additions and 0 deletions

View File

@ -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?"]
}
}

View File

@ -22,6 +22,8 @@ func TestValidateCommand(t *testing.T) {
{path: filepath.Join(testFixture("validate"), "null_var.json"), exitCode: 1}, {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: 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 // wrong version fails
{path: filepath.Join(testFixture("version_req", "base_failure")), exitCode: 1}, {path: filepath.Join(testFixture("version_req", "base_failure")), exitCode: 1},
{path: filepath.Join(testFixture("version_req", "base_success")), exitCode: 0}, {path: filepath.Join(testFixture("version_req", "base_success")), exitCode: 0},