use BUILD_MINIMAL env to build minimal Vault with few storage options and plugins (#27394)

This commit is contained in:
Thy Ton
2024-06-12 09:53:49 -07:00
committed by GitHub
parent c4fcb4a086
commit 83111c010c
12 changed files with 417 additions and 217 deletions

View 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")
}
}