lbry.go/dht/bootstrap_test.go

25 lines
386 B
Go
Raw Normal View History

2018-05-13 22:02:46 +02:00
package dht
import (
"net"
"testing"
2018-06-14 17:48:02 +02:00
2019-01-09 23:37:29 +01:00
"github.com/lbryio/lbry.go/dht/bits"
2018-05-13 22:02:46 +02:00
)
func TestBootstrapPing(t *testing.T) {
2018-06-14 17:48:02 +02:00
b := NewBootstrapNode(bits.Rand(), 10, bootstrapDefaultRefreshDuration)
2018-05-13 22:02:46 +02:00
listener, err := net.ListenPacket(Network, "127.0.0.1:54320")
2018-05-13 22:02:46 +02:00
if err != nil {
panic(err)
}
err = b.Connect(listener.(*net.UDPConn))
if err != nil {
t.Error(err)
}
2018-05-13 22:02:46 +02:00
b.Shutdown()
}