open-vault/physical/file_test.go

31 lines
520 B
Go
Raw Normal View History

package physical
import (
"io/ioutil"
"os"
"testing"
2016-08-19 20:45:17 +00:00
"github.com/hashicorp/vault/helper/logformat"
log "github.com/mgutz/logxi/v1"
)
func TestFileBackend(t *testing.T) {
dir, err := ioutil.TempDir("", "vault")
if err != nil {
t.Fatalf("err: %s", err)
}
defer os.RemoveAll(dir)
2016-08-19 20:45:17 +00:00
logger := logformat.NewVaultLogger(log.LevelTrace)
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)
}