mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
Remove old audit behavior from test code (#24540)
* Export audit event * Move older tests away from audit behavior that didn't use eventlogger * spelling--; * no more struct initialization of NoopAudit outside of NewNoopAudit * locking since we're accessing the shared backend
This commit is contained in:
@@ -569,10 +569,8 @@ func TestLogical_RespondWithStatusCode(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLogical_Audit_invalidWrappingToken(t *testing.T) {
|
||||
t.Setenv("VAULT_AUDIT_DISABLE_EVENTLOGGER", "true")
|
||||
|
||||
// Create a noop audit backend
|
||||
noop := corehelpers.TestNoopAudit(t, nil)
|
||||
noop := corehelpers.TestNoopAudit(t, "noop", nil)
|
||||
c, _, root := vault.TestCoreUnsealedWithConfig(t, &vault.CoreConfig{
|
||||
AuditBackends: map[string]audit.Factory{
|
||||
"noop": func(ctx context.Context, config *audit.BackendConfig, _ bool, _ audit.HeaderFormatter) (audit.Backend, error) {
|
||||
@@ -584,7 +582,6 @@ func TestLogical_Audit_invalidWrappingToken(t *testing.T) {
|
||||
defer ln.Close()
|
||||
|
||||
// Enable the audit backend
|
||||
|
||||
resp := testHttpPost(t, root, addr+"/v1/sys/audit/noop", map[string]interface{}{
|
||||
"type": "noop",
|
||||
})
|
||||
|
||||
@@ -247,8 +247,6 @@ func testServerWithAudit(t *testing.T, records **[][]byte) (net.Listener, string
|
||||
}
|
||||
|
||||
func TestSysGenerateRoot_badKey(t *testing.T) {
|
||||
t.Setenv("VAULT_AUDIT_DISABLE_EVENTLOGGER", "true")
|
||||
|
||||
var records *[][]byte
|
||||
ln, addr, token, _ := testServerWithAudit(t, &records)
|
||||
defer ln.Close()
|
||||
|
||||
Reference in New Issue
Block a user