Commit 7b2b45e5 authored by Mikio Hara's avatar Mikio Hara

net: simplify test helpers

This change consolidates test helpers that test platform capabilities.
testNetwork, testAddress and testListenArgs report whether given
ariguments are testable on the current platform configuration to
mitigate to receive weird test results.

Change-Id: Ie1ed568a1f9cc50f3155945ea01562904bc2c389
Reviewed-on: https://go-review.googlesource.com/8076Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 71756355
......@@ -9,7 +9,6 @@ package net
import (
"os"
"runtime"
"testing"
"time"
)
......@@ -30,23 +29,9 @@ const someTimeout = 10 * time.Second
func TestConnAndListener(t *testing.T) {
for _, tt := range connTests {
switch tt.net {
case "unix":
switch runtime.GOOS {
case "nacl", "plan9", "windows":
continue
}
// iOS does not support unix domain sockets
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm" {
continue
}
case "unixpacket":
switch runtime.GOOS {
case "android", "darwin", "nacl", "openbsd", "plan9", "windows":
continue
case "freebsd": // FreeBSD 8 doesn't support unixpacket
continue
}
if !testableNetwork(tt.net) {
t.Logf("skipping %s test", tt.net)
continue
}
ln, err := Listen(tt.net, tt.addr)
......
......@@ -27,10 +27,6 @@ type connFile interface {
}
func testFileListener(t *testing.T, net, laddr string) {
switch net {
case "tcp", "tcp4", "tcp6":
laddr += ":0" // any available port
}
l, err := Listen(net, laddr)
if err != nil {
t.Fatalf("Listen failed: %v", err)
......@@ -59,32 +55,30 @@ func testFileListener(t *testing.T, net, laddr string) {
var fileListenerTests = []struct {
net string
laddr string
ipv6 bool // test with underlying AF_INET6 socket
linux bool // test with abstract unix domain socket, a Linux-ism
}{
{net: "tcp", laddr: ""},
{net: "tcp", laddr: "0.0.0.0"},
{net: "tcp", laddr: "[::ffff:0.0.0.0]"},
{net: "tcp", laddr: "[::]", ipv6: true},
{net: "tcp", laddr: ":0"},
{net: "tcp", laddr: "0.0.0.0:0"},
{net: "tcp", laddr: "[::ffff:0.0.0.0]:0"},
{net: "tcp", laddr: "[::]:0"},
{net: "tcp", laddr: "127.0.0.1"},
{net: "tcp", laddr: "[::ffff:127.0.0.1]"},
{net: "tcp", laddr: "[::1]", ipv6: true},
{net: "tcp", laddr: "127.0.0.1:0"},
{net: "tcp", laddr: "[::ffff:127.0.0.1]:0"},
{net: "tcp", laddr: "[::1]:0"},
{net: "tcp4", laddr: ""},
{net: "tcp4", laddr: "0.0.0.0"},
{net: "tcp4", laddr: "[::ffff:0.0.0.0]"},
{net: "tcp4", laddr: ":0"},
{net: "tcp4", laddr: "0.0.0.0:0"},
{net: "tcp4", laddr: "[::ffff:0.0.0.0]:0"},
{net: "tcp4", laddr: "127.0.0.1"},
{net: "tcp4", laddr: "[::ffff:127.0.0.1]"},
{net: "tcp4", laddr: "127.0.0.1:0"},
{net: "tcp4", laddr: "[::ffff:127.0.0.1]:0"},
{net: "tcp6", laddr: "", ipv6: true},
{net: "tcp6", laddr: "[::]", ipv6: true},
{net: "tcp6", laddr: ":0"},
{net: "tcp6", laddr: "[::]:0"},
{net: "tcp6", laddr: "[::1]", ipv6: true},
{net: "tcp6", laddr: "[::1]:0"},
{net: "unix", laddr: "@gotest/net", linux: true},
{net: "unixpacket", laddr: "@gotest/net", linux: true},
{net: "unix", laddr: "@gotest/net"},
{net: "unixpacket", laddr: "@gotest/net"},
}
func TestFileListener(t *testing.T) {
......@@ -94,10 +88,8 @@ func TestFileListener(t *testing.T) {
}
for _, tt := range fileListenerTests {
if skipServerTest(tt.net, "unix", tt.laddr, tt.ipv6, false, tt.linux) {
continue
}
if skipServerTest(tt.net, "unixpacket", tt.laddr, tt.ipv6, false, tt.linux) {
if !testableListenArgs(tt.net, tt.laddr, "") {
t.Logf("skipping %s test", tt.net+":"+tt.laddr+"->")
continue
}
testFileListener(t, tt.net, tt.laddr)
......@@ -130,10 +122,6 @@ func testFilePacketConn(t *testing.T, pcf packetConnFile, listen bool) {
}
func testFilePacketConnListen(t *testing.T, net, laddr string) {
switch net {
case "udp", "udp4", "udp6":
laddr += ":0" // any available port
}
l, err := ListenPacket(net, laddr)
if err != nil {
t.Fatalf("ListenPacket failed: %v", err)
......@@ -145,10 +133,6 @@ func testFilePacketConnListen(t *testing.T, net, laddr string) {
}
func testFilePacketConnDial(t *testing.T, net, raddr string) {
switch net {
case "udp", "udp4", "udp6":
raddr += ":12345"
}
c, err := Dial(net, raddr)
if err != nil {
t.Fatalf("Dial failed: %v", err)
......@@ -160,23 +144,21 @@ func testFilePacketConnDial(t *testing.T, net, raddr string) {
}
var filePacketConnTests = []struct {
net string
addr string
ipv6 bool // test with underlying AF_INET6 socket
linux bool // test with abstract unix domain socket, a Linux-ism
net string
addr string
}{
{net: "udp", addr: "127.0.0.1"},
{net: "udp", addr: "[::ffff:127.0.0.1]"},
{net: "udp", addr: "[::1]", ipv6: true},
{net: "udp", addr: "127.0.0.1:0"},
{net: "udp", addr: "[::ffff:127.0.0.1]:0"},
{net: "udp", addr: "[::1]:0"},
{net: "udp4", addr: "127.0.0.1"},
{net: "udp4", addr: "[::ffff:127.0.0.1]"},
{net: "udp4", addr: "127.0.0.1:0"},
{net: "udp4", addr: "[::ffff:127.0.0.1]:0"},
{net: "udp6", addr: "[::1]", ipv6: true},
{net: "udp6", addr: "[::1]:0"},
{net: "ip4:icmp", addr: "127.0.0.1"},
{net: "unixgram", addr: "@gotest3/net", linux: true},
{net: "unixgram", addr: "@gotest3/net"},
}
func TestFilePacketConn(t *testing.T) {
......@@ -186,7 +168,8 @@ func TestFilePacketConn(t *testing.T) {
}
for _, tt := range filePacketConnTests {
if skipServerTest(tt.net, "unixgram", tt.addr, tt.ipv6, false, tt.linux) {
if !testableListenArgs(tt.net, tt.addr, "") {
t.Logf("skipping %s test", tt.net+":"+tt.addr+"->")
continue
}
if os.Getuid() != 0 && tt.net == "ip4:icmp" {
......@@ -194,12 +177,16 @@ func TestFilePacketConn(t *testing.T) {
continue
}
testFilePacketConnListen(t, tt.net, tt.addr)
switch tt.addr {
case "", "0.0.0.0", "[::ffff:0.0.0.0]", "[::]":
default:
if tt.net != "unixgram" {
testFilePacketConnDial(t, tt.net, tt.addr)
switch tt.net {
case "udp", "udp4", "udp6":
host, _, err := SplitHostPort(tt.addr)
if err != nil {
t.Error(err)
continue
}
testFilePacketConnDial(t, tt.net, JoinHostPort(host, "12345"))
case "ip4:icmp":
testFilePacketConnDial(t, tt.net, tt.addr)
}
}
}
......@@ -6,9 +6,7 @@ package net
import (
"fmt"
"os"
"reflect"
"runtime"
"testing"
)
......@@ -64,9 +62,8 @@ func init() {
}
func TestResolveIPAddr(t *testing.T) {
switch runtime.GOOS {
case "nacl":
t.Skipf("skipping test on %q", runtime.GOOS)
if !testableNetwork("ip+nopriv") {
t.Skip("ip+nopriv test")
}
for _, tt := range resolveIPAddrTests {
......@@ -89,16 +86,11 @@ var ipConnLocalNameTests = []struct {
}
func TestIPConnLocalName(t *testing.T) {
switch runtime.GOOS {
case "nacl", "plan9", "windows":
t.Skipf("skipping test on %q", runtime.GOOS)
default:
if os.Getuid() != 0 {
t.Skip("skipping test; must be root")
}
}
for _, tt := range ipConnLocalNameTests {
if !testableNetwork(tt.net) {
t.Logf("skipping %s test", tt.net)
continue
}
c, err := ListenIP(tt.net, tt.laddr)
if err != nil {
t.Fatalf("ListenIP failed: %v", err)
......@@ -111,13 +103,8 @@ func TestIPConnLocalName(t *testing.T) {
}
func TestIPConnRemoteName(t *testing.T) {
switch runtime.GOOS {
case "plan9", "windows":
t.Skipf("skipping test on %q", runtime.GOOS)
default:
if os.Getuid() != 0 {
t.Skip("skipping test; must be root")
}
if !testableNetwork("ip:tcp") {
t.Skip("ip:tcp test")
}
raddr := &IPAddr{IP: IPv4(127, 0, 0, 1).To4()}
......
......@@ -23,6 +23,13 @@ func (a *IPAddr) String() string {
return a.IP.String()
}
func (a *IPAddr) isWildcard() bool {
if a == nil || a.IP == nil {
return true
}
return a.IP.IsUnspecified()
}
func (a *IPAddr) toAddr() Addr {
if a == nil {
return nil
......
......@@ -43,13 +43,6 @@ func (a *IPAddr) family() int {
return syscall.AF_INET6
}
func (a *IPAddr) isWildcard() bool {
if a == nil || a.IP == nil {
return true
}
return a.IP.IsUnspecified()
}
func (a *IPAddr) sockaddr(family int) (syscall.Sockaddr, error) {
if a == nil {
return nil, nil
......
......@@ -63,14 +63,10 @@ func TestShutdown(t *testing.T) {
}
func TestShutdownUnix(t *testing.T) {
switch runtime.GOOS {
case "nacl", "plan9", "windows":
t.Skipf("skipping test on %q", runtime.GOOS)
case "darwin":
if runtime.GOARCH == "arm" {
t.Skipf("skipping test on %s/%s", runtime.GOOS, runtime.GOARCH)
}
if !testableNetwork("unix") {
t.Skip("unix test")
}
f, err := ioutil.TempFile("", "go_net_unixtest")
if err != nil {
t.Fatalf("TempFile: %s", err)
......
......@@ -9,8 +9,6 @@ package net
import (
"os"
"runtime"
"strings"
"testing"
"time"
)
......@@ -21,24 +19,11 @@ import (
// golang.org/x/net/ipv6
// golang.org/x/net/icmp
func packetConnTestData(t *testing.T, net string, i int) ([]byte, func()) {
switch net {
case "udp":
return []byte("UDP PACKETCONN TEST"), nil
case "unixgram":
switch runtime.GOOS {
case "nacl", "plan9", "windows":
return nil, func() {
t.Logf("skipping %q test on %q", net, runtime.GOOS)
}
default:
return []byte("UNIXGRAM PACKETCONN TEST"), nil
}
default:
return nil, func() {
t.Logf("skipping %q test", net)
}
func packetConnTestData(t *testing.T, network string) ([]byte, func()) {
if !testableNetwork(network) {
return nil, func() { t.Logf("skipping %s test", network) }
}
return []byte("PACKETCONN TEST"), nil
}
var packetConnTests = []struct {
......@@ -51,9 +36,6 @@ var packetConnTests = []struct {
}
func TestPacketConn(t *testing.T) {
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm" {
t.Skip("skipping test on darwin/arm")
}
closer := func(c PacketConn, net, addr1, addr2 string) {
c.Close()
switch net {
......@@ -63,9 +45,8 @@ func TestPacketConn(t *testing.T) {
}
}
for i, tt := range packetConnTests {
netstr := strings.Split(tt.net, ":")
wb, skipOrFatalFn := packetConnTestData(t, netstr[0], i)
for _, tt := range packetConnTests {
wb, skipOrFatalFn := packetConnTestData(t, tt.net)
if skipOrFatalFn != nil {
skipOrFatalFn()
continue
......@@ -75,7 +56,7 @@ func TestPacketConn(t *testing.T) {
if err != nil {
t.Fatalf("ListenPacket failed: %v", err)
}
defer closer(c1, netstr[0], tt.addr1, tt.addr2)
defer closer(c1, tt.net, tt.addr1, tt.addr2)
c1.LocalAddr()
c1.SetDeadline(time.Now().Add(500 * time.Millisecond))
c1.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
......@@ -85,7 +66,7 @@ func TestPacketConn(t *testing.T) {
if err != nil {
t.Fatalf("ListenPacket failed: %v", err)
}
defer closer(c2, netstr[0], tt.addr1, tt.addr2)
defer closer(c2, tt.net, tt.addr1, tt.addr2)
c2.LocalAddr()
c2.SetDeadline(time.Now().Add(500 * time.Millisecond))
c2.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
......@@ -109,9 +90,6 @@ func TestPacketConn(t *testing.T) {
}
func TestConnAndPacketConn(t *testing.T) {
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm" {
t.Skip("skipping test on darwin/arm")
}
closer := func(c PacketConn, net, addr1, addr2 string) {
c.Close()
switch net {
......@@ -121,10 +99,9 @@ func TestConnAndPacketConn(t *testing.T) {
}
}
for i, tt := range packetConnTests {
for _, tt := range packetConnTests {
var wb []byte
netstr := strings.Split(tt.net, ":")
wb, skipOrFatalFn := packetConnTestData(t, netstr[0], i)
wb, skipOrFatalFn := packetConnTestData(t, tt.net)
if skipOrFatalFn != nil {
skipOrFatalFn()
continue
......@@ -134,7 +111,7 @@ func TestConnAndPacketConn(t *testing.T) {
if err != nil {
t.Fatalf("ListenPacket failed: %v", err)
}
defer closer(c1, netstr[0], tt.addr1, tt.addr2)
defer closer(c1, tt.net, tt.addr1, tt.addr2)
c1.LocalAddr()
c1.SetDeadline(time.Now().Add(500 * time.Millisecond))
c1.SetReadDeadline(time.Now().Add(500 * time.Millisecond))
......@@ -159,9 +136,7 @@ func TestConnAndPacketConn(t *testing.T) {
t.Fatalf("PacketConn.ReadFrom failed: %v", err)
}
var dst Addr
switch netstr[0] {
case "ip":
dst = &IPAddr{IP: IPv4(127, 0, 0, 1)}
switch tt.net {
case "unixgram":
continue
default:
......
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package net
import (
"os"
"runtime"
"strings"
"testing"
)
// testableNetwork reports whether network is testable on the current
// platform configuration.
func testableNetwork(network string) bool {
switch ss := strings.Split(network, ":"); ss[0] {
case "ip+nopriv":
switch runtime.GOOS {
case "nacl":
return false
}
case "ip", "ip4", "ip6":
switch runtime.GOOS {
case "nacl", "plan9":
return false
default:
if os.Getuid() != 0 {
return false
}
}
case "unix", "unixgram":
switch runtime.GOOS {
case "nacl", "plan9", "windows":
return false
}
// iOS does not support unix, unixgram.
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
return false
}
case "unixpacket":
switch runtime.GOOS {
case "android", "darwin", "nacl", "openbsd", "plan9", "windows":
fallthrough
case "freebsd": // FreeBSD 8 and below don't support unixpacket
return false
}
}
return true
}
// testableAddress reports whether address of network is testable on
// the current platform configuration.
func testableAddress(network, address string) bool {
switch ss := strings.Split(network, ":"); ss[0] {
case "unix", "unixgram", "unixpacket":
// Abstract unix domain sockets, a Linux-ism.
if address[0] == '@' && runtime.GOOS != "linux" {
return false
}
}
return true
}
// testableListenArgs reports whether arguments are testable on the
// current platform configuration.
func testableListenArgs(network, address, client string) bool {
if !testableNetwork(network) || !testableAddress(network, address) {
return false
}
var err error
var addr Addr
switch ss := strings.Split(network, ":"); ss[0] {
case "tcp", "tcp4", "tcp6":
addr, err = ResolveTCPAddr("tcp", address)
case "udp", "udp4", "udp6":
addr, err = ResolveUDPAddr("udp", address)
case "ip", "ip4", "ip6":
addr, err = ResolveIPAddr("ip", address)
default:
return true
}
if err != nil {
return false
}
var ip IP
var wildcard bool
switch addr := addr.(type) {
case *TCPAddr:
ip = addr.IP
wildcard = addr.isWildcard()
case *UDPAddr:
ip = addr.IP
wildcard = addr.isWildcard()
case *IPAddr:
ip = addr.IP
wildcard = addr.isWildcard()
}
// Test wildcard IP addresses.
if wildcard && (testing.Short() || !*testExternal) {
return false
}
// Test functionality of IPv6 communication using AF_INET6
// sockets.
if !supportsIPv6 && ip.To16() != nil && ip.To4() == nil {
return false
}
// Test functionality of IPv4 communication using AF_INET6
// sockets.
cip := ParseIP(client)
if !supportsIPv4map && (network == "tcp" || network == "udp" || network == "ip") && wildcard {
// At this point, we prefer IPv4 when ip is nil.
// See favoriteAddrFamily for further information.
if ip.To16() != nil && ip.To4() == nil && cip.To4() != nil { // a pair of IPv6 server and IPv4 client
return false
}
if (ip.To4() != nil || ip == nil) && cip.To16() != nil && cip.To4() == nil { // a pair of IPv4 server and IPv6 client
return false
}
}
return true
}
var condFatalf = func() func(*testing.T, string, ...interface{}) {
// A few APIs, File, Read/WriteMsg{UDP,IP}, are not
// implemented yet on both Plan 9 and Windows.
switch runtime.GOOS {
case "plan9", "windows":
return (*testing.T).Logf
}
return (*testing.T).Fatalf
}()
......@@ -35,15 +35,6 @@ func testUnixAddr() string {
return addr
}
var condFatalf = func() func(*testing.T, string, ...interface{}) {
// A few APIs are not implemented yet on both Plan 9 and Windows.
switch runtime.GOOS {
case "plan9", "windows":
return (*testing.T).Logf
}
return (*testing.T).Fatalf
}()
func TestTCPListenerSpecificMethods(t *testing.T) {
switch runtime.GOOS {
case "plan9":
......@@ -218,13 +209,8 @@ func TestIPConnSpecificMethods(t *testing.T) {
}
func TestUnixListenerSpecificMethods(t *testing.T) {
switch runtime.GOOS {
case "nacl", "plan9", "windows":
t.Skipf("skipping test on %q", runtime.GOOS)
case "darwin":
if runtime.GOARCH == "arm" {
t.Skipf("skipping test on %s/%s", runtime.GOOS, runtime.GOARCH)
}
if !testableNetwork("unix") {
t.Skip("unix test")
}
addr := testUnixAddr()
......@@ -264,13 +250,8 @@ func TestUnixListenerSpecificMethods(t *testing.T) {
}
func TestUnixConnSpecificMethods(t *testing.T) {
switch runtime.GOOS {
case "nacl", "plan9", "windows":
t.Skipf("skipping test on %q", runtime.GOOS)
case "darwin":
if runtime.GOARCH == "arm" {
t.Skipf("skipping test on %s/%s", runtime.GOOS, runtime.GOARCH)
}
if !testableNetwork("unixgram") {
t.Skip("unixgram test")
}
addr1, addr2, addr3 := testUnixAddr(), testUnixAddr(), testUnixAddr()
......
This diff is collapsed.
......@@ -25,6 +25,13 @@ func (a *TCPAddr) String() string {
return JoinHostPort(ip, itoa(a.Port))
}
func (a *TCPAddr) isWildcard() bool {
if a == nil || a.IP == nil {
return true
}
return a.IP.IsUnspecified()
}
func (a *TCPAddr) toAddr() Addr {
if a == nil {
return nil
......
......@@ -38,13 +38,6 @@ func (a *TCPAddr) family() int {
return syscall.AF_INET6
}
func (a *TCPAddr) isWildcard() bool {
if a == nil || a.IP == nil {
return true
}
return a.IP.IsUnspecified()
}
func (a *TCPAddr) sockaddr(family int) (syscall.Sockaddr, error) {
if a == nil {
return nil, nil
......
......@@ -25,6 +25,13 @@ func (a *UDPAddr) String() string {
return JoinHostPort(ip, itoa(a.Port))
}
func (a *UDPAddr) isWildcard() bool {
if a == nil || a.IP == nil {
return true
}
return a.IP.IsUnspecified()
}
func (a *UDPAddr) toAddr() Addr {
if a == nil {
return nil
......
......@@ -31,13 +31,6 @@ func (a *UDPAddr) family() int {
return syscall.AF_INET6
}
func (a *UDPAddr) isWildcard() bool {
if a == nil || a.IP == nil {
return true
}
return a.IP.IsUnspecified()
}
func (a *UDPAddr) sockaddr(family int) (syscall.Sockaddr, error) {
if a == nil {
return nil, nil
......
......@@ -17,9 +17,10 @@ import (
)
func TestReadUnixgramWithUnnamedSocket(t *testing.T) {
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
t.Skipf("skipping unixgram test on %s/%s", runtime.GOOS, runtime.GOARCH)
if !testableNetwork("unixgram") {
t.Skip("unixgram test")
}
addr := testUnixAddr()
la, err := ResolveUnixAddr("unixgram", addr)
if err != nil {
......@@ -67,8 +68,8 @@ func TestReadUnixgramWithUnnamedSocket(t *testing.T) {
}
func TestReadUnixgramWithZeroBytesBuffer(t *testing.T) {
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
t.Skipf("skipping unixgram test on %s/%s", runtime.GOOS, runtime.GOARCH)
if !testableNetwork("unixgram") {
t.Skip("unixgram test")
}
// issue 4352: Recvfrom failed with "address family not
// supported by protocol family" if zero-length buffer provided
......@@ -149,6 +150,7 @@ func TestUnixAutobindClose(t *testing.T) {
if runtime.GOOS != "linux" {
t.Skip("skipping: autobind is linux only")
}
laddr := &UnixAddr{Name: "", Net: "unix"}
ln, err := ListenUnix("unix", laddr)
if err != nil {
......@@ -158,9 +160,10 @@ func TestUnixAutobindClose(t *testing.T) {
}
func TestUnixgramWrite(t *testing.T) {
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
t.Skipf("skipping unixgram test on %s/%s", runtime.GOOS, runtime.GOARCH)
if !testableNetwork("unixgram") {
t.Skip("unixgram test")
}
addr := testUnixAddr()
laddr, err := ResolveUnixAddr("unixgram", addr)
if err != nil {
......@@ -228,9 +231,10 @@ func testUnixgramWritePacketConn(t *testing.T, raddr *UnixAddr) {
}
func TestUnixConnLocalAndRemoteNames(t *testing.T) {
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
t.Skipf("skipping unixgram test on %s/%s", runtime.GOOS, runtime.GOARCH)
if !testableNetwork("unix") {
t.Skip("unix test")
}
for _, laddr := range []string{"", testUnixAddr()} {
laddr := laddr
taddr := testUnixAddr()
......@@ -290,9 +294,10 @@ func TestUnixConnLocalAndRemoteNames(t *testing.T) {
}
func TestUnixgramConnLocalAndRemoteNames(t *testing.T) {
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
t.Skipf("skipping unixgram test on %s/%s", runtime.GOOS, runtime.GOARCH)
if !testableNetwork("unixgram") {
t.Skip("unixgram test")
}
for _, laddr := range []string{"", testUnixAddr()} {
laddr := laddr
taddr := testUnixAddr()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment