mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
22 lines
443 B
Go
22 lines
443 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package ssh
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestPasswordKeybardInteractive_Challenge(t *testing.T) {
|
|
p := PasswordKeyboardInteractive("foo")
|
|
result, err := p("foo", "bar", []string{"one", "two"}, nil)
|
|
if err != nil {
|
|
t.Fatalf("err not nil: %s", err)
|
|
}
|
|
|
|
if !reflect.DeepEqual(result, []string{"foo", "foo"}) {
|
|
t.Fatalf("invalid password: %#v", result)
|
|
}
|
|
}
|