github.com/graywolf-at-work-2/terraform-vendor@v1.4.5/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  }