Commit 08d04ba2 authored by Hyang-Ah Hana Kim's avatar Hyang-Ah Hana Kim

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