Hunter0x7c7
2022-08-11 a82f9cb69f63aaeba40c024960deda7d75b9fece
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package command_test
 
import (
    "context"
    "testing"
 
    "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"
)
 
func TestLoggerRestart(t *testing.T) {
    v, err := core.New(&core.Config{
        App: []*anypb.Any{
            serial.ToTypedMessage(&log.Config{}),
            serial.ToTypedMessage(&dispatcher.Config{}),
            serial.ToTypedMessage(&proxyman.InboundConfig{}),
            serial.ToTypedMessage(&proxyman.OutboundConfig{}),
        },
    })
    common.Must(err)
    common.Must(v.Start())
 
    server := &LoggerServer{
        V: v,
    }
    common.Must2(server.RestartLogger(context.Background(), &RestartLoggerRequest{}))
}