(t *testing.T)
| 699 | } |
| 700 | |
| 701 | func TestAuditLogConfigDatabaseEventInGlobal(t *testing.T) { |
| 702 | base.ResetGlobalTestLogging(t) |
| 703 | base.InitializeMemoryLoggers() |
| 704 | |
| 705 | sc := NewEmptyStartupConfig() |
| 706 | sc.Logging.LogFilePath = t.TempDir() |
| 707 | sc.Logging.Audit.Enabled = base.Ptr(true) |
| 708 | sc.Logging.Audit.EnabledEvents = []uint{ |
| 709 | uint(base.AuditIDSyncGatewayStartup), // global, non-filterable |
| 710 | uint(base.AuditIDUserCreate), // database, filterable |
| 711 | uint(base.AuditIDSyncGatewayCollectInfoStart), // global, filterable |
| 712 | } |
| 713 | |
| 714 | err := sc.SetupAndValidateLogging(base.TestCtx(t)) |
| 715 | assert.ErrorContains(t, err, "1 errors") |
| 716 | assert.ErrorContains(t, err, "audit event ID 54100 \"Create user\" can only be configured at the database level") |
| 717 | } |
| 718 | |
| 719 | func TestServerConfigValidate(t *testing.T) { |
| 720 | base.SetUpTestLogging(t, base.LevelInfo, base.KeyAll) |
nothing calls this directly
no test coverage detected