blob: 91eaf121ccde849c256e73ff4ffc18e9a981cac9 [file] [log] [blame] [edit]
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package server
import (
"net"
"path/filepath"
"testing"
"github.com/hashicorp/vault/internalshared/configutil"
"github.com/mitchellh/cli"
)
func TestUnixListener(t *testing.T) {
ln, _, _, err := unixListenerFactory(&configutil.Listener{
Address: filepath.Join(t.TempDir(), "/vault.sock"),
}, nil, cli.NewMockUi())
if err != nil {
t.Fatalf("err: %s", err)
}
connFn := func(lnReal net.Listener) (net.Conn, error) {
return net.Dial("unix", ln.Addr().String())
}
testListenerImpl(t, ln, connFn, "", 0, "", false)
}