mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com> Signed-off-by: Christian Mesh <christianmesh1@gmail.com> Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
24 lines
523 B
Go
24 lines
523 B
Go
// Copyright (c) The OpenTofu Authors
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package ssh
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestPasswordKeyboardInteractive_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)
|
|
}
|
|
}
|