github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/not-internal/communicator/ssh/password_test.go (about) 1 package ssh 2 3 import ( 4 "reflect" 5 "testing" 6 ) 7 8 func TestPasswordKeybardInteractive_Challenge(t *testing.T) { 9 p := PasswordKeyboardInteractive("foo") 10 result, err := p("foo", "bar", []string{"one", "two"}, nil) 11 if err != nil { 12 t.Fatalf("err not nil: %s", err) 13 } 14 15 if !reflect.DeepEqual(result, []string{"foo", "foo"}) { 16 t.Fatalf("invalid password: %#v", result) 17 } 18 }