mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
replace global vault handlers with newVaultHandlers() (#27515)
This commit is contained in:
@@ -32,10 +32,11 @@ func init() {
|
||||
}
|
||||
|
||||
func TestMigration(t *testing.T) {
|
||||
handlers := newVaultHandlers()
|
||||
t.Run("Default", func(t *testing.T) {
|
||||
data := generateData()
|
||||
|
||||
fromFactory := physicalBackends["file"]
|
||||
fromFactory := handlers.physicalBackends["file"]
|
||||
|
||||
folder := t.TempDir()
|
||||
|
||||
@@ -51,7 +52,7 @@ func TestMigration(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
toFactory := physicalBackends["inmem"]
|
||||
toFactory := handlers.physicalBackends["inmem"]
|
||||
confTo := map[string]string{}
|
||||
to, err := toFactory(confTo, nil)
|
||||
if err != nil {
|
||||
@@ -72,7 +73,7 @@ func TestMigration(t *testing.T) {
|
||||
t.Run("Concurrent migration", func(t *testing.T) {
|
||||
data := generateData()
|
||||
|
||||
fromFactory := physicalBackends["file"]
|
||||
fromFactory := handlers.physicalBackends["file"]
|
||||
|
||||
folder := t.TempDir()
|
||||
|
||||
@@ -88,7 +89,7 @@ func TestMigration(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
toFactory := physicalBackends["inmem"]
|
||||
toFactory := handlers.physicalBackends["inmem"]
|
||||
confTo := map[string]string{}
|
||||
to, err := toFactory(confTo, nil)
|
||||
if err != nil {
|
||||
@@ -110,7 +111,7 @@ func TestMigration(t *testing.T) {
|
||||
t.Run("Start option", func(t *testing.T) {
|
||||
data := generateData()
|
||||
|
||||
fromFactory := physicalBackends["inmem"]
|
||||
fromFactory := handlers.physicalBackends["inmem"]
|
||||
confFrom := map[string]string{}
|
||||
from, err := fromFactory(confFrom, nil)
|
||||
if err != nil {
|
||||
@@ -120,7 +121,7 @@ func TestMigration(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
toFactory := physicalBackends["file"]
|
||||
toFactory := handlers.physicalBackends["file"]
|
||||
folder := t.TempDir()
|
||||
confTo := map[string]string{
|
||||
"path": folder,
|
||||
@@ -149,7 +150,7 @@ func TestMigration(t *testing.T) {
|
||||
t.Run("Start option (parallel)", func(t *testing.T) {
|
||||
data := generateData()
|
||||
|
||||
fromFactory := physicalBackends["inmem"]
|
||||
fromFactory := handlers.physicalBackends["inmem"]
|
||||
confFrom := map[string]string{}
|
||||
from, err := fromFactory(confFrom, nil)
|
||||
if err != nil {
|
||||
@@ -159,7 +160,7 @@ func TestMigration(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
toFactory := physicalBackends["file"]
|
||||
toFactory := handlers.physicalBackends["file"]
|
||||
folder := t.TempDir()
|
||||
confTo := map[string]string{
|
||||
"path": folder,
|
||||
@@ -269,7 +270,7 @@ storage_destination "dest_type2" {
|
||||
})
|
||||
|
||||
t.Run("DFS Scan", func(t *testing.T) {
|
||||
s, _ := physicalBackends["inmem"](map[string]string{}, nil)
|
||||
s, _ := handlers.physicalBackends["inmem"](map[string]string{}, nil)
|
||||
|
||||
data := generateData()
|
||||
data["cc"] = []byte{}
|
||||
|
||||
Reference in New Issue
Block a user