mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:54:40 +03:00
add debug logging about bstore db schema upgrades
bstore was updated to v0.0.6 to add this logging. this simplifies some of the db-handling code in mtastsdb,tlsrptdb,dmarcdb. we now call the package-level Init() and Close() in all tests properly.
This commit is contained in:
@ -105,11 +105,6 @@ func newTestServer(t *testing.T, configPath string, resolver dns.Resolver) *test
|
||||
|
||||
ts := testserver{t: t, cid: 1, resolver: resolver, tlsmode: smtpclient.TLSOpportunistic}
|
||||
|
||||
if dmarcdb.EvalDB != nil {
|
||||
dmarcdb.EvalDB.Close()
|
||||
dmarcdb.EvalDB = nil
|
||||
}
|
||||
|
||||
log := mlog.New("smtpserver", nil)
|
||||
mox.Context = ctxbg
|
||||
mox.ConfigStaticPath = configPath
|
||||
@ -117,7 +112,11 @@ func newTestServer(t *testing.T, configPath string, resolver dns.Resolver) *test
|
||||
dataDir := mox.ConfigDirPath(mox.Conf.Static.DataDir)
|
||||
os.RemoveAll(dataDir)
|
||||
|
||||
var err error
|
||||
err := dmarcdb.Init()
|
||||
tcheck(t, err, "dmarcdb init")
|
||||
err = tlsrptdb.Init()
|
||||
tcheck(t, err, "tlsrptdb init")
|
||||
|
||||
ts.acc, err = store.OpenAccount(log, "mjl")
|
||||
tcheck(t, err, "open account")
|
||||
err = ts.acc.SetPassword(log, password0)
|
||||
@ -136,10 +135,14 @@ func (ts *testserver) close() {
|
||||
if ts.acc == nil {
|
||||
return
|
||||
}
|
||||
err := dmarcdb.Close()
|
||||
tcheck(ts.t, err, "dmarcdb close")
|
||||
err = tlsrptdb.Close()
|
||||
tcheck(ts.t, err, "tlsrptdb close")
|
||||
ts.comm.Unregister()
|
||||
queue.Shutdown()
|
||||
ts.switchStop()
|
||||
err := ts.acc.Close()
|
||||
err = ts.acc.Close()
|
||||
tcheck(ts.t, err, "closing account")
|
||||
ts.acc.CheckClosed()
|
||||
ts.acc = nil
|
||||
|
Reference in New Issue
Block a user