backtrace/utils/utils_test.go
spiritlhl 16e551b631
Some checks failed
CI / test (push) Waiting to run
Sync ASN metadata / sync (push) Has been cancelled
feat(dns): prepare backtrace v0.0.21
2026-08-26 15:37:44 +08:00

22 lines
457 B
Go

package utils
import (
"fmt"
"os"
"testing"
"time"
)
func TestCheckPublicAccess(t *testing.T) {
if os.Getenv("BACKTRACE_INTEGRATION") != "1" {
t.Skip("set BACKTRACE_INTEGRATION=1 to run live public-access checks")
}
timeout := 3 * time.Second
result := CheckPublicAccess(timeout)
if result.Connected {
fmt.Printf("✅ 本机有公网连接,类型: %s\n", result.StackType)
} else {
fmt.Println("❌ 本机未检测到公网连接")
}
}