]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Update test trackers
authorMatt Joiner <anacrolix@gmail.com>
Mon, 12 Feb 2018 12:49:05 +0000 (23:49 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 12 Feb 2018 12:49:05 +0000 (23:49 +1100)
tracker/udp_test.go

index f080621f1675e6575c7248e533c78c28f3608898..1c06407168a41d3992c2656ac5597029b2d90077 100644 (file)
@@ -18,6 +18,11 @@ import (
        "github.com/stretchr/testify/require"
 )
 
+var trackers = []string{
+       "udp://tracker.coppersurfer.tk:6969",
+       "udp://tracker.leechers-paradise.org:6969",
+}
+
 // Ensure net.IPs are stored big-endian, to match the way they're read from
 // the wire.
 func TestNetIPv4Bytes(t *testing.T) {
@@ -127,7 +132,7 @@ func TestUDPTracker(t *testing.T) {
        }
        rand.Read(req.PeerId[:])
        copy(req.InfoHash[:], []uint8{0xa3, 0x56, 0x41, 0x43, 0x74, 0x23, 0xe6, 0x26, 0xd9, 0x38, 0x25, 0x4a, 0x6b, 0x80, 0x49, 0x10, 0xa6, 0x67, 0xa, 0xc1})
-       ar, err := Announce(defaultClient, defaultHTTPUserAgent, "udp://tracker.openbittorrent.com:80/announce", &req)
+       ar, err := Announce(defaultClient, defaultHTTPUserAgent, trackers[0], &req)
        // Skip any net errors as we don't control the server.
        if _, ok := err.(net.Error); ok {
                t.Skip(err)
@@ -151,15 +156,7 @@ func TestAnnounceRandomInfoHashThirdParty(t *testing.T) {
        wg := sync.WaitGroup{}
        success := make(chan bool)
        fail := make(chan struct{})
-       for _, url := range []string{
-               "udp://tracker.openbittorrent.com:80/announce",
-               "udp://tracker.publicbt.com:80",
-               "udp://tracker.istole.it:6969",
-               "udp://tracker.ccc.de:80",
-               "udp://tracker.open.demonii.com:1337",
-               "udp://open.demonii.com:1337",
-               "udp://exodus.desync.com:6969",
-       } {
+       for _, url := range trackers {
                wg.Add(1)
                go func(url string) {
                        defer wg.Done()