command_test.go 946 B

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