mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 12:26:34 +02:00
Test was failing because the global prometheus registry doesn't allow duplicate registrations. We don't need prometheus in server command tests, so we disable it. Co-authored-by: John-Michael Faircloth <fairclothjm@users.noreply.github.com>
This commit is contained in:
parent
25cb017310
commit
72fe26b141
@ -17,6 +17,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -328,7 +329,17 @@ func TestServer(t *testing.T) {
|
||||
// TestServer_DevTLS verifies that a vault server starts up correctly with the -dev-tls flag
|
||||
func TestServer_DevTLS(t *testing.T) {
|
||||
ui, cmd := testServerCommand(t)
|
||||
args := []string{"-dev-tls", "-dev-listen-address=127.0.0.1:0", "-test-server-config"}
|
||||
|
||||
configPath := filepath.Join(t.TempDir(), "config.hcl")
|
||||
err := os.WriteFile(configPath, []byte(testConfig), 0o644)
|
||||
require.NoError(t, err)
|
||||
|
||||
args := []string{
|
||||
"-dev-tls",
|
||||
"-dev-listen-address=127.0.0.1:0",
|
||||
"-test-server-config",
|
||||
"-config=" + configPath,
|
||||
}
|
||||
retCode := cmd.Run(args)
|
||||
output := ui.ErrorWriter.String() + ui.OutputWriter.String()
|
||||
require.Equal(t, 0, retCode, output)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user