2018-02-14 11:35:09 -05:00
|
|
|
package command_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"v2ray.com/core"
|
2018-02-20 16:07:50 -05:00
|
|
|
"v2ray.com/core/app/dispatcher"
|
2018-02-14 11:35:09 -05:00
|
|
|
"v2ray.com/core/app/log"
|
|
|
|
. "v2ray.com/core/app/log/command"
|
2018-02-20 16:07:50 -05:00
|
|
|
"v2ray.com/core/app/proxyman"
|
|
|
|
_ "v2ray.com/core/app/proxyman/inbound"
|
|
|
|
_ "v2ray.com/core/app/proxyman/outbound"
|
2018-11-15 05:17:20 -05:00
|
|
|
"v2ray.com/core/common"
|
2018-02-14 11:35:09 -05:00
|
|
|
"v2ray.com/core/common/serial"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestLoggerRestart(t *testing.T) {
|
|
|
|
v, err := core.New(&core.Config{
|
|
|
|
App: []*serial.TypedMessage{
|
|
|
|
serial.ToTypedMessage(&log.Config{}),
|
2018-02-20 16:07:50 -05:00
|
|
|
serial.ToTypedMessage(&dispatcher.Config{}),
|
|
|
|
serial.ToTypedMessage(&proxyman.InboundConfig{}),
|
|
|
|
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
|
2018-02-14 11:35:09 -05:00
|
|
|
},
|
|
|
|
})
|
2018-11-15 05:17:20 -05:00
|
|
|
common.Must(err)
|
|
|
|
common.Must(v.Start())
|
2018-02-14 11:35:09 -05:00
|
|
|
|
|
|
|
server := &LoggerServer{
|
|
|
|
V: v,
|
|
|
|
}
|
2018-11-15 05:17:20 -05:00
|
|
|
common.Must2(server.RestartLogger(context.Background(), &RestartLoggerRequest{}))
|
2018-02-14 11:35:09 -05:00
|
|
|
}
|