mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-09 08:42:33 -04:00
packer_test: added shell provisioner test with empty inline list
This commit is contained in:
parent
d3988669ea
commit
7a5fc2525a
2 changed files with 27 additions and 0 deletions
|
|
@ -80,3 +80,18 @@ func (ts *PackerShellProvisionerTestSuite) TestInvalidShebangAsOption() {
|
|||
SetArgs("build", "templates/shebang_as_option_invalid.pkr.hcl").
|
||||
Assert(check.MustFail())
|
||||
}
|
||||
|
||||
func (ts *PackerShellProvisionerTestSuite) TestEmptyInlineCommands() {
|
||||
dir := ts.MakePluginDir()
|
||||
defer dir.Cleanup()
|
||||
|
||||
ts.PackerCommand().UsePluginDir(dir).
|
||||
SetArgs("plugins", "install", "github.com/hashicorp/docker").
|
||||
Assert(check.MustSucceed())
|
||||
|
||||
ts.PackerCommand().UsePluginDir(dir).
|
||||
AddEnv("HOME", os.Getenv("HOME")).
|
||||
AddEnv("PATH", os.Getenv("PATH")).
|
||||
SetArgs("build", "templates/empty_inline_list.pkr.hcl").
|
||||
Assert(check.MustFail())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
source "docker" "test" {
|
||||
image = "debian:bookworm"
|
||||
discard = true
|
||||
}
|
||||
|
||||
build {
|
||||
sources = ["docker.test"]
|
||||
|
||||
provisioner "shell" {
|
||||
inline = []
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue