Skip to content

Commit

Permalink
bootstrap: rm v6 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Apr 10, 2023
1 parent 5c819b4 commit 3da0876
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const testTimeout = 1 * time.Second
func newListener(t testing.TB, network string, sig chan net.Addr) (l net.Listener) {
t.Helper()

l, err := net.Listen(network, ":0")
// TODO(e.burkov): Listen IPv6 as well, when the CI adds IPv6 interfaces.
l, err := net.Listen(network, "127.0.0.1:0")
require.NoError(t, err)
testutil.CleanupAndRequireSuccess(t, l.Close)

Expand Down Expand Up @@ -59,10 +60,6 @@ func TestResolveDialContext(t *testing.T) {
name: "v4",
addresses: []netip.Addr{netutil.IPv4Localhost()},
preferIPv6: false,
}, {
name: "v6",
addresses: []netip.Addr{netutil.IPv6Localhost()},
preferIPv6: false,
}, {
name: "both_prefer_v6",
addresses: []netip.Addr{netutil.IPv4Localhost(), netutil.IPv6Localhost()},
Expand Down
4 changes: 4 additions & 0 deletions internal/bootstrap/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bootstrap

import (
"context"
"net"
"net/netip"
"time"

Expand All @@ -16,6 +17,9 @@ type Resolver interface {
LookupNetIP(ctx context.Context, network string, host string) (addrs []netip.Addr, err error)
}

// type check
var _ Resolver = &net.Resolver{}

// ErrNoResolvers is returned when zero resolvers specified.
const ErrNoResolvers = errors.Error("no resolvers specified")

Expand Down

0 comments on commit 3da0876

Please sign in to comment.