From a1a2f261e981f7c759fa02bd27f33540479a01d6 Mon Sep 17 00:00:00 2001 From: Damian Bednarczyk Date: Fri, 1 Dec 2023 21:16:38 -0600 Subject: [PATCH] update test to run on every ip in googlebot pool --- proxychain/requestmodifers/bot/bot_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/proxychain/requestmodifers/bot/bot_test.go b/proxychain/requestmodifers/bot/bot_test.go index e593985..74dbfc3 100644 --- a/proxychain/requestmodifers/bot/bot_test.go +++ b/proxychain/requestmodifers/bot/bot_test.go @@ -6,9 +6,17 @@ import ( ) func TestRandomIPFromSubnet(t *testing.T) { - subnets := []string{"34.100.182.96/28", "207.46.13.0/24", "2001:4860:4801:10::/64", "2001:4860:4801:c::/64"} + err := GoogleBot.UpdatePool("https://developers.google.com/static/search/apis/ipranges/googlebot.json") + if err != nil { + t.Error(err) + } + + for _, prefix := range GoogleBot.IPPool.Prefixes { + subnet := prefix.IPv4 + if prefix.IPv6 != "" { + subnet = prefix.IPv6 + } - for _, subnet := range subnets { t.Run(subnet, func(t *testing.T) { _, ipnet, err := net.ParseCIDR(subnet) if err != nil {