syscall: fix unshare test on mips

Change-Id: Iedce3770a92112802f3a45c7b95ee145ab5b187e
Reviewed-on: https://go-review.googlesource.com/23282
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Jess Frazelle 2016-05-19 22:26:01 -07:00 committed by Ian Lance Taylor
parent 16f846a9cb
commit 1ded9fdcff

View file

@ -141,7 +141,7 @@ func TestUnshare(t *testing.T) {
t.Skip("skipping test on Kubernetes-based builders; see Issue 12815") t.Skip("skipping test on Kubernetes-based builders; see Issue 12815")
} }
cmd := exec.Command("ip", "a") cmd := exec.Command("cat", "/proc/net/dev")
cmd.SysProcAttr = &syscall.SysProcAttr{ cmd.SysProcAttr = &syscall.SysProcAttr{
Unshare: syscall.CLONE_NEWNET, Unshare: syscall.CLONE_NEWNET,
} }
@ -152,12 +152,12 @@ func TestUnshare(t *testing.T) {
// Check there is only the local network interface // Check there is only the local network interface
sout := strings.TrimSpace(string(out)) sout := strings.TrimSpace(string(out))
if !strings.Contains(sout, "lo") { if !strings.Contains(sout, "lo:") {
t.Fatalf("Expected lo network interface to exist, got %s", sout) t.Fatalf("Expected lo network interface to exist, got %s", sout)
} }
lines := strings.Split(sout, "\n") lines := strings.Split(sout, "\n")
if len(lines) != 2 { if len(lines) != 3 {
t.Fatalf("Expected 2 lines of output, got %d", len(lines)) t.Fatalf("Expected 3 lines of output, got %d", len(lines))
} }
} }