github.com/turbot/go-exec-communicator@v0.0.0-20230412124734-9374347749b6/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 }