mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
fix: fast trace test
This commit is contained in:
@@ -1,14 +1,24 @@
|
|||||||
package fastTrace
|
package fastTrace
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/xgadget-lab/nexttrace/trace"
|
"github.com/xgadget-lab/nexttrace/trace"
|
||||||
|
"github.com/xgadget-lab/nexttrace/wshandle"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ICMP Use Too Many Time to Wait So we don't test it.
|
// ICMP Use Too Many Time to Wait So we don't test it.
|
||||||
func TestTCPTrace(t *testing.T) {
|
func TestTCPTrace(t *testing.T) {
|
||||||
ft := FastTracer{}
|
ft := FastTracer{}
|
||||||
|
// 建立 WebSocket 连接
|
||||||
|
w := wshandle.New()
|
||||||
|
w.Interrupt = make(chan os.Signal, 1)
|
||||||
|
signal.Notify(w.Interrupt, os.Interrupt)
|
||||||
|
defer func() {
|
||||||
|
w.Conn.Close()
|
||||||
|
}()
|
||||||
ft.TracerouteMethod = trace.TCPTrace
|
ft.TracerouteMethod = trace.TCPTrace
|
||||||
ft.testCM()
|
ft.testCM()
|
||||||
ft.testEDU()
|
ft.testEDU()
|
||||||
|
|||||||
Reference in New Issue
Block a user