mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 02:28:15 +03:00
Fix fuzzing for imapserver
Broken since introducing LoginAttempts. The fuzzing functions didn't get the store.Init() call, and would hang on trying to send to the loginattemptwriter.
This commit is contained in:
parent
edfc24a701
commit
06b7c8bba0
@ -62,8 +62,13 @@ func FuzzServer(f *testing.F) {
|
||||
log := mlog.New("imapserver", nil)
|
||||
mox.ConfigStaticPath = filepath.FromSlash("../testdata/imapserverfuzz/mox.conf")
|
||||
mox.MustLoadConfig(true, false)
|
||||
store.Close() // May not be open, we ignore error.
|
||||
dataDir := mox.ConfigDirPath(mox.Conf.Static.DataDir)
|
||||
os.RemoveAll(dataDir)
|
||||
err := store.Init(ctxbg)
|
||||
if err != nil {
|
||||
f.Fatalf("store init: %v", err)
|
||||
}
|
||||
acc, err := store.OpenAccount(log, "mjl", false)
|
||||
if err != nil {
|
||||
f.Fatalf("open account: %v", err)
|
||||
|
@ -35,8 +35,14 @@ func FuzzServer(f *testing.F) {
|
||||
mox.Context = ctxbg
|
||||
mox.ConfigStaticPath = filepath.FromSlash("../testdata/smtpserverfuzz/mox.conf")
|
||||
mox.MustLoadConfig(true, false)
|
||||
store.Close() // May not be open, we ignore error.
|
||||
dataDir := mox.ConfigDirPath(mox.Conf.Static.DataDir)
|
||||
os.RemoveAll(dataDir)
|
||||
err := store.Init(ctxbg)
|
||||
if err != nil {
|
||||
f.Fatalf("store init: %v", err)
|
||||
}
|
||||
|
||||
acc, err := store.OpenAccount(log, "mjl", false)
|
||||
if err != nil {
|
||||
f.Fatalf("open account: %v", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user