mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Delay salt initialization for audit backends
This commit is contained in:
@@ -9,11 +9,10 @@ import (
|
||||
|
||||
"github.com/hashicorp/vault/audit"
|
||||
"github.com/hashicorp/vault/helper/salt"
|
||||
"github.com/hashicorp/vault/logical"
|
||||
)
|
||||
|
||||
func TestAuditFile_fileModeNew(t *testing.T) {
|
||||
salter, _ := salt.NewSalt(nil, nil)
|
||||
|
||||
modeStr := "0777"
|
||||
mode, err := strconv.ParseUint(modeStr, 8, 32)
|
||||
|
||||
@@ -28,8 +27,9 @@ func TestAuditFile_fileModeNew(t *testing.T) {
|
||||
}
|
||||
|
||||
_, err = Factory(&audit.BackendConfig{
|
||||
Salt: salter,
|
||||
Config: config,
|
||||
SaltConfig: &salt.Config{},
|
||||
SaltView: &logical.InmemStorage{},
|
||||
Config: config,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -45,8 +45,6 @@ func TestAuditFile_fileModeNew(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAuditFile_fileModeExisting(t *testing.T) {
|
||||
salter, _ := salt.NewSalt(nil, nil)
|
||||
|
||||
f, err := ioutil.TempFile("", "test")
|
||||
if err != nil {
|
||||
t.Fatalf("Failure to create test file.")
|
||||
@@ -68,8 +66,9 @@ func TestAuditFile_fileModeExisting(t *testing.T) {
|
||||
}
|
||||
|
||||
_, err = Factory(&audit.BackendConfig{
|
||||
Salt: salter,
|
||||
Config: config,
|
||||
Config: config,
|
||||
SaltConfig: &salt.Config{},
|
||||
SaltView: &logical.InmemStorage{},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user