mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
use BUILD_MINIMAL env to build minimal Vault with few storage options and plugins (#27394)
This commit is contained in:
45
command/commands_full_test.go
Normal file
45
command/commands_full_test.go
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
//go:build !enterprise && !minimal
|
||||
|
||||
package command
|
||||
|
||||
import (
|
||||
"maps"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// Test_extendAddonCommands tests extendAddonCommands() extends physical and logical backends with
|
||||
// those generated by newFullAddonCommands()
|
||||
func Test_extendAddonCommands(t *testing.T) {
|
||||
expMinPhysicalBackends := maps.Clone(physicalBackends)
|
||||
expMinLoginHandlers := maps.Clone(loginHandlers)
|
||||
|
||||
expAddonPhysicalBackends, expAddonLoginHandlers := newFullAddonCommands()
|
||||
|
||||
extendAddonCommands()
|
||||
|
||||
require.Equal(t, len(expMinPhysicalBackends)+len(expAddonPhysicalBackends), len(physicalBackends),
|
||||
"extended total physical backends mismatch total of minimal and full addon physical backends")
|
||||
require.Equal(t, len(expMinLoginHandlers)+len(expAddonLoginHandlers), len(loginHandlers),
|
||||
"extended total login handlers mismatch total of minimal and full addon login handlers")
|
||||
|
||||
for k := range expMinPhysicalBackends {
|
||||
require.Contains(t, physicalBackends, k, "expected to contain minimal physical backend")
|
||||
}
|
||||
|
||||
for k := range expAddonPhysicalBackends {
|
||||
require.Contains(t, physicalBackends, k, "expected to contain full addon physical backend")
|
||||
}
|
||||
|
||||
for k := range expMinLoginHandlers {
|
||||
require.Contains(t, loginHandlers, k, "expected to contain minimal login handler")
|
||||
}
|
||||
|
||||
for k := range expAddonLoginHandlers {
|
||||
require.Contains(t, loginHandlers, k, "expected to contain full addon login handler")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user