open-vault/physical/file_test.go
Sean Chittenden aeea7628d6 Add a *log.Logger argument to physical.Factory
Logging in the backend is a good thing.  This is a noisy interface change but should be a functional noop.
2016-04-25 20:10:32 -07:00

28 lines
442 B
Go

package physical
import (
"io/ioutil"
"log"
"os"
"testing"
)
func TestFileBackend(t *testing.T) {
dir, err := ioutil.TempDir("", "vault")
if err != nil {
t.Fatalf("err: %s", err)
}
defer os.RemoveAll(dir)
logger := log.New(os.Stderr, "", log.LstdFlags)
b, err := NewBackend("file", logger, map[string]string{
"path": dir,
})
if err != nil {
t.Fatalf("err: %s", err)
}
testBackend(t, b)
testBackend_ListPrefix(t, b)
}