Files
mochi/frontend/udp/frontend_test.go
Lawrence, Rendall 8cd8343757 (tested) refactor code
* add sentinel master parameter into driver config
* replace yaml double deserialization with `mapstructure` in initializers
* replace struct initializers with registered functions
* add torrent approval MD and a sanitize rest MDs
2022-04-16 00:51:48 +03:00

29 lines
662 B
Go

package udp_test
import (
"testing"
"github.com/sot-tech/mochi/frontend/udp"
"github.com/sot-tech/mochi/middleware"
"github.com/sot-tech/mochi/pkg/conf"
_ "github.com/sot-tech/mochi/pkg/randseed"
"github.com/sot-tech/mochi/storage"
_ "github.com/sot-tech/mochi/storage/memory"
)
func TestStartStopRaceIssue437(t *testing.T) {
ps, err := storage.NewStorage("memory", conf.MapConfig{})
if err != nil {
t.Fatal(err)
}
lgc := middleware.NewLogic(0, 0, ps, nil, nil)
fe, err := udp.NewFrontend(lgc, conf.MapConfig{"addr": "127.0.0.1:0"})
if err != nil {
t.Fatal(err)
}
errC := fe.Stop()
if errs := <-errC; len(errs) != 0 {
t.Fatal(errs)
}
}