Skip to content

Commit

Permalink
all: use of nettest, remove internal/nettest
Browse files Browse the repository at this point in the history
This change uses the nettest package where possible and removes the
internal/nettest package.

Change-Id: I5615a3ab7957183fecea6b5646df99dbb7c186e2
Reviewed-on: https://go-review.googlesource.com/c/net/+/123057
Run-TryBot: Mikio Hara <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Matt Layher <[email protected]>
  • Loading branch information
mikioh committed Mar 27, 2019
1 parent 9bff7f1 commit 63eda1e
Show file tree
Hide file tree
Showing 35 changed files with 249 additions and 508 deletions.
10 changes: 5 additions & 5 deletions icmp/diag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

"golang.org/x/net/icmp"
"golang.org/x/net/internal/iana"
"golang.org/x/net/internal/nettest"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
"golang.org/x/net/nettest"
)

var testDiag = flag.Bool("diag", false, "whether to test ICMP message exchange with external network")
Expand Down Expand Up @@ -68,8 +68,8 @@ func TestDiag(t *testing.T) {
}
})
t.Run("Ping/Privileged", func(t *testing.T) {
if m, ok := nettest.SupportsRawIPSocket(); !ok {
t.Skip(m)
if !nettest.SupportsRawSocket() {
t.Skipf("not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
for i, dt := range []diagTest{
{
Expand Down Expand Up @@ -100,8 +100,8 @@ func TestDiag(t *testing.T) {
}
})
t.Run("Probe/Privileged", func(t *testing.T) {
if m, ok := nettest.SupportsRawIPSocket(); !ok {
t.Skip(m)
if !nettest.SupportsRawSocket() {
t.Skipf("not supported on %s/%s", runtime.GOOS, runtime.GOARCH)
}
for i, dt := range []diagTest{
{
Expand Down
11 changes: 0 additions & 11 deletions internal/nettest/helper_nobsd.go

This file was deleted.

28 changes: 0 additions & 28 deletions internal/nettest/helper_stub.go

This file was deleted.

38 changes: 0 additions & 38 deletions internal/nettest/helper_windows.go

This file was deleted.

94 changes: 0 additions & 94 deletions internal/nettest/interface.go

This file was deleted.

11 changes: 0 additions & 11 deletions internal/nettest/rlimit.go

This file was deleted.

152 changes: 0 additions & 152 deletions internal/nettest/stack.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/socket/socket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"syscall"
"testing"

"golang.org/x/net/internal/nettest"
"golang.org/x/net/internal/socket"
"golang.org/x/net/nettest"
)

func TestSocket(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/sockstest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"io"
"net"

"golang.org/x/net/internal/nettest"
"golang.org/x/net/internal/socks"
"golang.org/x/net/nettest"
)

// An AuthRequest represents an authentication request.
Expand Down
Loading

0 comments on commit 63eda1e

Please sign in to comment.