Fix network hangs in recon unit tests and update README setup documentation
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

This commit is contained in:
Claude Code
2026-07-23 03:18:34 -07:00
parent 97b5fa48ff
commit 24f090e81e
3 changed files with 31 additions and 0 deletions

View File

@@ -29,6 +29,13 @@ func TestScanStreamEmitsPortsFirst(t *testing.T) {
return 200, `<html><title>Home</title></html>`, nil
})
t.Cleanup(func() { SetFetchPageHook(nil) })
SetBannerHooks(
func(_ string, p int) string { if p == 22 { return "SSH" }; return "" },
func(_ string, p int) (string, string) { if p == 80 { return "t", "s" }; return "", "" },
func(_ string, p int) string { if p == 5985 { return "w" }; return "" },
nil,
)
t.Cleanup(func() { SetBannerHooks(nil, nil, nil, nil) })
var events []string
report, err := ScanStream(ScanRequest{Host: "stream.lab", Profile: ProfileQuick, Port: 80, Scheme: "http"}, "scan-1", func(eventType string, _ map[string]interface{}) {