add ssh override test
This commit is contained in:
parent
bac9c74447
commit
4cd3429914
|
@ -0,0 +1,28 @@
|
||||||
|
package common
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/hashicorp/packer/helper/communicator"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCommHost(t *testing.T) {
|
||||||
|
state := testState(t)
|
||||||
|
config := SSHConfig{
|
||||||
|
Comm: communicator.Config{
|
||||||
|
SSH: communicator.SSH{
|
||||||
|
SSHHost: "127.0.0.1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
hostFunc := CommHost(&config)
|
||||||
|
out, err := hostFunc(state)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Should not have had an error")
|
||||||
|
}
|
||||||
|
|
||||||
|
if out != "127.0.0.1" {
|
||||||
|
t.Fatalf("Should have respected ssh override.")
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue