v2fly/app/log/command/command_test.go

36 lines
1002 B
Go
Raw Normal View History

2018-02-14 16:35:09 +00:00
package command_test
import (
"context"
2021-06-19 13:36:54 +00:00
"google.golang.org/protobuf/types/known/anypb"
2018-02-14 16:35:09 +00:00
"testing"
2021-02-16 20:31:50 +00:00
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
"github.com/v2fly/v2ray-core/v4/app/log"
. "github.com/v2fly/v2ray-core/v4/app/log/command"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
_ "github.com/v2fly/v2ray-core/v4/app/proxyman/inbound"
_ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/serial"
2018-02-14 16:35:09 +00:00
)
func TestLoggerRestart(t *testing.T) {
v, err := core.New(&core.Config{
2021-06-19 13:36:54 +00:00
App: []*anypb.Any{
2018-02-14 16:35:09 +00:00
serial.ToTypedMessage(&log.Config{}),
2018-02-20 21:07:50 +00:00
serial.ToTypedMessage(&dispatcher.Config{}),
serial.ToTypedMessage(&proxyman.InboundConfig{}),
serial.ToTypedMessage(&proxyman.OutboundConfig{}),
2018-02-14 16:35:09 +00:00
},
})
2018-11-15 10:17:20 +00:00
common.Must(err)
common.Must(v.Start())
2018-02-14 16:35:09 +00:00
server := &LoggerServer{
V: v,
}
2018-11-15 10:17:20 +00:00
common.Must2(server.RestartLogger(context.Background(), &RestartLoggerRequest{}))
2018-02-14 16:35:09 +00:00
}