mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Log environment variable keys at startup (#18125)
* Log environment variable keys at startup * run make fmt * change name * add changelog * fix changelog nubmer * fix title * add test * fix message * Update changelog/18125.txt Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com> * add trace test * remove check for >= debug, trace * Update changelog/18125.txt Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com> Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
This commit is contained in:
@@ -203,63 +203,70 @@ func TestServer(t *testing.T) {
|
||||
contents string
|
||||
exp string
|
||||
code int
|
||||
flag string
|
||||
args []string
|
||||
}{
|
||||
{
|
||||
"common_ha",
|
||||
testBaseHCL(t, "") + inmemHCL,
|
||||
"(HA available)",
|
||||
0,
|
||||
"-test-verify-only",
|
||||
[]string{"-test-verify-only"},
|
||||
},
|
||||
{
|
||||
"separate_ha",
|
||||
testBaseHCL(t, "") + inmemHCL + haInmemHCL,
|
||||
"HA Storage:",
|
||||
0,
|
||||
"-test-verify-only",
|
||||
[]string{"-test-verify-only"},
|
||||
},
|
||||
{
|
||||
"bad_separate_ha",
|
||||
testBaseHCL(t, "") + inmemHCL + badHAInmemHCL,
|
||||
"Specified HA storage does not support HA",
|
||||
1,
|
||||
"-test-verify-only",
|
||||
[]string{"-test-verify-only"},
|
||||
},
|
||||
{
|
||||
"good_listener_timeout_config",
|
||||
testBaseHCL(t, goodListenerTimeouts) + inmemHCL,
|
||||
"",
|
||||
0,
|
||||
"-test-server-config",
|
||||
[]string{"-test-server-config"},
|
||||
},
|
||||
{
|
||||
"bad_listener_read_header_timeout_config",
|
||||
testBaseHCL(t, badListenerReadHeaderTimeout) + inmemHCL,
|
||||
"unknown unit \"km\" in duration \"12km\"",
|
||||
1,
|
||||
"-test-server-config",
|
||||
[]string{"-test-server-config"},
|
||||
},
|
||||
{
|
||||
"bad_listener_read_timeout_config",
|
||||
testBaseHCL(t, badListenerReadTimeout) + inmemHCL,
|
||||
"unknown unit \"\\xe6\\x97\\xa5\" in duration",
|
||||
1,
|
||||
"-test-server-config",
|
||||
[]string{"-test-server-config"},
|
||||
},
|
||||
{
|
||||
"bad_listener_write_timeout_config",
|
||||
testBaseHCL(t, badListenerWriteTimeout) + inmemHCL,
|
||||
"unknown unit \"lbs\" in duration \"56lbs\"",
|
||||
1,
|
||||
"-test-server-config",
|
||||
[]string{"-test-server-config"},
|
||||
},
|
||||
{
|
||||
"bad_listener_idle_timeout_config",
|
||||
testBaseHCL(t, badListenerIdleTimeout) + inmemHCL,
|
||||
"unknown unit \"gophers\" in duration \"78gophers\"",
|
||||
1,
|
||||
"-test-server-config",
|
||||
[]string{"-test-server-config"},
|
||||
},
|
||||
{
|
||||
"environment_variables_logged",
|
||||
testBaseHCL(t, "") + inmemHCL,
|
||||
"Environment Variables",
|
||||
0,
|
||||
[]string{"-test-verify-only"},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -278,11 +285,11 @@ func TestServer(t *testing.T) {
|
||||
f.Close()
|
||||
defer os.Remove(f.Name())
|
||||
|
||||
code := cmd.Run([]string{
|
||||
"-config", f.Name(),
|
||||
tc.flag,
|
||||
})
|
||||
args := append(tc.args, "-config", f.Name())
|
||||
|
||||
code := cmd.Run(args)
|
||||
output := ui.ErrorWriter.String() + ui.OutputWriter.String()
|
||||
|
||||
if code != tc.code {
|
||||
t.Errorf("expected %d to be %d: %s", code, tc.code, output)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user