(t *testing.T)
| 1599 | } |
| 1600 | |
| 1601 | func createAuditLoggingRestTester(t *testing.T) *RestTester { |
| 1602 | if !base.IsEnterpriseEdition() { |
| 1603 | t.Skip("Audit logging only works in EE") |
| 1604 | } |
| 1605 | // get tempdir before resetting global loggers, since the logger cleanup needs to happen before deletion |
| 1606 | tempdir := t.TempDir() |
| 1607 | base.ResetGlobalTestLogging(t) |
| 1608 | base.InitializeMemoryLoggers() |
| 1609 | rt := NewRestTester(t, &RestTesterConfig{ |
| 1610 | GuestEnabled: true, // for blip testing |
| 1611 | PersistentConfig: true, |
| 1612 | SyncFn: `function(doc) {channel(doc.channels);}`, |
| 1613 | MutateStartupConfig: func(config *StartupConfig) { |
| 1614 | config.Logging = base.LoggingConfig{ |
| 1615 | LogFilePath: tempdir, |
| 1616 | Audit: &base.AuditLoggerConfig{ |
| 1617 | FileLoggerConfig: base.FileLoggerConfig{ |
| 1618 | Enabled: base.Ptr(true), |
| 1619 | CollationBufferSize: base.Ptr(0), // avoid data race in collation with FlushLogBuffers test code |
| 1620 | }, |
| 1621 | }, |
| 1622 | Console: &base.ConsoleLoggerConfig{ |
| 1623 | FileLoggerConfig: base.FileLoggerConfig{ |
| 1624 | Enabled: base.Ptr(true), |
| 1625 | }, |
| 1626 | }, |
| 1627 | Info: &base.FileLoggerConfig{ |
| 1628 | Enabled: base.Ptr(false), |
| 1629 | CollationBufferSize: base.Ptr(0), // avoid data race in collation with FlushLogBuffers test code |
| 1630 | }, |
| 1631 | Debug: &base.FileLoggerConfig{ |
| 1632 | Enabled: base.Ptr(false), |
| 1633 | CollationBufferSize: base.Ptr(0), // avoid data race in collation with FlushLogBuffers test code |
| 1634 | }, |
| 1635 | Trace: &base.FileLoggerConfig{ |
| 1636 | Enabled: base.Ptr(false), |
| 1637 | CollationBufferSize: base.Ptr(0), // avoid data race in collation with FlushLogBuffers test code |
| 1638 | }, |
| 1639 | } |
| 1640 | require.NoError(t, config.SetupAndValidateLogging(base.TestCtx(t))) |
| 1641 | }, |
| 1642 | }) |
| 1643 | return rt |
| 1644 | } |
| 1645 | |
| 1646 | // TestAuditBlipAttachmentCRUD uses BLIP replication to test attachment CRUD operations and ensures each event is audited correctly. |
| 1647 | func TestAuditBlipAttachmentCRUD(t *testing.T) { |
no test coverage detected