lbry.go/dht/bootstrap_test.go

25 lines
389 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
"github.com/lbryio/lbry.go/v3/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()
}