Add invalid host test

This commit is contained in:
Fábio Matavelli 2020-02-12 10:07:17 +00:00
parent 18f72b1cb7
commit 48c187efe8
1 changed files with 19 additions and 0 deletions

View File

@ -149,6 +149,25 @@ func TestNew_Invalid(t *testing.T) {
}
}
func TestNew_InvalidHost(t *testing.T) {
r := &terraform.InstanceState{
Ephemeral: terraform.EphemeralState{
ConnInfo: map[string]string{
"type": "ssh",
"user": "user",
"password": "i-am-invalid",
"port": "22",
"timeout": "30s",
},
},
}
_, err := New(r)
if err == nil {
t.Fatal("should have had an error creating communicator")
}
}
func TestStart(t *testing.T) {
address := newMockLineServer(t, nil, testClientPublicKey)
parts := strings.Split(address, ":")