MCPcopy Create free account
hub / github.com/SamNet-dev/snix / TestProbeSNITimeout

Function TestProbeSNITimeout

scanner/sni_test.go:94–105  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestProbeSNITimeout(t *testing.T) {
95 // 10.255.255.1 is TEST-NET-unused-ish; on many hosts it silently drops.
96 // Use a very short timeout so the test doesn't stall if the net does route.
97 r := ProbeSNI(context.Background(), "example.com", ProbeConfig{
98 TargetIP: netip.MustParseAddr("192.0.2.1"), // TEST-NET-1
99 TargetPort: 443,
100 ConnectTimeout: 250 * time.Millisecond,
101 })
102 if r.Outcome != OutcomeTimeout && r.Outcome != OutcomeTCPRefused {
103 t.Fatalf("outcome: %s (want timeout or refused)", r.Outcome)
104 }
105}
106
107func TestProbeSNIsConcurrent(t *testing.T) {
108 addr, stop := tlsTestServer(t)

Callers

nothing calls this directly

Calls 1

ProbeSNIFunction · 0.85

Tested by

no test coverage detected