Few small fixes to make the last tests also pass
The reason why the shebang is removed from these tests, is because the shebang is only needed for SSH/Linux connections. So in the new setup the shebang line is added in the SSH communicator instead of in the resource provisioner itself…
This commit is contained in:
parent
c9e9e374bb
commit
b1c6a3f63f
|
@ -41,6 +41,11 @@ func TestResourceProvider_Validate_bad(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var expectedScriptOut = `cd /tmp
|
||||||
|
wget http://foobar
|
||||||
|
exit 0
|
||||||
|
`
|
||||||
|
|
||||||
func TestResourceProvider_generateScript(t *testing.T) {
|
func TestResourceProvider_generateScript(t *testing.T) {
|
||||||
p := new(ResourceProvisioner)
|
p := new(ResourceProvisioner)
|
||||||
conf := testConfig(t, map[string]interface{}{
|
conf := testConfig(t, map[string]interface{}{
|
||||||
|
@ -60,12 +65,6 @@ func TestResourceProvider_generateScript(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var expectedScriptOut = `#!/bin/sh
|
|
||||||
cd /tmp
|
|
||||||
wget http://foobar
|
|
||||||
exit 0
|
|
||||||
`
|
|
||||||
|
|
||||||
func TestResourceProvider_CollectScripts_inline(t *testing.T) {
|
func TestResourceProvider_CollectScripts_inline(t *testing.T) {
|
||||||
p := new(ResourceProvisioner)
|
p := new(ResourceProvisioner)
|
||||||
conf := testConfig(t, map[string]interface{}{
|
conf := testConfig(t, map[string]interface{}{
|
||||||
|
@ -91,8 +90,8 @@ func TestResourceProvider_CollectScripts_inline(t *testing.T) {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(out.Bytes()) != expectedScriptOut {
|
if out.String() != expectedScriptOut {
|
||||||
t.Fatalf("bad: %v", out.Bytes())
|
t.Fatalf("bad: %v", out.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,8 +116,8 @@ func TestResourceProvider_CollectScripts_script(t *testing.T) {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(out.Bytes()) != expectedScriptOut {
|
if out.String() != expectedScriptOut {
|
||||||
t.Fatalf("bad: %v", out.Bytes())
|
t.Fatalf("bad: %v", out.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,8 +147,8 @@ func TestResourceProvider_CollectScripts_scripts(t *testing.T) {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(out.Bytes()) != expectedScriptOut {
|
if out.String() != expectedScriptOut {
|
||||||
t.Fatalf("bad: %v", out.Bytes())
|
t.Fatalf("bad: %v", out.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#!/bin/sh
|
|
||||||
cd /tmp
|
cd /tmp
|
||||||
wget http://foobar
|
wget http://foobar
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue