mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-12-24 22:37:19 +00:00
backport of commit 82f998f071 (#18373)
Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com>
This commit is contained in:
committed by
GitHub
parent
d4fa7208f6
commit
f99420c92c
@@ -2,7 +2,6 @@ package command
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -245,13 +244,6 @@ func TestSecretsEnableCommand_Run(t *testing.T) {
|
||||
|
||||
for _, b := range backends {
|
||||
expectedResult := 0
|
||||
status, _ := builtinplugins.Registry.DeprecationStatus(b, consts.PluginTypeSecrets)
|
||||
allowDeprecated := os.Getenv(consts.VaultAllowPendingRemovalMountsEnv)
|
||||
|
||||
// Need to handle deprecated builtins specially
|
||||
if (status == consts.PendingRemoval && allowDeprecated == "") || status == consts.Removed {
|
||||
expectedResult = 2
|
||||
}
|
||||
|
||||
ui, cmd := testSecretsEnableCommand(t)
|
||||
cmd.client = client
|
||||
@@ -259,6 +251,13 @@ func TestSecretsEnableCommand_Run(t *testing.T) {
|
||||
actualResult := cmd.Run([]string{
|
||||
b,
|
||||
})
|
||||
|
||||
// Need to handle deprecated builtins specially
|
||||
status, _ := builtinplugins.Registry.DeprecationStatus(b, consts.PluginTypeSecrets)
|
||||
if status == consts.PendingRemoval || status == consts.Removed {
|
||||
expectedResult = 2
|
||||
}
|
||||
|
||||
if actualResult != expectedResult {
|
||||
t.Errorf("type: %s - got: %d, expected: %d - %s", b, actualResult, expectedResult, ui.OutputWriter.String()+ui.ErrorWriter.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user