test(12-04): add end-to-end SweepAll integration test across all 28 sources

- Extend integration test with Phase 12 IoT scanner fixtures (shodan, censys, zoomeye, fofa, netlas, binaryedge)
- Add cloud storage fixtures with correct formats (S3 XML, GCS JSON, Azure EnumerationResults XML)
- Add TestRegisterAll_Phase12 verifying 28 sources, enabled/disabled states
- Add TestRegisterAll_Phase12_SweepAllNoPanic for timeout resilience
- Update existing register_test.go from 18 to 28 expected sources
This commit is contained in:
salvacybersec
2026-04-06 12:41:59 +03:00
parent 870431658d
commit f0f22191ef
2 changed files with 267 additions and 13 deletions

View File

@@ -16,9 +16,9 @@ func registerTestRegistry() *providers.Registry {
})
}
// TestRegisterAll_WiresAllEighteenSources asserts that RegisterAll registers
// every Phase 10 + Phase 11 source by its stable name on a fresh engine.
func TestRegisterAll_WiresAllEighteenSources(t *testing.T) {
// TestRegisterAll_WiresAllTwentyEightSources asserts that RegisterAll registers
// every Phase 10 + Phase 11 + Phase 12 source by its stable name on a fresh engine.
func TestRegisterAll_WiresAllTwentyEightSources(t *testing.T) {
eng := recon.NewEngine()
cfg := SourcesConfig{
Registry: registerTestRegistry(),
@@ -28,12 +28,17 @@ func TestRegisterAll_WiresAllEighteenSources(t *testing.T) {
got := eng.List()
want := []string{
"azureblob",
"binaryedge",
"bing",
"bitbucket",
"brave",
"censys",
"codeberg",
"codesandbox",
"duckduckgo",
"fofa",
"gcs",
"gist",
"gistpaste",
"github",
@@ -41,11 +46,16 @@ func TestRegisterAll_WiresAllEighteenSources(t *testing.T) {
"google",
"huggingface",
"kaggle",
"netlas",
"pastebin",
"pastesites",
"replit",
"s3",
"sandboxes",
"shodan",
"spaces",
"yandex",
"zoomeye",
}
if !reflect.DeepEqual(got, want) {
t.Fatalf("RegisterAll names mismatch\n got: %v\nwant: %v", got, want)
@@ -63,8 +73,8 @@ func TestRegisterAll_MissingCredsStillRegistered(t *testing.T) {
Limiters: recon.NewLimiterRegistry(),
})
if n := len(eng.List()); n != 18 {
t.Fatalf("expected 18 sources registered, got %d: %v", n, eng.List())
if n := len(eng.List()); n != 28 {
t.Fatalf("expected 28 sources registered, got %d: %v", n, eng.List())
}
// SweepAll with an empty config should filter out cred-gated sources