command_test.go 1002 B

1234567891011121314151617181920212223242526272829303132333435
  1. package command_test
  2. import (
  3. "context"
  4. "google.golang.org/protobuf/types/known/anypb"
  5. "testing"
  6. core "github.com/v2fly/v2ray-core/v4"
  7. "github.com/v2fly/v2ray-core/v4/app/dispatcher"
  8. "github.com/v2fly/v2ray-core/v4/app/log"
  9. . "github.com/v2fly/v2ray-core/v4/app/log/command"
  10. "github.com/v2fly/v2ray-core/v4/app/proxyman"
  11. _ "github.com/v2fly/v2ray-core/v4/app/proxyman/inbound"
  12. _ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
  13. "github.com/v2fly/v2ray-core/v4/common"
  14. "github.com/v2fly/v2ray-core/v4/common/serial"
  15. )
  16. func TestLoggerRestart(t *testing.T) {
  17. v, err := core.New(&core.Config{
  18. App: []*anypb.Any{
  19. serial.ToTypedMessage(&log.Config{}),
  20. serial.ToTypedMessage(&dispatcher.Config{}),
  21. serial.ToTypedMessage(&proxyman.InboundConfig{}),
  22. serial.ToTypedMessage(&proxyman.OutboundConfig{}),
  23. },
  24. })
  25. common.Must(err)
  26. common.Must(v.Start())
  27. server := &LoggerServer{
  28. V: v,
  29. }
  30. common.Must2(server.RestartLogger(context.Background(), &RestartLoggerRequest{}))
  31. }