1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:30:07 -07:00

log/syslog: disable unix/unixgram tests on android

unix/unixgram is not available to standard Android programs.

For golang/go#10807

Change-Id: I6062c3a25cffb86e58cbbd12a07dc90ffbf57185
Reviewed-on: https://go-review.googlesource.com/16114
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Hyang-Ah Hana Kim 2015-10-20 14:48:49 -04:00
parent 5174df9087
commit 08d04ba2a4

View File

@ -47,6 +47,22 @@ func runPktSyslog(c net.PacketConn, done chan<- string) {
var crashy = false
func testableNetwork(network string) bool {
switch network {
case "unix", "unixgram":
switch runtime.GOOS {
case "darwin":
switch runtime.GOARCH {
case "arm", "arm64":
return false
}
case "android":
return false
}
}
return true
}
func runStreamSyslog(l net.Listener, done chan<- string, wg *sync.WaitGroup) {
for {
var c net.Conn
@ -119,12 +135,10 @@ func startServer(n, la string, done chan<- string) (addr string, sock io.Closer,
func TestWithSimulated(t *testing.T) {
msg := "Test 123"
transport := []string{"unix", "unixgram", "udp", "tcp"}
if runtime.GOOS == "darwin" {
switch runtime.GOARCH {
case "arm", "arm64":
transport = []string{"udp", "tcp"}
var transport []string
for _, n := range []string{"unix", "unixgram", "udp", "tcp"} {
if testableNetwork(n) {
transport = append(transport, n)
}
}
@ -150,14 +164,11 @@ func TestWithSimulated(t *testing.T) {
}
func TestFlap(t *testing.T) {
if runtime.GOOS == "darwin" {
switch runtime.GOARCH {
case "arm", "arm64":
t.Skipf("skipping on %s/%s", runtime.GOOS, runtime.GOARCH)
}
net := "unix"
if !testableNetwork(net) {
t.Skipf("skipping on %s/%s; 'unix' is not supported", runtime.GOOS, runtime.GOARCH)
}
net := "unix"
done := make(chan string)
addr, sock, srvWG := startServer(net, "", done)
defer srvWG.Wait()
@ -321,10 +332,10 @@ func TestConcurrentReconnect(t *testing.T) {
const N = 10
const M = 100
net := "unix"
if runtime.GOOS == "darwin" {
switch runtime.GOARCH {
case "arm", "arm64":
net = "tcp"
if !testableNetwork(net) {
net = "tcp"
if !testableNetwork(net) {
t.Skipf("skipping on %s/%s; neither 'unix' or 'tcp' is supported", runtime.GOOS, runtime.GOARCH)
}
}
done := make(chan string, N*M)