2018-02-14 11:35:09 -05:00
|
|
|
package command_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-06-19 09:36:54 -04:00
|
|
|
"google.golang.org/protobuf/types/known/anypb"
|
2018-02-14 11:35:09 -05:00
|
|
|
"testing"
|
|
|
|
|
2021-02-16 15:31:50 -05: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 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
|
|
|
}
|