]> Cypherpunks repositories - gostls13.git/commitdiff
net: skip test in full test mode when running in a container
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 24 May 2018 19:02:39 +0000 (19:02 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 24 May 2018 19:45:22 +0000 (19:45 +0000)
Fixes #25546

Change-Id: I00457b370ed6dcd7ee9efcae3fd914e4c384b12c
Reviewed-on: https://go-review.googlesource.com/114475
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
src/net/interface_unix_test.go

index 36510ebf080fbf54cbfe04f7995a6d1ead9dcad6..c3d981dc5c54bc235d0feef84e1a856700353e6c 100644 (file)
@@ -11,6 +11,7 @@ import (
        "os"
        "os/exec"
        "runtime"
+       "strings"
        "testing"
        "time"
 )
@@ -62,6 +63,9 @@ func TestPointToPointInterface(t *testing.T) {
                        t.Skipf("test requires external command: %v", err)
                }
                if err := ti.setup(); err != nil {
+                       if e := err.Error(); strings.Contains(e, "No such device") && strings.Contains(e, "gre0") {
+                               t.Skip("skipping test; no gre0 device. likely running in container?")
+                       }
                        t.Fatal(err)
                } else {
                        time.Sleep(3 * time.Millisecond)