]> Cypherpunks repositories - gostls13.git/commitdiff
os: ignore Chtimes test failure on NetBSD if fs mounted noatime
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 1 Dec 2017 03:25:02 +0000 (03:25 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 1 Dec 2017 04:25:22 +0000 (04:25 +0000)
Fixes #19293

Change-Id: I35f2f786e2e3972eda21ba5a948433bfcd621269
Reviewed-on: https://go-review.googlesource.com/81355
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/os/os_test.go

index 2d608f4b246706445988d75b0a254ffd0200065f..804cf4a1db29b76ebd6da6828b4a2be43a2e6338 100644 (file)
@@ -1190,7 +1190,12 @@ func testChtimes(t *testing.T, name string) {
                        // the contents are accessed; also, it is set
                        // whenever mtime is set.
                case "netbsd":
-                       t.Logf("AccessTime didn't go backwards; was=%v, after=%v (Ignoring. See NetBSD issue golang.org/issue/19293)", at, pat)
+                       mounts, _ := ioutil.ReadFile("/proc/mounts")
+                       if strings.Contains(string(mounts), "noatime") {
+                               t.Logf("AccessTime didn't go backwards, but see a filesystem mounted noatime; ignoring. Issue 19293.")
+                       } else {
+                               t.Logf("AccessTime didn't go backwards; was=%v, after=%v (Ignoring on NetBSD, assuming noatime, Issue 19293)", at, pat)
+                       }
                default:
                        t.Errorf("AccessTime didn't go backwards; was=%v, after=%v", at, pat)
                }