1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-06 03:54:22 -04:00
v2fly/app/log/command/command_test.go

37 lines
1003 B
Go
Raw Normal View History

2018-02-14 11:35:09 -05:00
package command_test
import (
"context"
"testing"
2021-10-28 06:34:19 -04:00
"google.golang.org/protobuf/types/known/anypb"
core "github.com/v2fly/v2ray-core/v5"
"github.com/v2fly/v2ray-core/v5/app/dispatcher"
"github.com/v2fly/v2ray-core/v5/app/log"
. "github.com/v2fly/v2ray-core/v5/app/log/command"
"github.com/v2fly/v2ray-core/v5/app/proxyman"
_ "github.com/v2fly/v2ray-core/v5/app/proxyman/inbound"
_ "github.com/v2fly/v2ray-core/v5/app/proxyman/outbound"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/serial"
2018-02-14 11:35:09 -05:00
)
func TestLoggerRestart(t *testing.T) {
v, err := core.New(&core.Config{
2021-06-19 09:36:54 -04:00
App: []*anypb.Any{
2018-02-14 11:35:09 -05:00
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
}