mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
test: port test changes to oss (#8694)
This commit is contained in:
committed by
GitHub
parent
867218c119
commit
ba1871d48e
@@ -390,6 +390,7 @@ func TestPredict_Plugins(t *testing.T) {
|
||||
"redshift-database-plugin",
|
||||
"ssh",
|
||||
"totp",
|
||||
"transform",
|
||||
"transit",
|
||||
"userpass",
|
||||
},
|
||||
@@ -415,6 +416,14 @@ func TestPredict_Plugins(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if !strutil.StrListContains(act, "transform") {
|
||||
for i, v := range tc.exp {
|
||||
if v == "transform" {
|
||||
tc.exp = append(tc.exp[:i], tc.exp[i+1:]...)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if !reflect.DeepEqual(act, tc.exp) {
|
||||
t.Errorf("expected:%q, got: %q", tc.exp, act)
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// logicalBackendAdjustmentFactor is set to 1 for the database backend
|
||||
// which is a plugin but not found in go.mod files
|
||||
logicalBackendAdjustmentFactor = 1
|
||||
)
|
||||
|
||||
@@ -216,7 +218,7 @@ func TestSecretsEnableCommand_Run(t *testing.T) {
|
||||
// backends are found by walking the directory, which includes the database backend,
|
||||
// however, the plugins registry omits that one
|
||||
if len(backends) != len(builtinplugins.Registry.Keys(consts.PluginTypeSecrets))+logicalBackendAdjustmentFactor {
|
||||
t.Fatalf("expected %d logical backends, got %d", len(builtinplugins.Registry.Keys(consts.PluginTypeSecrets))+1, len(backends))
|
||||
t.Fatalf("expected %d logical backends, got %d", len(builtinplugins.Registry.Keys(consts.PluginTypeSecrets))+logicalBackendAdjustmentFactor, len(backends))
|
||||
}
|
||||
|
||||
for _, b := range backends {
|
||||
|
||||
Reference in New Issue
Block a user