mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-10 17:20:26 -04:00
provisioner: deleted outdated inline unit tests
This commit is contained in:
parent
ee74751181
commit
dfa0a4e8bb
1 changed files with 0 additions and 44 deletions
|
|
@ -98,50 +98,6 @@ func TestProvisionerPrepare_InlineShebang(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestProvisionerPrepare_ShebangWithinInline(t *testing.T) {
|
||||
config := testConfig()
|
||||
script := `#!/bin/bash
|
||||
echo "Hello, World!"
|
||||
`
|
||||
config["inline"] = []interface{}{script, "foo", "bar"}
|
||||
|
||||
p := new(Provisioner)
|
||||
err := p.Prepare(config)
|
||||
if err != nil {
|
||||
t.Fatalf("should not have error: %s", err)
|
||||
}
|
||||
|
||||
if p.config.InlineShebang != "/bin/bash" {
|
||||
t.Fatalf("bad value: %s", p.config.InlineShebang)
|
||||
}
|
||||
|
||||
// Test with InlineShebang, it should override the shebang in the script
|
||||
config["inline_shebang"] = "foo"
|
||||
p = new(Provisioner)
|
||||
err = p.Prepare(config)
|
||||
if err != nil {
|
||||
t.Fatalf("should not have error: %s", err)
|
||||
}
|
||||
|
||||
if p.config.InlineShebang != "foo" {
|
||||
t.Fatalf("bad value: %s", p.config.InlineShebang)
|
||||
}
|
||||
|
||||
// Test with a inline that does not have a shebang
|
||||
config["inline"] = []interface{}{"foo", "bar"}
|
||||
delete(config, "inline_shebang")
|
||||
p = new(Provisioner)
|
||||
err = p.Prepare(config)
|
||||
if err != nil {
|
||||
t.Fatalf("should not have error: %s", err)
|
||||
}
|
||||
|
||||
if p.config.InlineShebang != "/bin/sh -e" {
|
||||
t.Fatalf("bad value: %s", p.config.InlineShebang)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestProvisionerPrepare_InvalidKey(t *testing.T) {
|
||||
var p Provisioner
|
||||
config := testConfig()
|
||||
|
|
|
|||
Loading…
Reference in a new issue